-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmicroprocessor_tb.v
61 lines (52 loc) · 1 KB
/
microprocessor_tb.v
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
`timescale 1ns / 1ps
module microprocessor_tb(
);
reg clk, reset;
reg [3:0] instruction;
reg [1:0]read_sel1, read_sel2, write_sel;
//wire [3:0]register1, register2, register3, register4;
wire [3:0]result;
wire zero_flag, carry_flag;
//wire write_enable;
microprocessor uut (.clk(clk), .reset(reset), .instruction(instruction), .read_sel1(read_sel1), .read_sel2(read_sel2), .write_sel(write_sel), .result(result), .zero_flag(zero_flag), .carry_flag(carry_flag));
//.write_enable(write_enable), .register1(register1), .register2(register2), .register3(register3), .register4(register4));
initial begin
clk=0;
forever #5 clk= ~clk;
end
initial begin
reset=1;
write_sel=0;
read_sel1= 3;
read_sel2= 1;
#10;
reset=0;
#10;
instruction=0;
#10;
instruction=1;
#10;
instruction=2;
#10;
//write_sel=1;
instruction=3;
#10;
instruction=4;
#10;
instruction=5;
#10;
//write_sel=2;
instruction=6;
#10;
//read_sel2=2;
instruction=7;
#10;
instruction=8;
#10;
instruction=9;
#10;
instruction=10;
#10;
instruction=11;
end
endmodule