Skip to content

Commit

Permalink
update tb
Browse files Browse the repository at this point in the history
  • Loading branch information
kentaroy47 committed Nov 26, 2021
1 parent c15d3c9 commit 796287b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 06_cpu_register/cpu_register.sv
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module cpu_register(
);
logic [31:0] DATA [31:0];
// 初期値
always @(*) begin
always @(posedge clk) begin
DATA[0] = 49;
DATA[1] = 7;
DATA[2] = 3;
Expand Down
3 changes: 1 addition & 2 deletions 08_mycpu/cpu.sv
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// reg+ALUのみCPU

module cpuv1(
input logic clk,
input logic [31:0] inst
Expand All @@ -15,7 +14,7 @@ module cpuv1(
cpu_register r1(
.addr1(addr1),
.addr2(addr2),
.addrw(addr2),
.addrw(addrw),
.writeen(writeen),
.writeint(out),
.RD1(a),
Expand Down
15 changes: 15 additions & 0 deletions 08_mycpu/cpu_tb.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module cpu_tb;
reg [31:0] inst;
reg clk;

// 加算命令
initial begin
inst = 32'b00000000000010000010000000000000;
clk = 0;
end
// CPU
cpuv1 c1(.*);

always #2
clk = clk + 1;
endmodule

0 comments on commit 796287b

Please sign in to comment.