source: sources/test_regression/08092005/system.cpp @ 55

Last change on this file since 55 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.3 KB
Line 
1
2// Circular sensitivity dependency
3// Does not compile with systemcass
4
5#include "systemc.h"
6
7
8#include "test.h"
9
10using namespace std;
11
12struct hard : sc_module {
13    sc_in_clk clk;
14    sc_in <int> i1, i2;
15    sc_out<int> o1, o2;
16
17    void f() {
18        o1 = i1;
19        o2 = i2;
20    }
21
22    SC_HAS_PROCESS(hard);
23    hard(sc_module_name) {
24        SC_METHOD(f);
25        sensitive << i1 << i2;
26        dont_initialize();
27
28#ifdef SYSTEMCASS_SPECIFIC
29        o1(i1);
30        o2(i2);
31#endif
32    }
33};
34
35
36int sc_main(int argc, char ** argv) {
37    sc_clock clk("clk");
38    sc_signal<int> s[10];
39    hard a("a");
40    hard b("b");
41    hard c("c");
42
43    a.clk(clk);
44    b.clk(clk);
45
46    a.i1(s[0]);
47
48    a.o1(s[1]);
49    b.i1(s[1]);
50
51    b.o1(s[2]);
52
53    b.i2(s[3]);
54
55    b.o2(s[4]);
56    a.i2(s[4]);
57
58    a.o2(s[5]);
59
60    c.i1(s[6]);
61    c.o1(s[7]);
62    c.i2(s[8]);
63    c.o2(s[9]);
64
65    sc_start(sc_time(0, sc_core::SC_NS));
66
67    s[0] = 1;
68    s[3] = 1;
69
70    sc_start(sc_time(0, sc_core::SC_NS));
71
72    s[0] = 123;
73    s[3] = 321;
74
75    sc_start(sc_time(1, sc_core::SC_NS));
76
77    return 0;
78}
79
80
81/*
82# Local Variables:
83# tab-width: 4;
84# c-basic-offset: 4;
85# c-file-offsets:((innamespace . 0)(inline-open . 0));
86# indent-tabs-mode: nil;
87# End:
88#
89# vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
90*/
91
Note: See TracBrowser for help on using the repository browser.