-
Notifications
You must be signed in to change notification settings - Fork 2
/
control_jbr.h
47 lines (38 loc) · 1.11 KB
/
control_jbr.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
#ifndef CONTROLJBR_H
#define CONTROLJBR_H
/**
*
* Control module interface.
*/
#include <systemc.h>
/**
* Control module.
* Control module models the control unit of MIPS.
* - input ports
* - \c sc_uint<6> \c opcode - instruction opcode field
* - \c sc_uint<6> \c funct - instruction funct field
* - output ports
* - \c bool \c RegDst - selects if rd or rt is written
* - \c bool \c RegWrite - enables writing in Register file
* - \c bool \c MemRead - enables reading from Memory
* - \c bool \c MemWrite - enables writing to Memory
* - \c bool \c MemtoReg - Value to write in register comes from memory
* - \c sc_uint<6> \c ALUOp - selects ALU operation
* - \c bool \c ALUSrc - selects ALU second operand
* - \c bool \c Branch - active if instruction is beq
*/
SC_MODULE(control_jbr) {
sc_in< bool > le;
sc_in< bool > gr;
sc_in< bool > eq;
sc_in< sc_uint<3> > jbr;
sc_out< sc_uint<2> > select;
sc_out< bool > btaken;
SC_CTOR(control_jbr)
{
SC_METHOD(entry);
sensitive << le << gr << eq << jbr;
}
void entry();
};
#endif