From 2cbdc8a905d6b4fac757ae6a33f75548b16f10e7 Mon Sep 17 00:00:00 2001 From: dianshi Date: Tue, 25 Jan 2022 21:37:30 +0000 Subject: Add alu_control version v0.1 --- alu_control/v0.1/test_alu_control.v | 74 +++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 alu_control/v0.1/test_alu_control.v (limited to 'alu_control/v0.1/test_alu_control.v') diff --git a/alu_control/v0.1/test_alu_control.v b/alu_control/v0.1/test_alu_control.v new file mode 100644 index 0000000..878744a --- /dev/null +++ b/alu_control/v0.1/test_alu_control.v @@ -0,0 +1,74 @@ +`timescale 1ns/1ps + +module test_alu_control; + +reg [1:0]alu_op; +reg [3:0]opcode; +reg [2:0]alu_cnt; + +alu_control uut( + .alu_op(alu_op), + .opcode(opcode), + .alu_cnt(alu_cnt) +); + +initial begin + $display("test alu control"); + $dumpfile("test_alu_control.vcd"); + $dumpvars(0,test_alu_control); + + #1 + alu_op = 0; + opcode = 0; + + #10 + + opcode = 1; + + #10 + + opcode = 2; + + #10 + + opcode = 3; + + #10 + + opcode = 4; + + #10 + + opcode = 5; + + #10 + + opcode = 6; + + #10 + + opcode = 7; + + #10 + alu_op = 1; + opcode = 0; + + #10 + alu_op = 2; + opcode = 1; + + #10 + alu_op = 3; + + #10 + alu_op = 3; + + +end + + +initial begin + $monitor("At time %t",$time); +end + +endmodule \ No newline at end of file -- cgit v1.2.3