-
Notifications
You must be signed in to change notification settings - Fork 200
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
gateware/eem: Force IOB=TRUE on Urukul SYNC output #1382
Conversation
You can use this feature of Python to avoid all the
|
Without this, the final register in the SYNC signal TTLClockGen isn't (always) placed in the I/O tile, leading to more jitter than necessary, and causing "double window" artefacts. See sinara-hw/Urukul#16 for more details. (Patch based on work by Weida Zhang, testing by various members of the community in Oxford and elsewhere.)
8834229
to
17c4c17
Compare
Ah, didn't realise it worked for empty lists – such is polyglot life. Thanks! |
As I said you should check whether the assumption is flawed. If it is then we probably need this everywhere: ttls, frequency generators, spi2. |
I believe that what @WeiDaZhang looked at the floor plan for the current artiq master and confirmed that the clock gen was not in the IOB without this pr. I’m not aware of any Xilinx literature saying that the final FF for a registered output will be in the IOB unless one asks for it, so I don’t think this should be a surprise. |
@dnadlinger why not apply the IOB attribute directly to the phy? |
@hartytp That's a misnegation. Assuming you want to say the opposite, that there is no evidence Xilinx packs registers into IOBs by default: That's incorrect. By default ISE does try to pack registers into IOBs and that is well specified in the literature ( Failing here is indeed a surprise and it is crucial to figure out why it didn't pack here because it makes a lot of other code (TTLs, other frequency generators, spi2, suservo) questionable. |
@whitequark I think that may have been due to the attribute being either on the wrong entity (it only works on cells, not nets/pins IIRC) or lost when nets/ports/pins are renamed/merged (which is worked around with DONT_TOUCH/KEEP). Vivado treats failure to honor IOB=TRUE as an error according to the documentation. |
@jordens let's check we're on the same page. As I understand it, the data we have are:
Observations:
Assuming we agree on the above, there is a separate issue as to why Vivado's actual behaviour does not match your expectations/the documentation. |
None of this is in question. Urukul SYNC must be a IOB register. But additionally and regarding the PR:
I don't think Vivado's behavior necessarily violates the documentation. Not all registers can be packed into IOBs (automatically or forced). The typical cases where they can't are known. |
Regarding this PR, I don't (want to) know enough about the internal quirks of Migen to know what the most appropriate place to put the attribute would be. Both this and explicitly inserting a ODDR special work, as tested by @WeiDaZhang. As for what assumptions were made in other parts of the code (simple TTL outputs, SPI, …), I was hoping that this would be more obvious to the people who originally wrote that code. It does seem like there could be extra jitter in unexpected places right now, but then, the other signals typically also aren't sampled by a clock 8 times the frequency. Xiliinx AR# 66668 does suggest that IOB=TRUE is a hard constraint, by the way, and briefly mentions DONT_TOUCH: https://www.xilinx.com/support/answers/66668.html |
I briefly checked the build log for a gateware that does exhibit the extra jitter, and didn't see any obvious warnings mentioning "IOB", "packed" or the name of the sync signal in the Verilog source. (This, of course, might or might not imply that Vivado considers not packing the register into the I/O tile a normal occurrence.) |
I don't see anybody interested in digging deeper and address the issues mentioned. Go ahead and merge it. |
I’ll see if Weida has time to look into the issues you mentioned when he’s back from holiday. Personally I don’t think that should stop us from merging this now. |
The code for a proper solution may be very different. |
Regarding Migen, if there are reliability issues with putting the attribute on the pin signal using
In what way? Do you mean if we end up globally applying IOB=TRUE instead? Instantiating an ODDR special explicitly might be more "proper" if there are Migen codegen issues, but only works on 7-series targets. |
It is not trivial. |
Without this, the final register in the SYNC signal TTLClockGen
isn't (always) placed in the I/O tile, leading to more jitter
than necessary, and causing "double window" artefacts. See
sinara-hw/Urukul#16 for more details.
(Patch based on work by Weida Zhang, testing by various members
of the community in Oxford and elsewhere.)
@jordens: Over on the Urukul issue, you mentioned:
Given that this definitely changes behaviour on the Urukul SYNC clock, are there any other signals we should pin like this right away?