source: sources/test_regression/15042009/system3.cpp @ 46

Last change on this file since 46 was 43, checked in by buchmann, 15 years ago

Changes:

  • disable some checkins in '19042005' testbench

Fix:

  • Add a missing return
File size: 1.1 KB
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
19class param_t
20{
21public:
22  static const unsigned int B = 36;
23  typedef sc_dt::sc_uint<B> be_t;
24};
25
26template <typename param_t>
27class test_t 
28{
29public:
30  typedef typename param_t::be_t test_be_t;
31 
32  test_be_t test_be;
33};
34
35int
36sc_main (int argc, char ** argv)
37{
38  sc_uint<36> a;
39  const long long int ca = 0xf00000000LLU;
40  a = ca;
41
42  test_t<param_t> test1, test2;
43  test1.test_be = a;
44  test2.test_be = ca;
45
46  if (test1.test_be != test2.test_be)
47    return 1;
48
49  bool ret = (test1.test_be == a);
50  if (!ret)
51    return 1;
52
53  return 0;
54
55  /* the following should be compiled and not executed */
56  sc_signal<test_t<param_t>::test_be_t > sig_test;
57  sig_test = test1.test_be;
58
59  ret = (sig_test.read() == test2.test_be); /* OK */
60  //ret = (sig_test == test2.test_be); /* should be OK but it is not */
61  if (!ret)
62    return 1;
63
64  return 0;
65}
66
Note: See TracBrowser for help on using the repository browser.