Changeset 35 for sources/test_regression/05042006/system.cpp
- Timestamp:
- Jun 29, 2009, 6:03:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/test_regression/05042006/system.cpp
r1 r35 1 1 #include <systemc.h> 2 3 #define ASSERT(x) \4 { errnum++; \5 if (!(x)) \6 { \7 cerr << "ASSERT : " #x "\n"; \8 exit (errnum); \9 } \10 }11 2 12 3 using namespace std; 13 4 14 5 struct test : sc_module { 15 6 sc_in_clk clk; 16 7 sc_in<int> i1; 17 8 sc_out<int> o1; … … 36 27 37 28 SC_HAS_PROCESS(test); 38 29 test (sc_module_name n) : sc_module (n), 39 30 clk("clk"), 40 31 i1("i1"), … … 44 35 reg2("reg2") 45 36 { 46 47 37 SC_METHOD(trans); 38 sensitive << clk.pos(); 48 39 dont_initialize(); 49 50 40 SC_METHOD(gen); 41 sensitive << clk.neg(); 51 42 dont_initialize(); 52 43 }; 53 44 }; 54 45 55 46 int sc_main (int argc, char *argv[]) 56 47 { 57 int errnum = 0; 58 sc_clock signal_clk("my_clock",1, 0.5); 48 sc_clock signal_clk("my_clock",1, 0.5); 59 49 sc_signal<int> s01("s01"); 60 50 sc_signal<int> s02("s02"); … … 67 57 test1.o2 (s03); 68 58 69 70 59 // Init & run 60 sc_start (0); 71 61 72 62 sc_start (10); 73 63 74 64 return EXIT_SUCCESS; 75 65 } 76 66
Note: See TracChangeset
for help on using the changeset viewer.