Last change
on this file since 57 was
55,
checked in by meunier, 11 years ago
|
Tried to clean the test_regression directory:
- Code formatting
- Supressed warnings
- Made comprehensible outputs
- Factorized Makefiles
There's still a lot to do (many tests don't pass for either good or bad reasons)
|
File size:
1.2 KB
|
Rev | Line | |
---|
[55] | 1 | |
---|
[1] | 2 | #include <iostream> |
---|
| 3 | #include <string> |
---|
| 4 | |
---|
[55] | 5 | #include "systemc.h" |
---|
| 6 | #include "test.h" |
---|
[1] | 7 | |
---|
[55] | 8 | |
---|
[1] | 9 | using namespace std; |
---|
| 10 | |
---|
| 11 | |
---|
[55] | 12 | struct internal_model : sc_module { |
---|
| 13 | sc_in<int> i; |
---|
| 14 | sc_out<int> o; |
---|
| 15 | internal_model (sc_module_name n) : sc_module (n), i("i"), o("o") {} |
---|
[1] | 16 | }; |
---|
| 17 | |
---|
[35] | 18 | |
---|
[55] | 19 | struct model : sc_module { |
---|
| 20 | sc_in<int> i1, i2, i3; |
---|
| 21 | sc_out<int> o1, o2, o3; |
---|
| 22 | sc_signal<int> r1, r2; |
---|
| 23 | internal_model internal; |
---|
| 24 | model(sc_module_name n) : sc_module (n), |
---|
[1] | 25 | i1("i1"), i2("i2"), i3("i3"), |
---|
[35] | 26 | o1("o1"), o2("o2"), o3("o3"), |
---|
| 27 | r1("r1"), r2("r2"), |
---|
[55] | 28 | internal("internal") { |
---|
| 29 | internal.o (o3); |
---|
| 30 | internal.i (i3); |
---|
| 31 | } |
---|
[1] | 32 | }; |
---|
| 33 | |
---|
| 34 | |
---|
[55] | 35 | int sc_main (int argc, char ** argv) { |
---|
| 36 | model m("m"); |
---|
| 37 | sc_clock clk("clock"); |
---|
| 38 | sc_signal<int> s1("s1"), s2("s2"), s3("s3"), s4("s4"); |
---|
[1] | 39 | |
---|
[55] | 40 | m.i1(s1); |
---|
| 41 | m.i3(s1); |
---|
| 42 | m.o1(s4); |
---|
| 43 | m.o2(s2); |
---|
| 44 | m.o3(s3); |
---|
[1] | 45 | |
---|
[55] | 46 | sc_start(sc_time(0, sc_core::SC_NS)); |
---|
[1] | 47 | |
---|
[55] | 48 | sc_start(sc_time(1, sc_core::SC_NS)); |
---|
| 49 | sc_start(sc_time(10, sc_core::SC_NS)); |
---|
| 50 | |
---|
| 51 | return 0; |
---|
[1] | 52 | } |
---|
| 53 | |
---|
[55] | 54 | |
---|
| 55 | /* |
---|
| 56 | # Local Variables: |
---|
| 57 | # tab-width: 4; |
---|
| 58 | # c-basic-offset: 4; |
---|
| 59 | # c-file-offsets:((innamespace . 0)(inline-open . 0)); |
---|
| 60 | # indent-tabs-mode: nil; |
---|
| 61 | # End: |
---|
| 62 | # |
---|
| 63 | # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 64 | */ |
---|
| 65 | |
---|
Note: See
TracBrowser
for help on using the repository browser.