Closed cr1901 closed 6 years ago
First of all, whoops, these branches should be swapped so that we fail early instead of crashing later.
Second of all, seems like PLLOUTGLOBAL is not a real Bel port, same as PLLOUTCORE. I think we should support designs that use this port via the following logic:
Similar to what we do with LOCK and ICESTORM_LCs...
@daveshah1 , what do you think?
PLLOUTGLOBAL has a dedicated connection to a global network via the padin, as if an SB_GB_IO was placed at the relevant location. This isn't the same as following the PLL output with a SB_GB (in arachne and the vendor tools, PLLOUTGLOBAL followed by SB_GB will waste a precious global buffer, and this is correct behaviour imo).
The proper solution is to add support for padin, which requires small changes to the bitstream gen as these are "extra bits" not part of a tile, implement PLLOUTGLOBAL properly and SB_GB_IO at the same time.
@daveshah1 Makes sense! Thank you for the info.
I'll implement this properly and also add a warning if the design uses a PLLOUTGLOBAL followed by an SB_GB.
Have added a temporary fix for this, since some additional things needed to be added for generated bitstream. Can you please check if https://github.com/YosysHQ/nextpnr/pull/76 works for you ?
@mmicko This solves the crash, but then I get the following warning:
Warning: PLL 'SB_PLL40_CORE' is using port PLLOUTGLOBAL but implementation does not actually use the global clock output of the PLL
Does the implementation refer to nextpnr
or my design? Because I route PLLOUTGLOBAL
directly to my intended system clock.
Warning is due to missing part in implementation, afraid it needs to wait for David to be fully resolved. As I understood it should even work with this change but not fully.
On Sat, Sep 22, 2018, 20:24 William D. Jones notifications@github.com wrote:
@mmicko https://github.com/mmicko This solves the crash, but then I get the following warning:
Warning: PLL 'SB_PLL40_CORE' is using port PLLOUTGLOBAL but implementation does not actually use the global clock output of the PLL
Does the implementation refer to nextpnr or my design? Because I route PLLOUTGLOBAL directly to my intended system clock.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/YosysHQ/nextpnr/issues/69#issuecomment-423763675, or mute the thread https://github.com/notifications/unsubscribe-auth/ADdKSONXNB6UoVMR_5D_88WC7uiQJDvFks5udoB2gaJpZM4WZ1wx .
@mmicko Well, the crash is gone, but my generated bitstream doesn't actually work. I guess for now that means this particular issue is resolved, but PLL support is still in progress.
Agree. It seams your other PLL issue is connected to global buffer bitstream handling as well.
I've been looking into this and this is what I have so far :
https://github.com/YosysHQ/nextpnr/compare/master...smunaut:ice40_pll_global
The only relevant commits are:
The first two are looking good to me. Basically first add some more info to the chipdb and then actually use that information.
The general idea, as discussed on IRC, is that when the PLL global output is used, we create a 'fake' SB_GB cell and we force it to the location that will drive the same global network than the PLL output will drive. We also mark that SB_GB as being 'fake' and during bitstream generation, we use that info to set the extra bits that will actually padin. Doing it that way also ensures that this global network / global buffer won't be used by anything else. (Just had to move global promotion after special packing).
And this is what the two first commit do.
The remaining hack is needed because when the PLL doesn't have any output connected, the current bitstream generation code will disable it and the associated IO ...
I'm trying to work out how to deal with that properly but the current code seems to rely on the order the SB_IO and ICESTORM_PLL are processed in the loop over the cells in write_asc which is definitely not good since AFAICT, nothing guarantee this order ...
I've updated my tree with my latest changes, cleaning it all up. I think it's ready to be reviewed / tested.
For the IO config what I ended up doing is :
So the IE/REN bits are always configured as part of the SB_IO config. That's because it's only needed if that site is used as an actual input (either pad or otherwise) and in that case, there will be a SB_IO cell in the list of cells for that site.
The PINTYPE bits are configured during the PLL config because for some of the SB_IO used in the output path, it's possible we don't have any SB_IO that correspond to that site in the design.
Actual Behavior
The following Verilog module:
results in the following assertion failure:
Expected behavior
PLLOUTGLOBAL
followed bySB_GB
should be supported innextpnr
, even if it's an obsolete hint (?) to thepnr
tool.Other information
MCVE
I have provided an MCVE: pll-crash.zip