-
Notifications
You must be signed in to change notification settings - Fork 154
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
Xilinx DDR output: Haskell model wrong for Enable
#2840
Comments
Enable
I should try tomorrow at which clock edge the negative-side register latches its input... maybe they just accidentally apply the |
No, it reacts to both data inputs on the active, rising edge, so the model is configured as |
So deasserting the
|
oddr
inClash.Xilinx.DDR
shares the Haskell simulation model withddrOut
inClash.Explicit.DDR
. However, they react differently to theEnable
signal, making the model wrong for Xilinx'soddr
.The generic
ddrOut
and its model will gate the clocks at the registers, but the contents of the registers will keep being outputted on their respective edges. The Xilinx simulation model will freeze the output at the contents of the register holding the data to output on the positive edge.This can be seen in this Vivado simulation. I deliberately drop the enable asynchronously to the clock to test its asynchronous behaviour. The data inputs to the DDR primitives are just counters, one counting from 100 and up and the other from 200 and up, so you can tell them apart immediately.
What the generic
ddrOut
does is gate the registers, freezing their respective values at 120 and 220, but still one register is outputted on the active edge (120) and the other on the falling edge (220), hence still outputting a changing signal. Below that is Xilinx'soddr
, which gates the register at 120 but then also freezes the output, constantly outputting the 120 until the enable asserts again and both are once again the same, outputting 126 on the rising, active edge and outputting 226 on the falling and incrementing after that.(Note that they also respond differently to the reset signal being asserted, but since they leave reset in the same fashion I consider it less important than this bug. Frankly, the simulation model in Vivado for the Xilinx primitive is a bit weird in that respect, reacting to reset on the falling edge even though the rising edge is the active edge.)
Although now I suddenly notice it is also reacting to the
Enable
in the same weird way, on the falling edge! Suddenly the propagation delay for theEnable
is reduced to half a clock period instead of a full one. I wonder if the primitive comes with its own timing constraints that actually ensure that it is bounded that way? Weird!The following is some code you could use to simulate stuff in Vivado. It's what I've been using to muck around with DDR outputs. I wanted
testBench
to outputReset Slow
as well, but I hit a Clash compiler bug... And #2570 (or something like it) is preventing me from stopping the clocks, so you'll just need to stop the simulation in Vivado.The text was updated successfully, but these errors were encountered: