Home / admin (page 2)

admin

Multiple event notifications

A given event shall have no more than one pending notification. If function notify is called for an event that already has a notification pending, only the notification scheduled to occur at the earliest time shall survive. The notification scheduled to occur at the later time shall be canceled (or …

Read More »

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 »

How does GCOV work?

GCOV sử dụng hai tệp để phân tích. Tên của các tệp này được bắt nguồn từ tệp gốc object bằng cách thay thế phần hậu tố của tệp bằng .gcno hoặc .gcda. Các tệp chứa dữ liệu coverage và profile được lưu trữ ở định dạng platform-independent. Các tệp …

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 »

How does “#include” keyword work?

Giải thích về #include trong C++ #: Là ký hiệu pound sign, giúp tiền xử lý chương trình trước khi biên dịch. include : Là một chỉ thị đơn giản yêu cầu trình tiền xử lý bao gồm dữ liệu của thư viện (tức là khai báo các hàm). Cách …

Read More »

How to fix : “Error downloading http://arduino…”

When you install the ESP8266 board in Arduino IDE . Some times, you can get an error.  Error downloading http://arduino.esp8266.com/stable/package_esp8266com_index.json You can fix the error in 2 ways: Using other networks » delete folder Arduino15 in “C:\Users\Administrator\AppData\Local”   » disconnect current network and using DCOM 3G network. Using other source address » …

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 »