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
Just crashes on ICESTORM_LC instantiation. #365
Comments
Is there a documentation about what to use when I want to get a specific outcome? Using SB_LUT4, SB_CARRY and SB_DFF will not help since the nextpnr will not fuse them (well, I saw that the LUT and DFF are getting fused, but not the CARRY). |
Are you sure what you're asking is valid ? |
In my mind it is clear, like the __asm directive in C. I read the specs (ICE40 datasheet/iceStorm) and I want a special logic tile, or a stack of LCs. It is the way to develop building blocks that then can be frozen and reused, multiplied. It might not be better then what an optimizer for the whole FPGA can master, but it is better in the way that you can incrementally build your FPGA. This is also the way to do partial modification of an FPGA on the fly. Think that a number of tiles are frozen and let the compiler manage with the rest. It might be as portable as the assembler code is (ok between x86s, but cannot go to riscV). But that is ok from my point of view. |
I'm talking about the SB_LUT4 SB_CARRY SB_DFF connections you're asking ... if they're physically doable inside the fpga which might explain why nextpnr isn't packing them in the same LC. Also you can lock theses down to specific locations if you want ... |
Well, I saw that yosys can take a verilog like However if I do the same, use SB_* in my verilog, nextpnr will not bind them together. You can see an example in: So if ICESTORM_LC is an internal thing, then what are the hints that I can give to nextpnr to instruct the fusing of a SB_* triplet. |
Yes and looking at that code, it's not implementable. The "Carry In" to a LC replaces the I3 of the LUT, they need to be connected to the same wire, it's a physical limitation of the FPGA. So to be in the same LC, I3 of the LUT must be connected to the CI of the SB_CARRY. Also:
Those are limitation of the iCE40 architecture. If you obey them, then nextpnr will pack them properly. |
Maybe we should continue this on the stack overflow. But. It is my understanding that when I use the I3 input as an input, the "carry in" will still go to the carry unit regardless. The mux between the "carry in" and the I3 input is affecting only the LUT and not the carry. Here is the carry function from icestorm project :
|
I'm trying to pack things tightly (for a Time-to-Digital Converter) and ran into this issue as well. I rebuilt nextpnr with debug symbols and caught the exception for the following code:
Which corresponds to this line: Line 247 in 3b5e64e
Which seems to expect that .COUT is defined (perhaps yosys normally defines every port?). So if I do the following, the error goes away and things route properly.
|
Alright, I've been starting at nextpnr code for a number of hours now had have some semblance of what's going on (and why I'm struggling to manually place an ICESTORM_LC): One of the steps nextpnr does is to identify "carry chains" that need to be placed (more or less) vertically. If a carry is enabled for a cell, it is coalesced into a chain with additional ICESTORM_LCs at the top and bottom. Only the top of the chain is actually placed via the specified algorithm (HEaP by default), everything else is simply defined relative to the top of the chain (I think there are some nuances though). The extra top (and bottom) ICESTORM_LCs don't inherit any BEL placement from any of the child cells thus it's never used. I've tried a couple different modifications to the code to no-avail:
|
Finally getting somewhere! This commit: newhouseb@39f15c4 enables me to sort of manually place a cell, using the following code (note the BEL attribute):
It does so through a couple modifications:
Some funky things about this:
|
Version:
nextpnr-ice40 -- Next Generation Place and Route (git sha1 2898d81)
Input:
Result
terminate called after throwing an instance of 'std::out_of_range'
what(): _Map_base::at
The text was updated successfully, but these errors were encountered: