source: sources/test_regression/16112005a/system.cpp @ 60

Last change on this file since 60 was 60, checked in by meunier, 7 years ago
  • Intégration des modifications de Clément, qui a intégré la version parallélisée de systemcass faite par Manuel.
File size: 1.3 KB
Line 
1
2#include <iostream>
3#include <string>
4
5#include "systemc.h"
6#include "test.h"
7
8
9using namespace std;
10
11
12struct 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") {}
16};
17
18
19struct 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
25    model(sc_module_name n) : sc_module(n),
26    i1("i1"), i2("i2"), i3("i3"),
27    o1("o1"), o2("o2"), o3("o3"),
28    r1("r1"), r2("r2"),
29    internal ("internal")
30    {
31        internal.o(o3);
32        internal.i(i3);
33    }
34};
35
36
37int sc_main (int argc, char ** argv) {
38    model m("m");
39    sc_clock clk("clock");
40    sc_signal<int> s1("s1"), s2("s2"), s3("s3"), s4("s4");
41
42    // Setup number of threads open-mp to 1 with the macro threads_omp()
43    threads_omp();
44
45    m.i1 (s1);
46    m.i2 (s1);
47    m.i3 (s1);
48    m.o1 (s4);
49    m.o2 (s2);
50    m.o3 (s3);
51
52    sc_start(sc_time(0, sc_core::SC_NS));
53
54    sc_start(sc_time(1, sc_core::SC_NS));
55    sc_start(sc_time(10, sc_core::SC_NS));
56
57    cout << "OK" << endl;
58
59    return 0;
60}
61
62
63/*
64# Local Variables:
65# tab-width: 4;
66# c-basic-offset: 4;
67# c-file-offsets:((innamespace . 0)(inline-open . 0));
68# indent-tabs-mode: nil;
69# End:
70#
71# vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
72*/
73
Note: See TracBrowser for help on using the repository browser.