Skip to content

add sw_testbench #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 10, 2025
Merged

add sw_testbench #50

merged 12 commits into from
Aug 10, 2025

Conversation

DanielTaoHuang123
Copy link
Contributor

add sw testbench; add FF between RF and ALU

Comment on lines +157 to +161

always @(posedge clk) begin
dataA <= rd1;
dataB <= rd2;
end
Copy link
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
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 sw instruction
2 participants