Home / SystemC (page 2)

SystemC

SystemC . sc_find_object()

¤ Overview sc_object* sc_find_object( const char* ); sc_find_object() function cho phép tìm một object dựa trên hierarchical name. sc_find_object() function sẽ trả về một pointer với loại là sc_object khi mà hierarchical name của object đó khớp với chuỗi kí tự truyền vào. Ngược lại sẽ trả về một null …

Read More »

Communication via Ports with User-defined Data Types

SystemC supports many data types to communicate between 2 ports. eg: bool, unsigned char, unsigned int, sc_uint, … But, in some cases, we want to use a user-defined data type. In this post, we are going to discuss it. Suppose, DUT_1 model needs some info of DUT_2 model. It is …

Read More »

What’s the difference between wait() and next_trigger()

DIFFERENCE: wait() sử dụng cho 1 thread, next_trigger() sử dụng cho 1 method Không giống wait(), việc dùng next_trigger() không suspend 1 process EXAMPLE: #include <systemc.h> SC_MODULE(next_trigger_and_wait) { sc_in<bool> clock; sc_event e1, e2; int cnt,cnt0; void do_wait_thread() { while (1) { cout << "[ THREAD] "<<sc_time_stamp().to_string()<<endl; switch (cnt0) { case …

Read More »

What’s the difference between notify() and notify(SC_ZERO_TIME)

notify() function dùng để trigger một event. Nó có một vài biến thể dưới đây. notify() :Immediate notification notify(SC_ZERO_TIME) :Delta notification notify(double v, sc_time_unit tu) :Timed notification SystemC notify Thực tế, Delta notification là Timed notification với giá trị thời gian v = 0. Khi một event sử dụng Immediate …

Read More »

Unit tests SystemC model with GTest

Dựa trên Google Test, chúng tôi xây dựng một khung mẫu (template framework) cho hệ thống kiểm thử đơn vị (unit test) dành cho mô hình SystemC. Để biết thêm thông tin về Google Test, bạn có thể tham khảo here Bằng cách sử dụng khung mẫu này, bạn có …

Read More »