t000-basic-module.cpp 580 Bytes
Newer Older
rmrf's avatar
rmrf committed
1
2
#include "systemc.h"
SC_MODULE( test ){
rmrf's avatar
rmrf committed
3
4
    sc_in<int> in;
    sc_out<int> out;
5
    sc_signal<int> test_signal;
rmrf's avatar
rmrf committed
6
7
8
9
10
    void entry_function_1() {
        while(true) {
            // do nothing
        }
    }
rmrf's avatar
rmrf committed
11

rmrf's avatar
rmrf committed
12
13
14
15
16
    void entry_function_2() {
        while(true) {
            // do nothing
        }
    }
rmrf's avatar
rmrf committed
17

rmrf's avatar
rmrf committed
18
19
20
21
    SC_CTOR( test ) {
        SC_THREAD(entry_function_1);
        SC_THREAD(entry_function_2);
    }
rmrf's avatar
rmrf committed
22
23
24
};

int sc_main(int argc, char *argv[]) {
rmrf's avatar
rmrf committed
25
    sc_signal<int> sig1;
rmrf's avatar
rmrf committed
26
27
28
29
    test test_instance("testing");
    test_instance.in(sig1);
    test_instance.out(sig1);

rmrf's avatar
rmrf committed
30
    return 0;
rmrf's avatar
rmrf committed
31
}