Changeset 35 for sources/test_regression/17032005
- Timestamp:
- Jun 29, 2009, 6:03:59 PM (15 years ago)
- Location:
- sources/test_regression/17032005
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/test_regression/17032005/Makefile
r15 r35 14 14 15 15 system-23.vcd : system_systemcass.x 16 ./system_systemcass.x system 2316 ./system_systemcass.x --nodynamiclink system 23 17 17 tail -n +8 system.vcd > system-23.vcd 18 18 rm system.vcd -
sources/test_regression/17032005/system.cpp
r18 r35 20 20 sc_in<bool> clk; 21 21 sc_in<bool> resetn; 22 23 24 25 22 sc_signal<sc_uint<6> > ui6; 23 sc_signal<sc_uint<16> > ui16; 24 sc_signal<sc_uint<31> > ui31; 25 sc_signal<sc_uint<32> > ui32; 26 26 sc_signal<sc_uint<64> > ui64; 27 27 sc_signal<sc_int<6> > i6; … … 45 45 ui31 = 0x100; 46 46 ui32 = 0x211; 47 ui64 = 0xABCF1234 ;47 ui64 = 0xABCF1234ULL; 48 48 i6 = 0xF; 49 49 i16 = 0x3F; 50 50 i31 = 0x11112222; 51 51 i32 = 0x43214321; 52 i64 = 0x4444abcd ;52 i64 = 0x4444abcdULL; 53 53 // bui64 = 0xFFFFFFFF; 54 54 // bui64b= 0xFFFFFFFF; … … 91 91 int sc_main (int argc, char *argv[]) 92 92 { 93 94 93 int errnum = 1; 94 cout << "Tests ok\n"; 95 95 sc_clock clk("clk"); 96 96 sc_signal<bool> resetn("resetn"); … … 100 100 test.resetn (resetn); 101 101 102 102 sc_trace_file *tf; 103 103 104 104 if (argc != 3) … … 109 109 110 110 string trace_filename = argv[1]; 111 111 tf = sc_create_vcd_trace_file (trace_filename.c_str()); 112 112 sc_trace (tf, test.ui6 , "ui6" ); 113 113 sc_trace (tf, test.ui16 , "ui16" ); … … 139 139 sc_start (20); 140 140 141 sc_close_vcd_trace_file (tf);142 143 141 #if 1 144 142 cout << "0x3f" << " 0x" << hex << (unsigned int) (sc_uint<6> )test.ui6 << endl; … … 148 146 #endif 149 147 cerr << test.ui6.read() << endl; 148 150 149 union t { 151 150 int v1:3; 152 151 int v2; 153 152 }; 153 154 154 t t1,t2; 155 155 t1.v1 = 7; … … 161 161 ASSERT(test.ui31.read() == 0x100fffff); 162 162 ASSERT(test.ui32.read() == 0x211fffff); 163 long long unsigned int ui64_reference = 0xabcf1234; 163 164 long long unsigned int ui64_reference = 0xabcf1234ULL; 164 165 ui64_reference <<= 20; 165 ui64_reference += 0xfffff ;166 ui64_reference += 0xfffffULL; 166 167 #if 0 167 168 cout << "0xffffffff" << " 0x" << hex << (int) (sc_int<6>)test.i6 << endl; … … 170 171 cout << "0x4444abcdfffff" << " 0x" << hex << (long long signed int) (sc_int<64>)test.i64 << endl; 171 172 #endif 173 172 174 ASSERT(test.ui64.read() == ui64_reference); 173 175 ASSERT(test.i6.read() == (sc_int<6>)~0); 174 176 ASSERT(test.i31.read() == 0x222fffff); 175 177 ASSERT(test.i32.read() == 0x321fffff) 176 long long signed int i64_reference = 0x4444abcd; 178 179 long long signed int i64_reference = 0x4444abcdULL; 177 180 i64_reference <<= 20; 178 i64_reference += 0xfffff ;181 i64_reference += 0xfffffULL; 179 182 ASSERT(test.i64.read() == i64_reference); 183 180 184 // cout << "0x4294967315" << " 0x" << hex << test.bui64 << endl; 181 185 cout << "Test OK.\n"; 182 return EXIT_SUCCESS; 186 187 sc_close_vcd_trace_file (tf); 188 189 return EXIT_SUCCESS; 183 190 }
Note: See TracChangeset
for help on using the changeset viewer.