Skip to content

Commit

Permalink
state machine cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jwd83 committed Jan 4, 2025
1 parent e0e0a1b commit 1823680
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions peach/peach.sv
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ module peach32 (
end else begin
// rv32i multi-cycle state machine
case (state)
0: begin
STATE_FETCH: begin
// load the instruction from memory into instruction register
ir <= memory_out;
// calculate the program counter +4 with the alu
next_pc <= pc + 4;
// advance to state 1
state <= 1;
state <= STATE_DECODE;
end
1: begin
STATE_DECODE: begin
// decode ir and determine op type
opcode <= ir[6:0];
funct3 <= ir[14:12];
Expand Down

0 comments on commit 1823680

Please sign in to comment.