Last change
on this file since 64 was
60,
checked in by meunier, 8 years ago
|
- Intégration des modifications de Clément,
qui a intégré la version parallélisée de systemcass
faite par Manuel.
|
File size:
983 bytes
|
Rev | Line | |
---|
[55] | 1 | |
---|
[1] | 2 | #include "systemc.h" |
---|
| 3 | |
---|
[55] | 4 | #include "test.h" |
---|
[1] | 5 | |
---|
[56] | 6 | /* |
---|
| 7 | * Test for detecting an overflow in an array of sc_signal. |
---|
| 8 | * I (QM) am not sure it is possible to detect that actually... |
---|
| 9 | */ |
---|
| 10 | |
---|
[1] | 11 | using namespace std; |
---|
| 12 | |
---|
[55] | 13 | struct hard : sc_module { |
---|
| 14 | sc_in<bool> i; |
---|
| 15 | sc_out<bool> o; |
---|
| 16 | SC_HAS_PROCESS(hard); |
---|
| 17 | hard(sc_module_name) {} |
---|
[1] | 18 | }; |
---|
| 19 | |
---|
| 20 | |
---|
[55] | 21 | int sc_main (int argc, char ** argv) { |
---|
| 22 | sc_clock signal_clk("my_clock", sc_time(1, sc_core::SC_NS)); |
---|
| 23 | sc_signal<bool> s[5]; |
---|
[60] | 24 | |
---|
| 25 | // Setup number of threads open-mp to 1 with the macro threads_omp() |
---|
| 26 | threads_omp(); |
---|
| 27 | |
---|
[55] | 28 | hard a("a"); |
---|
| 29 | hard b("b"); |
---|
| 30 | a.i(s[0]); |
---|
| 31 | a.o(s[1]); |
---|
[56] | 32 | b.i(s[5]); // Wrong array index |
---|
[55] | 33 | b.o(s[2]); |
---|
[1] | 34 | |
---|
[55] | 35 | sc_start(sc_time(0, sc_core::SC_NS)); |
---|
| 36 | |
---|
| 37 | sc_start(sc_time(1, sc_core::SC_NS)); |
---|
| 38 | |
---|
| 39 | return 0; |
---|
[1] | 40 | } |
---|
| 41 | |
---|
[55] | 42 | |
---|
| 43 | /* |
---|
| 44 | # Local Variables: |
---|
| 45 | # tab-width: 4; |
---|
| 46 | # c-basic-offset: 4; |
---|
| 47 | # c-file-offsets:((innamespace . 0)(inline-open . 0)); |
---|
| 48 | # indent-tabs-mode: nil; |
---|
| 49 | # End: |
---|
| 50 | # |
---|
| 51 | # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 52 | */ |
---|
| 53 | |
---|
Note: See
TracBrowser
for help on using the repository browser.