-
Notifications
You must be signed in to change notification settings - Fork 14
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
LUTRAM write occurs on rising edge regardless of IS_WCLK_INVERTED property #33
Comments
Do you know how to disassemble a bitstream with bit2fasm? |
Yes, here:
|
See |
@hansfbaier Yes, LUTRAM is currently not being handled in the fasm writer. Since LUTRAMs and FFs share the CLKINV BEL, I am thinking that the CLKINV bit should not be set inside |
There is a rule in nextpnr-xilinx/xilinx/arch_place.cc Lines 557 to 558 in 30ba8fb
We may want to define a new rule to compare LUTRAM's clkinv and FF's clkinv. |
good, I would join this work next week |
Sounds good. I am still in the process of figuring out how to fully test whether the CLB placement rules work to catch problematic physical implementations. I suppose this is a good time to ask if anyone can reliably place LUTRAMs and FFs in the same CLB slice since I am failing to do this task with openxc7 flow. |
@hansemro How do you try to place them? xdc file, LOC annotations or other means? |
In the place phase, is there any rule to avoid ff with different clkinv inside a slice? |
This may be an impossible task for the moment since we do not yet support manual BEL placement yet with LOC and BEL attributes. I was looking into setting CONSTR_{X,Y,Z} attributes in the post-pack json, but I am not entirely sure this is where we should be looking. Sorry for giving a rather loaded task; I don't know enough about nextpnr to give proper instructions. |
|
@hansemro The primitives-fixes branch contains changes which seem to fix this issue. |
Issue Description
Issue discovered in #20 (comment)
When IS_WCLK_INVERTED property is asserted, we expect the write to LUTRAM to occur on the falling edge. However, this does not happen as the placer and fasm writer ignores the property for LUTRAMs, and, therefore, treats as if all writes should occur on rising edge. This may lead to functional errors in designs that require writes on negative edge.
Steps to Reproduce and Test
To distinguish between a write occuring on a positive edge and negative edge of clock, I created a simple test with two LUTRAMs sensitive to different edges of clock. Output of posedge LUTRAM and negedge LUTRAM drives led_o[0] and led_o[1], respectively. A single BSCANE2 primitive will be used to manually drive WCLK+DI+WE pins of the LUTRAM via JTAG.
xc7-lutram-negedge-write-demo
branchNote
If targeting an FPGA board other than SQRL Acorn CLE215+, then provide an XDC file with
3 active-low LEDs mapped to led_o[2:0] and update
BOARD
/FAMILY
/PART
/JTAG_CABLE
/XDC
target parameters in the Makefile.
Check that
CLKINV
bit is not set anywhere insidetop.fasm
(a sign that the test will fail). Proceed with the following steps to test.Load the bitstream onto the FPGA:
Note
Use an appropriate interface adapter script (usually located in
/usr/share/openocd/scripts/interface/
).Digilent HS2 support is provided with
digilent-hs2.cfg
in caseinterface/ftdi/digilent-hs2.cfg
does not work.Note
setup.cfg
defines a functionset_lutram <we> <data> <clk>
to manually set LUTRAM input pins.To avoid setup/hold violations, we should not change clk and we/data together.
If the design works correctly, only the LED (led_o[0]) assigned to the posedge LUTRAM should be lit after a positive-edge write. If LEDs led_o[1:0] light up together, then the design was incorrectly implemented. (LED at led_o[2] should dim on positive-edge write since the outputs should differ).
Anyhow, to perform a write on the negative edge, we would run the following afterwards:
Design implemented with Vivado should have the two LUTRAM perform writes at different edges of the clock.
Other Considerations
LUTRAM and FFs share clock from CLKINV routing BEL, so all synchronous elements within the SLICE site must have the same IS_*CLK_INVERTED property.
The text was updated successfully, but these errors were encountered: