-
Notifications
You must be signed in to change notification settings - Fork 38
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
Make sure debug printing is consistent #59
Comments
@DanG100, this might be a good thing to look at since you're working on testing infrastructure. |
The output is quite different on the CPU in this repo (with the different chisel snapshot). It looks like the print statement are evaluated before the registers are set in that cycle. It look consistent though, in cycle 3, the wires and the regs have the same value.
|
Based on what I've done in verilator, I've noticed everything is evaluated in this order as follows:
Below is how debug is evaluated. Hopefully this provides a hint to what's going on. Idk if verilator changes things up from firrtil, but based on my testing the verilator output is identical to non verilator output //----------------FIRST PRINTING HAPPENS USING WIRES-------------------- VL_FWRITEF(0x80000002U,"registers: Bundle(readreg1 -> %2#, readreg2 -> %2#, writereg -> %2#, writedata -> %10#, wen -> %1#, readdata1 -> %10#, readdata2 -> %10#)\n", //--------------------THEN REGISTERS ARE SET------------------------------- //-----------------THEN WIRES ARE SET USING OTHER WIRES ARE REGISTER OUTPUTS------------------- |
Basically inconsistency arises due to printing contents of registers and wires mixed together. we should only ever be printing one or the other. |
- Add dump function to the single stepper - Improve the instruction print function Still need to make the pipeline registers print nicely Closes jlpteaching#107 Closes jlpteaching#59 Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Related to #23
Currently, when you run a single cycle in the single stepper, it's not clear whether you're seeing the output from before or after the cycle has happened. To make matters worse, I believe that some components print the "old" value and some the "new" value. Specifically, I believe registers and wires have different behavior.
We need to investigate this to figure out exactly what's going on. One solution would be to remove the
printf
s in the Chisel code and do everything from the Single stepper. Also, getting #23 would probably go a long way towards fixing this issue.@cjnitta, anything to add to this?
Email from Chris:
I'm trying to help a student debug their circuit, and there seems to be
a delay with the update of wires by one cycle. I have a similar setup to
them, but I ran:
runMain dinocpu.singlestep addi2 pipelined
It is on the write data to the register file, and the toreg. I see it in
the bundle on cycle 4 to be 17 and 0, but don't see the update of
write_data until a cycle later. Below is the relevant code, and the
output from my single stepping. Is there a reason wires are delayed a
cycle when in regards to the printing?
Thanks,
Chris
The text was updated successfully, but these errors were encountered: