-
Notifications
You must be signed in to change notification settings - Fork 0
/
Execute_tb.sv
39 lines (37 loc) · 984 Bytes
/
Execute_tb.sv
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
module Execute_tb();
logic MemPWrite, RegWrite, MemWrite, BranchInst, ALUSrc, FlagWrite, PAUOp, IOFlag, ResultSrc, clk, PCSrc,
RegWriteOut, MemWriteOut, MemPWriteOut, IOFlagOut;
logic [1:0] MemToReg, MemToRegOut;
logic [2:0] CondFlag;
logic [3:0] ALUControl;
logic [31:0] Ra, Rb, ExtIm, ALUResult, WriteData;
logic [3:0] Rd, RdOut;
Execute #(32) DUT (MemPWrite, RegWrite, MemWrite, BranchInst, ALUSrc, FlagWrite, PAUOp, IOFlag, ResultSrc, clk,
MemToReg, ALUControl, CondFlag, Ra, Rb, Rd, ExtIm, PCSrc, RegWriteOut, MemWriteOut, MemPWriteOut,
IOFlagOut, MemToRegOut, ALUResult, WriteData, RdOut);
initial begin
clk=1'b0;
// ADD
MemPWrite=1'b0;
RegWrite=1'b0;
MemWrite=1'b0;
BranchInst=1'b0;
ALUSrc=1'b0;
FlagWrite=1'b0;
ALUControl=4'b1;
PAUOp=1'b0;
IOFlag=1'b0;
ResultSrc=1'b0;
MemToReg=2'b01;
CondFlag=3'b0;
Ra=32'b1010;
Rb=32'b1011;
Rd=4'b1010;
ExtIm=32'b1010101;
#2;
end
always begin
#1
clk=~clk;
end
endmodule