-
Notifications
You must be signed in to change notification settings - Fork 2
/
gates.h
60 lines (47 loc) · 991 Bytes
/
gates.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef GATESMOD_H
#define GATESMOD_H
/**
* \c several gates module interface
*/
#include <systemc.h>
/**
* \c andgate module.
* \c andgate module models a two input and gate
* - input ports
* - \c bool \c din1 - first input
* - \c bool \c din2 - second input
* - output ports
* - \c bool \c dout - result
*/
SC_MODULE(andgate) {
sc_in< bool > din1;
sc_in< bool > din2;
sc_out< bool > dout;
SC_CTOR(andgate)
{
SC_METHOD(entry);
sensitive << din1 << din2;
}
void entry();
};
/**
* \c orgate module.
* \c orgate module models a two input or gate
* - input ports
* - \c bool \c din1 - first input
* - \c bool \c din2 - second input
* - output ports
* - \c bool \c dout - result
*/
SC_MODULE(orgate) {
sc_in< bool > din1;
sc_in< bool > din2;
sc_out< bool > dout;
SC_CTOR(orgate)
{
SC_METHOD(entry);
sensitive << din1 << din2;
}
void entry();
};
#endif