Last change
on this file since 41 was
1,
checked in by buchmann, 17 years ago
|
Initial import from CVS repository
|
File size:
691 bytes
|
Line | |
---|
1 | #include <systemc.h> |
---|
2 | #include <signal.h> |
---|
3 | #include <iostream> |
---|
4 | #include <fstream> |
---|
5 | |
---|
6 | #include "test.h" |
---|
7 | |
---|
8 | #define ASSERT(x) \ |
---|
9 | { \ |
---|
10 | if (!(x)) \ |
---|
11 | { \ |
---|
12 | cerr << "ASSERT : '" #x "' at cycle number " << sc_simulation_time () << "\n"; \ |
---|
13 | exit (1); \ |
---|
14 | } \ |
---|
15 | } |
---|
16 | |
---|
17 | using namespace std; |
---|
18 | |
---|
19 | |
---|
20 | int sc_main (int argc, char *argv[]) |
---|
21 | { |
---|
22 | sc_clock clk("clk"); |
---|
23 | sc_signal<bool> resetn("resetn"); |
---|
24 | sc_signal<int> in ("in"); |
---|
25 | sc_signal<int> out("out"); |
---|
26 | |
---|
27 | test test("test"); |
---|
28 | test.clk (clk); |
---|
29 | test.resetn (resetn); |
---|
30 | |
---|
31 | test.i (in); |
---|
32 | test.o (out); |
---|
33 | |
---|
34 | sc_initialize (); |
---|
35 | |
---|
36 | resetn = false; |
---|
37 | sc_start (3); |
---|
38 | resetn = true; |
---|
39 | sc_start (20); |
---|
40 | |
---|
41 | cout << "Test OK.\n"; |
---|
42 | return EXIT_SUCCESS; |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.