source: sources/test_regression/15042009/system2.cpp @ 50

Last change on this file since 50 was 21, checked in by buchmann, 16 years ago

Add 2 another testbench to check various operators on sc_uint :

  • system2.cpp works with SystemCASS
  • systemCASS doesn't compile system3.cpp but using SystemC works fine. SystemCASS needs a fix.

Implicit cast is not implicitly called when using SystemCASS. The workaround
is to call read() method.

File size: 551 bytes
Line 
1#include "systemc.h"
2#include <iostream>
3
4using namespace std;
5
6#define ASSERT(x) \
7  { errnum++; \
8    if (!(x)) \
9    { \
10    cerr << "ASSERT : " #x "\n"; \
11    exit (errnum); \
12    } \
13  }
14
15using namespace std;
16
17typedef sc_uint<36> data_type; 
18
19int
20sc_main (int argc, char ** argv)
21{
22  sc_uint<36> a, b, c;
23  const long long int ca = 0xf00000000LLU;
24  const long long int cb = 0x123456789LLU;
25  a = ca;
26  b = cb;
27
28  c = a & b;
29  if (c != (ca & cb))
30    return 1;
31
32  c = a;
33  if (a != c)
34    return 1;
35  if (!(a == c))
36    return 1;
37
38  return 0;
39}
40
Note: See TracBrowser for help on using the repository browser.