Many Changes
I added a comparator, I updated the control unit so that it now uses the 4 bit ALU opcode instead of the 3 bit from before. I added testbenches to the control unit and the slt and comparator modules. However, like before I unable to run the simulation on my desktop. Finally, i added the program code for the equation solver as a test bench in the CPU9bit module
This commit is contained in:
@@ -88,4 +88,44 @@ module CPU9bits(input wire [8:0] instr,
|
||||
.switch(loadS));
|
||||
|
||||
|
||||
endmodule
|
||||
|
||||
module CPU9bits_tb();
|
||||
reg [8:0] instruction;
|
||||
reg clk, reset;
|
||||
wire done;
|
||||
|
||||
initial begin
|
||||
clk = 1'b0;
|
||||
end
|
||||
always begin
|
||||
#5 clk = ~clk; // Period to be determined
|
||||
end
|
||||
|
||||
CPU9bits CPU9bits0(
|
||||
.instr(instruction),
|
||||
.reset(reset),
|
||||
.clk(clk),
|
||||
.done(done));
|
||||
|
||||
initial begin
|
||||
reset = 0;
|
||||
#10
|
||||
reset = 1;
|
||||
#10
|
||||
instruction = 000100000;
|
||||
#10
|
||||
instruction = 000101001;
|
||||
#10
|
||||
instruction = 010100010;
|
||||
#10
|
||||
instruction = 111100000;
|
||||
#10
|
||||
instruction = 111100000;
|
||||
#10
|
||||
instruction = 000000000;
|
||||
#10
|
||||
$finish;
|
||||
|
||||
end
|
||||
endmodule
|
||||
Reference in New Issue
Block a user