|
Last change
on this file was
60,
checked in by meunier, 9 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
|
| Line | |
|---|
| 1 | |
|---|
| 2 | #include "systemc.h" |
|---|
| 3 | |
|---|
| 4 | #include "test.h" |
|---|
| 5 | |
|---|
| 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 | |
|---|
| 11 | using namespace std; |
|---|
| 12 | |
|---|
| 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) {} |
|---|
| 18 | }; |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 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]; |
|---|
| 24 | |
|---|
| 25 | // Setup number of threads open-mp to 1 with the macro threads_omp() |
|---|
| 26 | threads_omp(); |
|---|
| 27 | |
|---|
| 28 | hard a("a"); |
|---|
| 29 | hard b("b"); |
|---|
| 30 | a.i(s[0]); |
|---|
| 31 | a.o(s[1]); |
|---|
| 32 | b.i(s[5]); // Wrong array index |
|---|
| 33 | b.o(s[2]); |
|---|
| 34 | |
|---|
| 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; |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 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.