Fix regfile hazard from storing when inputs change

This commit is contained in:
Aadi Desai 2020-12-02 19:13:41 +00:00
parent f2f8e05010
commit 847bf92add

View file

@ -27,7 +27,7 @@ always_comb begin
readdata2 = memory[readreg2]; //combinatorially output register value based on read port 2 selector
end
always_ff @(posedge clk) begin
always_ff @(negedge clk) begin
if (regwrite) begin
case (opcode)
6'b100000: begin //lb, load byte