Skip to content

add sw_testbench - #50

Merged
TheDeepestSpace merged 12 commits into
mainfrom
daniel
Aug 10, 2025
Merged

add sw_testbench#50
TheDeepestSpace merged 12 commits into
mainfrom
daniel

Conversation

@DanielTaoHuang123

Copy link
Copy Markdown
Contributor

add sw testbench; add FF between RF and ALU

Comment thread src/Instruction_Decode/RegisterFile.v
Comment thread src/top.v
Comment on lines +157 to +161

always @(posedge clk) begin
dataA <= rd1;
dataB <= rd2;
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So i think figured out what was the issue with the sw -- it was not really related to the PC using the single clock cycle stuff; the real problem was that the dataA and dataB registers here, because they technically already existed in the RF implementation (i.e. the reads were "clocked"); so this was adding another clock cycle basically.

Both approaches are correct, but i think your implementation is probably more inline with how the diagram is layed out -- the sync register is outside of RF and the reads are combinational ; i pushed the update to your PR along with the test bench fixes and it should be good to go now

@TheDeepestSpace
TheDeepestSpace merged commit aaddb17 into main Aug 10, 2025
2 checks passed
@TheDeepestSpace TheDeepestSpace linked an issue Aug 10, 2025 that may be closed by this pull request
@TheDeepestSpace TheDeepestSpace linked an issue Sep 6, 2025 that may be closed by this pull request
6 tasks
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.

Implement starter-pack instructions for RISCOF framework Implement sw instruction

2 participants