|
|
|
|
|
|
|
|
|
|
|
|
Example : keep_only
|
|
|
|
|
|
1 #include <scv.h>
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 }
You could download file scv_keep_only.cpp here
|
|
|
|
|
|
|
|
|
|
|
|
Simulation Output : keep_only
|
|
|
|
|
|
93
74
83
9
84
17
48
47
39
1
|
|
|
|
|
|
Example : keep_out
|
|
|
|
|
|
1 #include <scv.h>
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 }
You could download file scv_keep_out.cpp here
|
|
|
|
|
|
Simulation Output : keep_out
|
|
|
|
|
|
2
0
0
0
2
0
0
3
2
3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright © 1998-2014 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|