library/spi_engine: SDO Extension upgrade#1808
Conversation
LBFFilho
left a comment
There was a problem hiding this comment.
Overall this seems headed in a nice direction, and thanks for also doing a lot of small fixes and improvements to the existing code along the way.
About the version: is this going to be a minor version or a major version bump? I understand that the removed register was not used anywhere (it was broken even), but technically we're breaking anything that relied on it. Also changing the behavior of the SDI & SDO FIFOs.
Also, please check timing on ad4052/de10nano just to be sure if it's all good.
8a2552e to
15eaefd
Compare
4300d4c to
6d23286
Compare
df039b8 to
ce44e94
Compare
149396a to
ab91a18
Compare
cb4785c to
0ff6ae5
Compare
5cf2987 to
3692374
Compare
|
I've tested this again today with the latest rebase. Seems to be working OK still. So the only request from my side still remaining is bumping the SPI Engine IP version to 2.0.0. |
|
I have updated the version of the SPI Engine to 2.0 and solved the issues of the tcl scripts. |
0f4024a to
e1fbc2e
Compare
d95ada4 to
7516b6e
Compare
|
The SPI driver changes have been accepted upstream in the Linux kernel and included in kernel v7.0. So we can now backport those changes to the ADI kernel tree and get this merged. |
ba03905 to
6d7734a
Compare
ecb512f to
8f53cd1
Compare
8f53cd1 to
626aeef
Compare
f5d9317 to
db7bc42
Compare
IstvanZsSzekely
left a comment
There was a problem hiding this comment.
I was asked to check the util_axis_fifo_asym changes in this PR.
The suggested modification with an added AXI4Stream register slice kind of does and doesn't belong to it. It makes sense to add it to ensure better timing overall, but at the same time I can imagine it being used without knowing why. Helps timing? Yes. Then just add it and don't think about it. And I would like to avoid this if possible. If you want to add the slice to the SPI Engine to ease timing, I would suggest doing it outside of the FIFO, as it maintains the boundaries of the core.
I built the AD4630 with a couple of parameter options provided by @sarpadi without the util_axis_fifo_asym changes and I did not see a timing violation on the module. However, I did see some timing violations on in the SPI Engine. Built with Vivado version 2025.1
Here are the build parameters I used:
make CLK_MODE=1 NUM_OF_CHANNEL=2 LANES_PER_CHANNEL=4 CAPTURE_ZONE=2 DDR_EN=1
make CLK_MODE=1 NUM_OF_CHANNEL=2 LANES_PER_CHANNEL=4 CAPTURE_ZONE=2 DDR_EN=0
make CLK_MODE=0 NUM_OF_CHANNEL=2 LANES_PER_CHANNEL=4 CAPTURE_ZONE=2 DDR_EN=0
I already tried to put this register slice outside the "util_axis_fifo_asym", it does not work for timing issues. The issue is raised then there are several lanes, for example 2 channels with 4 sdi lanes each (8 sdi lanes in total). The problem does not happen everytime, our tests passed 30% of the time. The critical path involves the "util_axis_fifo_address_generator.v" (line 155) inside the "util_axis_fifo" and the "util_axis_fifo_asym" (for our case, line 169). We need to break this path inside the library, any external solution will not work. Regarding the usage, I put a parameter SRC_REG_SLICE_EN that is disabled by default. So the other projects would not be using it unless it is required. I also updated the documentation for that in this PR: #2031. I just left the commit over here so the other could test the project without a timing failure. |
db7bc42 to
967ce34
Compare
a4b112b to
a766578
Compare
|
I see there might still be HDL issues to discuss. Just for the record, the related Linux kernel updates have been merged into ADI Linux main branch (analogdevicesinc/linux#3158). So, we can now also test HDL updates with the main kernel from ADI, if needed. |
* Extend SDO support to 8 (symmetrical with SDI support); * Update SDI to use asymmetrical FIFO; * Insert symmetrical FIFO for the SDO; * Insert SDI lane mask configuration instruction to reg 3'b011; * Insert SDO lane mask configuration instruction to reg 3'b100; * Insert offload active interface for interconnect and execution; * Remove register 8'h3b from spi engine regmap; * Improvements on the critical paths of the execution module. Prefetching on offload work iff all lanes are active. There is a different register for SDI lane mask and SDO lane mask; Update the NUM_OF_SDI parameter to NUM_OF_SDIO parameter to reflect that both SDI and SDO are symmetrical. The control over them is through the SDI/SDO lane masks. Inserts a ready signal for when the valid_indices has finished its inner logic. This avoid the possible issue where the latency of the command is smaller than this logic. This could only happen in the FIFO mode. Introduces logic to keep track of the number of elements in the SDI FIFO. This is due to the asymmetric FIFO implementation not including the logic for this, and instead outputting the level of one of its internal FIFOs. The modifications performed in this library are not backwards compatible. So this version is Spi Engine 2.0. Signed-off-by: Laez Barbosa <[email protected]> Signed-off-by: Carlos Souza <[email protected]>
* Update documentation to include the changes done for supporting more than one SDO lane. * Update the register map; * Insert SDI/SDO lane mask registers; * Update Configuration Write Instruction; * Update parameter from NUM_OF_SDI to NUM_OF_SDIO. Update NUM_OF_SDI to NUM_OF_SDIO in the projects documentations. The variable was updated on the spi_engine library since SDI and SDO have symmetrical sizes. Signed-off-by: Carlos Souza <[email protected]>
Updates the projects to use SPI ENGINE 2.0. Also adds optimization options for timing closure of the AD4052 project. Removes wrong timing constraints for the coraz7s carrier. Signed-off-by: Carlos Souza <[email protected]>
a766578 to
4734cb3
Compare
PR Description
Upgrade SPI engine to support up to 8 lanes. For that, two new registers were inserted into Configuration Write Instruction, they are responsible for setting the SDI and SDO lane masks. Each bit represents a lane.
This PR also removes register 8'h3b from the SPI Engine regmap.
The testbench for this modification is here: analogdevicesinc/testbenches#240
PR Type
PR Checklist