Trung tâm đào tạo thiết kế vi mạch Semicon


  • ĐĂNG KÝ TÀI KHOẢN ĐỂ TRUY CẬP NHIỀU TÀI LIỆU HƠN!
  • Đăng ký
    *
    *
    *
    *
    *
    Fields marked with an asterisk (*) are required.
semi1_solvingproblems.jpg

Verification Using SystemC Part X

Email In PDF.

Seed Management
SCV provides support for Global Seed Setting and Unique seed setting for each thread. When no seed setting is done, then default seed 1 is assume

Global Seed Management is done with method
scv_random::set_global_seed().
We have already seen in last few examples on how to set the global seed

Variable And Transaction Recording
In order to effectively debug a simulation run, visualization of events and activities is very important. A test bench must be able to record appropriate data into a database to support visualization. The same database can also be used to perform coverage analysis. This section describes the API from which the user can control what information is recorded in the database.
Two kinds of recordings have been considered. Because value transitions in variables can be recorded using value-change callbacks, only the callback registration API in the data introspection facility is included in the SystemC Verification Standard. Two kinds of recording are as below.

  • Variable Recording
  • Variable Recording

Variable Recording
The values of a variable across time can be recorded into a database using the VCD facility in SystemC. However, it is more efficient to associate variable recording to value-change callbacks.
Using the data introspection facility described earlier, value-change callbacks can also be performed on a data object by using scv_smart_ptr. Using value-change callbacks in a data object is different from using value-change callbacks in a signal. Using data introspection, value-change callbacks can be registered in a data object of any type, and the callbacks will be executed whenever an assignment to the data object is performed, regardless of whether the new value is the same as the old value or not.
If an action should be taken only when a different value is assigned to the data object, the callback function could be written to store the previous value and to ignore invocations when the new value is the same as the previous value.

Example : Callback 

  1 #include

  2

  3 void my_callback ( scv_extensions_if& data,

  4                    scv_extensions_if::callback_reason r) {

  5   if (r == scv_extensions_if::VALUE_CHANGE) {

  6      cout << "The data is assigned value : ";

  7      data.print();

  8      // Do what ever you want to do

  9   }

 10 }

 11

 12 int sc_main(int argc, char** argv) {

 13   // Set the Seed to 1

 14   scv_random::set_global_seed(1);

 15   scv_smart_ptr<int> data;

 16

 17   data->register_cb(my_callback);

 18   data->keep_only(0,3);

 19   data->keep_out(1);

 20   for (int i = 0; i < 10; i ++) {

 21     data->next();

 22     data->print();

 23   }

 24   return (0);

 25 }
Simulation Output : Callback

 The data is assigned value : 2

 2

 The data is assigned value : 0

 0

 The data is assigned value : 0

 0

 The data is assigned value : 0

 0

 The data is assigned value : 2

 2

 The data is assigned value : 0

 0

 The data is assigned value : 0

 0

 The data is assigned value : 3

 3

 The data is assigned value : 2

 2

 The data is assigned value : 3

 3

 Bạn Có Đam Mê Với Vi Mạch hay Nhúng      -     Bạn Muốn Trau Dồi Thêm Kĩ Năng

Mong Muốn Có Thêm Cơ Hội Trong Công Việc

Và Trở Thành Một Người Có Giá Trị Hơn

Bạn Chưa Biết Phương Thức Nào Nhanh Chóng Để Đạt Được Chúng

Hãy Để Chúng Tôi Hỗ Trợ Cho Bạn. SEMICON  

 

 

CÁC BÀI VIẾT LIÊN QUAN