Skip to content

Conversation

@TheDeepestSpace
Copy link
Member

@TheDeepestSpace TheDeepestSpace commented Apr 5, 2025

This PR contains the implementation of beq instruction. It is built off of the unconditional branching setup in #20 .

This is a significant PR since it starts to integrate together our main modules: InstructionDecode, ControlFSM, fetch, and ALU.

This is the first attempt at integration and only wires up the signals necessary for beq.

This is a pretty large PR, so I would not be opposed to breaking it up into smaller chunks, especially since there have been quite a bit of peripheral changes.

Notable changes aside from the integration in top.v:

  • wired up ALUOp signal as per the book
  • since we have not yet switched to pipelining, PCUpdate is set to TRUE unconditionally
  • wired up zero flag from the ALU to Control FSM, which basically just feeds back into PCSrc signal to pick the next PC value
  • exposed ImmExt from Instruction Decode for consumption by the Fetch module
  • made register file read fully combinational to ensure beq can be performed in one cycle

@TheDeepestSpace TheDeepestSpace marked this pull request as ready for review April 6, 2025 19:26
@TheDeepestSpace TheDeepestSpace self-assigned this May 28, 2025
src/fetch.sv Outdated
IDLE: pc_cur = pc_cur;
INCREMENT_PC: pc_cur = pc_cur + 32'h4;
JUMP_PC: pc_cur = pc_cur + saved_imm_reg;
default: pc_cur = 32'hxxxxxxxx;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note sure what our protocol is on handing there

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should look into adding SVLint to our pipeline here -- https://github.com/dalance/svlint. I think it also has direct test editor support. I would really like us to have checks for exhaustive case statements especially as the codebase grows.

Copy link
Member Author

@TheDeepestSpace TheDeepestSpace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've rewritten fetch module into an FSM since i think it better fits into the pipelined system as opposed to the initial implementation that was tageting single-cycle processor.

@joon2022park joon2022park merged commit 8c7b56e into UTOSS:main Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants