Changeset 55 for sources/test_regression/08092005/system.cpp
- Timestamp:
- May 28, 2013, 11:17:14 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/test_regression/08092005/system.cpp
r1 r55 1 2 // Circular sensitivity dependency 3 // Does not compile with systemcass 4 1 5 #include "systemc.h" 2 6 3 #define ASSERT(x) \ 4 { errnum++; \ 5 if (!(x)) \ 6 { \ 7 cerr << "ASSERT : " #x "\n"; \ 8 exit (errnum); \ 9 } \ 10 } 7 8 #include "test.h" 11 9 12 10 using namespace std; 13 11 14 struct hard : sc_module 15 { 16 sc_in_clk clk; 17 sc_in <int> i1, i2; 18 sc_out<int> o1, o2; 12 struct hard : sc_module { 13 sc_in_clk clk; 14 sc_in <int> i1, i2; 15 sc_out<int> o1, o2; 19 16 20 void f () 21 { 22 o1 = i1; 23 o2 = i2; 24 } 17 void f() { 18 o1 = i1; 19 o2 = i2; 20 } 25 21 26 SC_HAS_PROCESS(hard); 27 hard(sc_module_name) /*: 28 clk("clk"), 29 i1 ("i1"), 30 i2 ("i2"), 31 o1 ("o1"), 32 o2 ("o2")*/ 33 { 34 SC_METHOD(f); 35 dont_initialize(); 36 sensitive << i1 << i2; 22 SC_HAS_PROCESS(hard); 23 hard(sc_module_name) { 24 SC_METHOD(f); 25 sensitive << i1 << i2; 26 dont_initialize(); 27 37 28 #ifdef SYSTEMCASS_SPECIFIC 38 o1(i1);39 o2(i2);29 o1(i1); 30 o2(i2); 40 31 #endif 41 }32 } 42 33 }; 43 34 44 int45 sc_main (int argc, char ** argv)46 {47 sc_clock clk("clk");48 sc_signal<int> s[10];49 hard a("a");50 hard b("b");51 hard c("c");52 35 53 a.clk (clk); 54 b.clk (clk); 36 int sc_main(int argc, char ** argv) { 37 sc_clock clk("clk"); 38 sc_signal<int> s[10]; 39 hard a("a"); 40 hard b("b"); 41 hard c("c"); 55 42 56 a.i1 (s[0]); 43 a.clk(clk); 44 b.clk(clk); 57 45 58 a.o1 (s[1]); 59 b.i1 (s[1]); 46 a.i1(s[0]); 60 47 61 b.o1 (s[2]); 48 a.o1(s[1]); 49 b.i1(s[1]); 62 50 63 b.i2 (s[3]);51 b.o1(s[2]); 64 52 65 b.o2 (s[4]); 66 a.i2 (s[4]); 53 b.i2(s[3]); 67 54 68 a.o2 (s[5]); 55 b.o2(s[4]); 56 a.i2(s[4]); 69 57 70 c.i1 (s[6]); 71 c.o1 (s[7]); 72 c.i2 (s[8]); 73 c.o2 (s[9]); 58 a.o2(s[5]); 74 59 75 sc_initialize ();76 77 s[0] = 1;78 s[3] = 1;60 c.i1(s[6]); 61 c.o1(s[7]); 62 c.i2(s[8]); 63 c.o2(s[9]); 79 64 80 sc_start (1);65 sc_start(sc_time(0, sc_core::SC_NS)); 81 66 82 s[0] = 123;83 s[3] = 321;67 s[0] = 1; 68 s[3] = 1; 84 69 85 sc_start (1);70 sc_start(sc_time(0, sc_core::SC_NS)); 86 71 87 return 0; 72 s[0] = 123; 73 s[3] = 321; 74 75 sc_start(sc_time(1, sc_core::SC_NS)); 76 77 return 0; 88 78 } 89 79 80 81 /* 82 # Local Variables: 83 # tab-width: 4; 84 # c-basic-offset: 4; 85 # c-file-offsets:((innamespace . 0)(inline-open . 0)); 86 # indent-tabs-mode: nil; 87 # End: 88 # 89 # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 90 */ 91
Note: See TracChangeset
for help on using the changeset viewer.