Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRegisters Update on the Wrong Cycle #216
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
albert-magyar
May 16, 2014
Contributor
Here, it's not actually showing the input value of the registers. The behavior is that stepping the circuit does a clock_lo followed by a clock_hi, which results in updates to register values from the clock_hi not propagating through any combinational nodes (including wires) to affect values of downstream nodes until another step is performed. This is also mirrored in VCDs from testers. There is ongoing discussion about whether to change this often-confusing behavior.
|
Here, it's not actually showing the input value of the registers. The behavior is that stepping the circuit does a |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
aswaterman
May 16, 2014
Contributor
It's not just confusing; it's wrong, and we should fix it.
On Fri, May 16, 2014 at 3:02 PM, Albert Magyar notifications@github.comwrote:
Here, it's not actually showing the input value of the registers. The
behavior is that stepping the circuit does a clock_lo followed by a
clock_hi, which results in updates to register values from the clock_hinot propagating through any combinational nodes (including wires) to affect
values of downstream nodes until another step is performed. This is also
mirrored in VCDs from testers. There is ongoing discussion about whether to
change this often-confusing behavior.—
Reply to this email directly or view it on GitHubhttps://github.com/ucb-bar/chisel/issues/216#issuecomment-43384247
.
|
It's not just confusing; it's wrong, and we should fix it. On Fri, May 16, 2014 at 3:02 PM, Albert Magyar notifications@github.comwrote:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
albert-magyar
May 16, 2014
Contributor
I personally agree that it was wrong, but there was some debate when I was presenting a possible change for this at the Chisel meeting. Jonathan and I came up with some optimizations for minimizing the performance costs of the extra computation when propagating signals properly for use with the tester, and the plan should be to settle all the tester-behavior questions as soon as possible.
|
I personally agree that it was wrong, but there was some debate when I was presenting a possible change for this at the Chisel meeting. Jonathan and I came up with some optimizations for minimizing the performance costs of the extra computation when propagating signals properly for use with the tester, and the plan should be to settle all the tester-behavior questions as soon as possible. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ben-k
May 17, 2014
Member
To the extent that there is debate about this, I would add that everyone in 290C this semester (BWRC folks, mostly) thought that this behavior didn't make any sense.
|
To the extent that there is debate about this, I would add that everyone in 290C this semester (BWRC folks, mostly) thought that this behavior didn't make any sense. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sdtwigg
May 17, 2014
Contributor
I just checked and this seems to also be a new issue for vcd dumping. I had fixed it before so that the dump function was being called in-between clock_lo and clock_hi (this would then at least dump waveforms that could be somewhat reasoned over); however, with the tester rewrite the same trick cannot be immediately employed.
|
I just checked and this seems to also be a new issue for vcd dumping. I had fixed it before so that the dump function was being called in-between clock_lo and clock_hi (this would then at least dump waveforms that could be somewhat reasoned over); however, with the tester rewrite the same trick cannot be immediately employed. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
schoeberl
May 18, 2014
Member
If this is still the display of the 'input' value of a register at the waveform, then I also strongly think this is wrong. You see the value 'shifted' by a clock cycle. This confused quite some of my students.
Another argument: compare it with the waveform when simulating the Verilog in ModelSim where you will see the 'output' of the register.
Cheers,
Martin
On 17 May 2014, at 01:05, Albert Magyar notifications@github.com wrote:
I personally agree that it was wrong, but there was some debate when I was presenting a possible change for this at the Chisel meeting. Jonathan and I came up with some optimizations for minimizing the performance costs of the extra computation when propagating signals properly for use with the tester, and the plan should be to settle all the tester-behavior questions as soon as possible.
—
Reply to this email directly or view it on GitHub.
|
If this is still the display of the 'input' value of a register at the waveform, then I also strongly think this is wrong. You see the value 'shifted' by a clock cycle. This confused quite some of my students. Another argument: compare it with the waveform when simulating the Verilog in ModelSim where you will see the 'output' of the register. Cheers,
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stevobailey
Jun 23, 2014
I'd like to refresh this discussion and make sure someone is working on fixing it. It feels like a rather problematic bug.
stevobailey
commented
Jun 23, 2014
|
I'd like to refresh this discussion and make sure someone is working on fixing it. It feels like a rather problematic bug. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
albert-magyar
Jun 24, 2014
Contributor
There is a fix for this that will be going in ASAP, likely in the next day when I return to Berkeley.
|
There is a fix for this that will be going in ASAP, likely in the next day when I return to Berkeley. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
schoeberl
Jun 24, 2014
Member
That's very good news ;-)
Cheers,
Martin
On 24 Jun 2014, at 02:36, Albert Magyar notifications@github.com wrote:
There is a fix for this that will be going in ASAP, likely in the next day when I return to Berkeley.
—
Reply to this email directly or view it on GitHub.
|
That's very good news ;-) Cheers,
|
ben-k commentedMay 16, 2014
Whether using the Tester class or a vcd, Chisel displays the input value of registers, rather than the output, which I don't think is correct behavior. Here's a very simple example:
class Cordic extends Module {
val io = new CordicIo()
val delay = Reg(next=io.in,init=Bool(false))
io.out := delay
}
And here's the Tester result:
STEP 2 -> 2
POKE Cordic.io_in <- 1
STEP 1 -> 3
PEEK Cordic.io_in -> 0x1
PEEK Cordic.delay -> 0x1
PEEK Cordic.io_out -> 0x0
POKE Cordic.io_in <- 0
STEP 1 -> 4
PEEK Cordic.io_in -> 0x0
PEEK Cordic.delay -> 0x0
PEEK Cordic.io_out -> 0x1
Delay is always displayed according to its input value, rather than its output. In particular, io.out is combinationally wired directly to the output of delay, so out and delay should never be different.
I don't think this necessarily impacts functionality, but it makes debugging using the Tester class or Chisel-generated waveforms very confusing.