Last change
on this file since 58 was
56,
checked in by meunier, 12 years ago
|
- Tried to fix a problem with echo
- Started to resolve some tests failing (often because of the test itself)
|
File size:
889 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]; |
---|
| 24 | hard a("a"); |
---|
| 25 | hard b("b"); |
---|
| 26 | a.i(s[0]); |
---|
| 27 | a.o(s[1]); |
---|
[56] | 28 | b.i(s[5]); // Wrong array index |
---|
[55] | 29 | b.o(s[2]); |
---|
[1] | 30 | |
---|
[55] | 31 | sc_start(sc_time(0, sc_core::SC_NS)); |
---|
| 32 | |
---|
| 33 | sc_start(sc_time(1, sc_core::SC_NS)); |
---|
| 34 | |
---|
| 35 | return 0; |
---|
[1] | 36 | } |
---|
| 37 | |
---|
[55] | 38 | |
---|
| 39 | /* |
---|
| 40 | # Local Variables: |
---|
| 41 | # tab-width: 4; |
---|
| 42 | # c-basic-offset: 4; |
---|
| 43 | # c-file-offsets:((innamespace . 0)(inline-open . 0)); |
---|
| 44 | # indent-tabs-mode: nil; |
---|
| 45 | # End: |
---|
| 46 | # |
---|
| 47 | # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 48 | */ |
---|
| 49 | |
---|
Note: See
TracBrowser
for help on using the repository browser.