'컴퓨터 과학!/SCA'에 해당되는 글 4건

  1. 2007.12.14 SystemC 프로세스 2
  2. 2007.12.09 IDL 2
  3. 2007.03.02 IDL 4
  4. 2007.03.02 CORBA
컴퓨터 과학!/SCA2007. 12. 14. 21:13
SystemC process는 thread process와 method process가 있는데, 이외에 cthread(clock thread) process와 dynamic process도 있다.

0. 시뮬레이션 커널
시뮬레이션 커널에는  Waiting Pool, Ready Pool, Event Pool이 있고, Ready Pool에 있는 process를 꺼내어 실행하고, return명령으로 함수 실행이 끝나거나  wait()호촐로 process가 일시 정지되면 Waiting Pool로 이동한다. 실행 중인 프로세스에서 event를 notify하면 해당 event를 Event Pool에 넣는다.

Ready pool에 있는 모든 process를 싱행하면 하나의 evaluation단계가 끝나게 되고, event pool에 의해 다음 evaluation 단계가 실행된다.

주의할 점은, evaluation 실행 동안에는 시뮬레이션 시간이 정지한다(zero time)는 점이다. Evaluation이 끝나면 event pool에 있는 event를 보고, 지정된 시뮬레이션 시간이 진행된 뒤, 그에 sensitive한 process를 waiting pool에서 ready pool로 옮기고 다시 evaluation을 실행한다.

Ready pool, wating pool, event pool이 모두 비면 시뮬레이션을 종료한다.

Zero time 안에 실행되는 프로세스의 실행 순서는 non-deterministic이고, 시뮬레이션 결과는 consistency를 유지해야 한다.

sc_module 클래스의 멤버함수를 시뮬레이션 process로 사용하려면 시뮬레이션 커널에 등록해야 한다. 이렇게 등록된 process는 커널의 스케쥴러를 통해 호출된다.
이러한 process는 constructor안에서 등록한다.

1. SC_THREAD  
SC_THREAD( process_name );
process_name은 등록할 멤버함수의 이름이다. 주의할 점은, 프로세스로 등록할 함수는 parameter와 return value가 없다는 것이다. 이는 시뮬레이션 커널이 프로세스를 호출하는 메커니즘을 단순화하기 위해서 만들어진 규칙이다.

Thread process는 시뮬레이터에 의해 한 번만 호출된다. SystemC는 nonpreemptive scheduling 방식을 사용하므로, thread는 return/waiting 이 아니면 시뮬레이터를 독점한다. 따라서 보통의 thread process는 while(true)와 같은 구문에 wait를 가지는 구조로 설계된다.
wait 없이 간접적으로 process가 일시정지 되는 경우도 있는데, FIFO 채널에서 읽을 데이터가 없거나 쓸 공간이 없을 때 가능해 질 때 까지 일시정지된다.

2. SC_METHOD 
SC_METHOD( process_name );
Thread process에 비해 기능이 단순하여 다양한 모델링에 적용하기에는 부족하지만, 가볍기 때문에 효율적이다. Thread process와의 가장 큰 차이점은 wait()를 사용할 수 없으며, return에 의해서만 실행이 중지된다. 또한, event에 의해 여러번 호출될 수 있다.
따라서, method process는 간접적으로 중지될 수 있는 sc_fifo등을 사용하면 안된다.

Tread와 method는 그 이름에서 알 수 있듯이, tread의 경우 중단된 이후애 실행이 resume되었을 때, 그 전의 변수값들이 보존되어있다. 그라나 method process의 경우, 실행 중간에 중단되지 않으며, 실행이 종료된 이후, 이벤트 틍에 의해 시뮬레이션 커널이 다시 호출하였을 때에는 변수값들이 모두 초기화된다. Process를 method로 할 것이냐 thread로 할 것이냐를 결정할 때 이러한 사항도 고려해야 한다.
Posted by 스니
컴퓨터 과학!/SCA2007. 12. 9. 18:05

IDL

인터페이스 정의언어, 구현언어로 매핑을 지원.
객체지향 개념. C++의 class와 비슷하지만,  JAVA의 interface와 더욱 유사.

interface Sample {
    attribute long a; // attribute 키워드 없으면 에러.
    readonly attribute string b;
    string oper1();
    oneway void oper2();
    void oper3() raises(UsrException);
};

간단히 뭐 이런 식.

상속 가능, 다중 상속도 가능, 단 상속 받을 interface간에 같은 이름이 있으면 안됨.
interface A {
    attribute long l;
    void oper();
};
interface B {
    attribute long l; // 이름 충돌 에러 발생
};
interface C: A, B {
    void oper(); // 재정의 시도 에러 발생
};

Scop을 정하고 계층화 하는 module을 사용할 수도 있음.
module CF {
    interface DomainManager{};
    module CF1{
        interface Resource{};
    };
};
CF::DomainManager, CF:CF1:Resource 이런 식으로 접근이 가능함.

이렇게 만들어진 IDL 파일과 실제 구현과의 mapping은 IDL 컴파일러가 하는 것 같은데,
그 과정이 궁금함. 프로그래머는 어느 수준까지 정의해 줘야 하는가?

Posted by 스니
컴퓨터 과학!/SCA2007. 3. 2. 20:16

IDL

The Interface Definition Language (IDL) is the language CORBA defines for specifying the features (methods, attributes) of an object in a language-independent way.
In order to enable different programming languages (and machines, operating systems) to deal with CORBA objects, it's necessary to agree on some standard notation to describe what features (methods, attributes) objects expose. CORBA offers such a standard notation: the Interface Definition Language (IDL). IDL looks a lot like C++ (or Java) class definition. Note that IDL in Microsoft's COM technology context is not the same as CORBA IDL. They are quite similar, however.
Note that IDL only specifies the methods and attributes an object supports - the programmer has complete freedom as how to implement these, as long as he respects the definition in the IDL file.

CORBA가 이종간의 통신을 가능하게 하는 것이기 때문에, 이종간에 인터페이스를 공통으로 정의해 주기 위해서 필요한 것이 IDL 인 것으로 파악됨.
Posted by 스니
컴퓨터 과학!/SCA2007. 3. 2. 20:05
CORBA (Common Object Request Broker Architecture) is a set of standards which define what is called a distributed object system. These standards were written by the OMG (Object Management Group). The OMG is made up of more than 700 firms who are pursuing common agreement on standard protocols. CORBA defines the protocol for interaction between objects. As stated, these object may be written in different programming languages, run on different operating systems, live on different machines.
사용자 삽입 이미지













- http://developer.gnome.org/doc/guides/corba/html/p56.html



분산 환경을 위한 RPC 라고 할 수 있겠다. RPC 처럼 Stub도 있고, skeleton도 있다.
통신 프로토콜이라고 생각하자.

내가 아는 ORB(Object Request Broker)로는 omniORB(OSSIE)와 e*ORB(OSSIE for C64), openORB(SCARIOpen)가 있다.
물론, 그냥 저런게 있다는 정도만 알 뿐이다. 지금으로썬.
Posted by 스니