Changeset 55 for sources/test_regression/05092005/system.cpp
- Timestamp:
- May 28, 2013, 11:17:14 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/test_regression/05092005/system.cpp
r1 r55 1 1 2 #include "systemc.h" 2 3 3 #define ASSERT(x) \ 4 { errnum++; \ 5 if (!(x)) \ 6 { \ 7 cerr << "ASSERT : " #x "\n"; \ 8 exit (errnum); \ 9 } \ 10 } 4 #include "test.h" 11 5 12 6 using namespace std; 13 7 14 struct hard : sc_module 15 { 16 sc_in <bool> i; 17 sc_out<bool> o; 18 SC_HAS_PROCESS(hard); 19 hard(sc_module_name) 20 { 21 } 8 struct hard : sc_module { 9 sc_in<bool> i; 10 sc_out<bool> o; 11 SC_HAS_PROCESS(hard); 12 hard(sc_module_name) {} 22 13 }; 23 14 24 int25 sc_main (int argc, char ** argv)26 {27 sc_signal<bool> s[5];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. This BUG should be detected.33 b.o (s[2]);34 15 35 sc_initialize (); 36 sc_start (1); 16 int sc_main (int argc, char ** argv) { 17 sc_clock signal_clk("my_clock", sc_time(1, sc_core::SC_NS)); 18 sc_signal<bool> s[5]; 19 hard a("a"); 20 hard b("b"); 21 a.i(s[0]); 22 a.o(s[1]); 23 b.i(s[5]); // Wrong array index. This BUG should be detected. 24 b.o(s[2]); 37 25 38 cerr << "Test KO.\n"; 39 return 0; 26 sc_start(sc_time(0, sc_core::SC_NS)); 27 28 sc_start(sc_time(1, sc_core::SC_NS)); 29 30 return 0; 40 31 } 41 32 33 34 /* 35 # Local Variables: 36 # tab-width: 4; 37 # c-basic-offset: 4; 38 # c-file-offsets:((innamespace . 0)(inline-open . 0)); 39 # indent-tabs-mode: nil; 40 # End: 41 # 42 # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 43 */ 44
Note: See TracChangeset
for help on using the changeset viewer.