Ignore:
Timestamp:
Jun 29, 2009, 6:03:59 PM (15 years ago)
Author:
buchmann
Message:

Code cleanup.

Add --dynamiclink option to systemcass executable.

Location:
sources/test_regression/17032005
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sources/test_regression/17032005/Makefile

    r15 r35  
    1414
    1515system-23.vcd : system_systemcass.x
    16         ./system_systemcass.x system 23
     16        ./system_systemcass.x --nodynamiclink system 23
    1717        tail -n +8 system.vcd > system-23.vcd
    1818        rm system.vcd
  • sources/test_regression/17032005/system.cpp

    r18 r35  
    2020  sc_in<bool>     clk;
    2121  sc_in<bool>     resetn;
    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;
     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;
    2626  sc_signal<sc_uint<64>    > ui64;
    2727  sc_signal<sc_int<6>      > i6;
     
    4545      ui31  = 0x100;
    4646      ui32  = 0x211;
    47       ui64  = 0xABCF1234;
     47      ui64  = 0xABCF1234ULL;
    4848      i6    = 0xF;
    4949      i16   = 0x3F;
    5050      i31   = 0x11112222;
    5151      i32   = 0x43214321;
    52       i64   = 0x4444abcd;
     52      i64   = 0x4444abcdULL;
    5353//      bui64 = 0xFFFFFFFF;
    5454//      bui64b= 0xFFFFFFFF;
     
    9191int sc_main (int argc, char *argv[])
    9292{
    93         int errnum = 1;
    94         cout << "Tests ok\n";
     93  int errnum = 1;
     94  cout << "Tests ok\n";
    9595  sc_clock        clk("clk");
    9696  sc_signal<bool> resetn("resetn");
     
    100100  test.resetn (resetn);
    101101 
    102         sc_trace_file *tf;
     102  sc_trace_file *tf;
    103103
    104104  if (argc != 3)
     
    109109
    110110  string trace_filename = argv[1];
    111         tf = sc_create_vcd_trace_file (trace_filename.c_str());
     111  tf = sc_create_vcd_trace_file (trace_filename.c_str());
    112112  sc_trace (tf, test.ui6  , "ui6"  );
    113113  sc_trace (tf, test.ui16 , "ui16" );
     
    139139  sc_start (20);
    140140
    141   sc_close_vcd_trace_file (tf);
    142 
    143141#if 1
    144142  cout << "0x3f"            << " 0x" << hex << (unsigned int) (sc_uint<6> )test.ui6   << endl;
     
    148146#endif
    149147  cerr << test.ui6.read() << endl;
     148
    150149  union t {
    151150    int v1:3;
    152151    int v2;
    153152  };
     153
    154154  t t1,t2;
    155155  t1.v1 = 7;
     
    161161  ASSERT(test.ui31.read() == 0x100fffff);
    162162  ASSERT(test.ui32.read() == 0x211fffff);
    163   long long unsigned int ui64_reference = 0xabcf1234;
     163
     164  long long unsigned int ui64_reference = 0xabcf1234ULL;
    164165  ui64_reference <<= 20;
    165   ui64_reference += 0xfffff;
     166  ui64_reference += 0xfffffULL;
    166167#if 0
    167168  cout << "0xffffffff"      << " 0x" << hex << (int) (sc_int<6>)test.i6    << endl;
     
    170171  cout << "0x4444abcdfffff" << " 0x" << hex << (long long signed int) (sc_int<64>)test.i64   << endl;   
    171172#endif
     173
    172174  ASSERT(test.ui64.read() == ui64_reference);
    173175  ASSERT(test.i6.read() == (sc_int<6>)~0);
    174176  ASSERT(test.i31.read() == 0x222fffff);
    175177  ASSERT(test.i32.read() == 0x321fffff)
    176   long long signed int i64_reference = 0x4444abcd;
     178
     179  long long signed int i64_reference = 0x4444abcdULL;
    177180  i64_reference <<= 20;
    178   i64_reference += 0xfffff;
     181  i64_reference += 0xfffffULL;
    179182  ASSERT(test.i64.read() == i64_reference);
     183
    180184//  cout << "0x4294967315" << " 0x" << hex << test.bui64 << endl;   
    181185  cout << "Test OK.\n";
    182         return EXIT_SUCCESS;
     186
     187  sc_close_vcd_trace_file (tf);
     188
     189  return EXIT_SUCCESS;
    183190}
Note: See TracChangeset for help on using the changeset viewer.