source: sources/test_regression/05092005/system.cpp @ 6

Last change on this file since 6 was 1, checked in by buchmann, 17 years ago

Initial import from CVS repository

File size: 571 bytes
Line 
1#include "systemc.h"
2
3#define ASSERT(x) \
4  { errnum++; \
5    if (!(x)) \
6    { \
7    cerr << "ASSERT : " #x "\n"; \
8    exit (errnum); \
9    } \
10  }
11
12using namespace std;
13
14struct hard : sc_module
15{
16  sc_in <bool> i;
17  sc_out<bool> o;
18  SC_HAS_PROCESS(hard);
19  hard(sc_module_name)
20  {
21  }
22};
23
24int
25sc_main (int argc, char ** argv)
26{
27  sc_signal<bool> s[5];
28  hard a("a");
29  hard b("b");
30  a.i (s[0]);
31  a.o (s[1]);
32  b.i (s[5]); // Wrong array index. This BUG should be detected.
33  b.o (s[2]);
34
35  sc_initialize ();
36  sc_start (1);
37
38  cerr << "Test KO.\n";
39  return 0;
40}
41
Note: See TracBrowser for help on using the repository browser.