Skip to content

Uriel assignment05 - #29

Open
urielguerrero07 wants to merge 17 commits into
RPTU-EIS:mainfrom
Umer1277:uriel-assignment05
Open

Uriel assignment05#29
urielguerrero07 wants to merge 17 commits into
RPTU-EIS:mainfrom
Umer1277:uriel-assignment05

Conversation

@urielguerrero07

Copy link
Copy Markdown

Hey Umer

Quick update on Assignment 05. I already pushed it, made a new branch uriel-assignment05 and opened a pull request so you can review when you have time.

I added support for the branch and jump instructions: BEQ, BNE, BLT, BGE, BLTU, BGEU, JAL and JALR. I followed the static branch prediction approach the professor suggested (assume branches as not taken, flush the pipeline if they turn out taken, jumps always taken).

The main changes were:

  • common.scala → added the new uop codes for branches and jumps
  • IDstage.scala → decoding for B-type and J-type, plus the new immediates (B-type and J-type formats)
  • IDbarrier.scala → carries PC, immediate and flush signal
  • EXstage.scala → branch condition evaluation + branch/jump target calculation
  • IFstage.scala → updated PC logic to handle the branch target
  • IFbarrier.scala → flush logic to clear wrong fetched instructions to NOP
  • core.scala → connected the branch feedback path from EX back to IF

Everything compiles and sbt test passes.

On the testbench side I did some basic test cases for the branches and jumps, but to be honest I'm not super confident with that part since I'm still getting used to the RISC-V encoding side of things. If you could review the test cases and maybe add more coverage I'd really appreciate it, you handle that part better than me.

Please check the PR when you can. I pushed this now to help you out and not put extra load on you so we can present before Friday since I can't make it that day.

Thanks bro

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