Verification Using SystemC Part IX

Print

Example : keep_only

  1 #include 
  2 
  3 int sc_main(int argc, char** argv) {
  4   // Set the Seed to 1
  5   scv_random::set_global_seed(1);
  6   scv_smart_ptr<int> data;
  7   data->keep_only(0,100); 
  8   for (int i = 0; i < 10; i ++) {
  9     data->next();
 10     data->print();
 11   }
 12   return (0);
 13 }

Simulation Output : keep_only

 93

 74

 83

 9

 84

 17

 48

 47

 39

 1

Example : keep_out

  1 #include 
  2 
  3 int sc_main(int argc, char** argv) {
  4   // Set the Seed to 1
  5   scv_random::set_global_seed(1);
  6   scv_smart_ptr<int> data;
  7   data->keep_only(0,3); 
  8   data->keep_out(1); 
  9   for (int i = 0; i < 10; i ++) {
 10     data->next();
 11     data->print();
 12   }
 13   return (0);
 14 }

Simulation Output : keep_out
 2

 0

 0

 0

 2

 0

 0

 3

 2

 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  

 

Last Updated ( Tuesday, 29 March 2022 00:43 )