Changeset 23 for sources/test_regression/02052006
- Timestamp:
- Apr 16, 2009, 2:47:08 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/test_regression/02052006/system.cpp
r1 r23 13 13 14 14 struct test : sc_module { 15 int 15 int32_t reg; 16 16 sc_signal<bool> reg_bool; 17 17 sc_signal<int> reg_int; … … 38 38 ASSERT(((unsigned int)reg) == reg_unsigned_int .read()); 39 39 ASSERT(((char) reg) == reg_char .read()); 40 #if 0 41 cout << (double)reg << " " << reg_double.read() << endl; 42 cout << sizeof (double) << " " << sizeof (reg_double.read()) << endl; 43 #endif 40 44 ASSERT(((double)reg) == reg_double.read()); 41 45 ASSERT(((long) reg) == reg_long .read()); … … 48 52 ASSERT(((signed int) reg & 0xFFFFFFFF) == (signed int) (reg_i32 .read())); 49 53 ASSERT(((signed int) reg & 0x0000FFFF) == (signed int) (reg_i16 .read())); 50 ASSERT(((signed int) reg & 0x0000003F) 54 ASSERT(((signed int) reg & 0x0000003F) == (signed int) (reg_i6 .read())); 51 55 reg = reg + 1; 52 56 reg_bool = reg & 1; … … 54 58 reg_unsigned_int = reg; 55 59 reg_char = reg; 56 reg_double = reg;60 reg_double .write(reg); 57 61 reg_long = reg; 58 62 reg_ui32 = reg; … … 80 84 81 85 SC_HAS_PROCESS(test); 82 86 test (sc_module_name n) : sc_module (n), 83 87 clk("clk") 84 88 { 85 86 89 SC_METHOD(trans); 90 sensitive << clk.pos(); 87 91 dont_initialize(); 88 92 }; 89 93 }; 90 94 91 95 int sc_main (int argc, char *argv[]) 92 96 { 93 97 sc_clock signal_clk("my_clock",1, 0.5); 94 98 sc_signal<bool> resetn("resetn"); 95 99 … … 98 102 test1.resetn (resetn); 99 103 100 101 104 // Init & run 105 sc_start (0); 102 106 103 107 resetn = false; 104 108 sc_start (4); 105 109 resetn = true; 106 110 sc_start (100); 107 111 108 112 return EXIT_SUCCESS; 109 113 } 110 114
Note: See TracChangeset
for help on using the changeset viewer.