Commit Graph

64 Commits (main)

Author SHA1 Message Date
LBFFilho e757859b56
SPI Engine: create inverted CS mode (#1301)
SPI Engine: create inverted CS mode

Add a CS Invert Mask instruction for selecting the polarity of
the Chip Select pins.

Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
2024-05-08 11:19:37 -03:00
Jorge Marques e2ca5a991a
spi_engine: Create interface_ip.tcl (#1251)
Use tcl script instead of static xmls for the interface.
Easier to maintain and are not gitignored.
Rename spi_master to spi_engine because every interface should be
prefixed by the IP name; in this case, spi_engine.
Also, remove interface/*.sv files on make clean and git ignore them.

Signed-off-by: Jorge Marques <jorge.marques@analog.com>
2024-02-28 10:31:46 -03:00
LBFFilho f01d7e5951
SPI Engine: fix early sdi data clear (#1231)
* SPI Engine: fix early sdi data clear

In case an SPI read was immediately followed by a cs assert, the sdi
register was being cleared one cycle too soon, so that the data being
passed on was always 'b0.

Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
2024-02-05 17:18:27 -03:00
Iulia Moldovan 68461110aa Replace link in license header from master to main
Signed-off-by: Iulia Moldovan <Iulia.Moldovan@analog.com>
2024-01-16 16:48:45 +02:00
caosjr bad1d03678
spi_engine: Fixup param ranges and CPHA info (#1239)
Set validation ranges for DATA_WIDTH and NUM_OF_CS for the expected
min/max values in the verilog source code.
Also, fix swapped description for CPHA in the documentation.

Signed-off-by: Carlos Oliveira <caosjr8@gmail.com>
2023-12-18 10:52:26 -03:00
LBFFilho becc035ba9
SPI Engine: Fixed delay behaviour on Chip-Select and Sleep instructions (#1200)
Fixed wrong behaviour on chip select instruction:
- previously, a sleep time happened before the chip select change
- the intended behaviour was for another sleep time, of equal amount, to happen after the chip select change as well
- additionally, the counter logic implementation was creating an additional factor of 2 on the sleep time

All of the above points were fixed. The changes introduced also fix another issue where the sleep instruction was likewise happening with a duration larger than intended by a factor of 2


Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
2023-10-30 09:52:04 -03:00
Iulia Moldovan c9a7d4d927 Add copyright and license to .tcl, .ttcl files
Signed-off-by: Iulia Moldovan <Iulia.Moldovan@analog.com>
2023-07-25 15:22:26 +03:00
Iulia Moldovan 28c06d505f Add/edit copyright and license for .v, .sv files
Signed-off-by: Iulia Moldovan <Iulia.Moldovan@analog.com>
2023-07-11 15:17:41 +03:00
Iulia Moldovan db94628cc6 library & projects: Update Makefiles
Signed-off-by: Iulia Moldovan <Iulia.Moldovan@analog.com>
2023-01-27 11:54:05 +02:00
Iacob_Liviu 482f0489a3 scripts: Merge adi_env.tcl into a single file
Move the new adi_env.tcl file from hdl/projects/scripts into hdl/scrips
2022-08-08 13:52:54 +03:00
Iulia Moldovan 0c0617d49e libraries: Update modules according to guideline
* Added header license for the files that didn't have
* Modified parentheses
* Removed extra spaces at the end of lines
* Fixed parameters list to be each parameter on its line
* Deleted lines after endmodule and consecutive empty lines
* Fixed indentation

Signed-off-by: Iulia Moldovan <iulia.moldovan@analog.com>
2022-06-28 18:06:56 +03:00
LIacob106 076e81a17c library: Add link to wiki for IPs 2021-10-25 10:44:53 +03:00
Istvan Csomortani 5ac64b021f spi_engine_execution: Delete control loop-back in sdi_data_valid generation 2021-10-18 16:13:31 +03:00
Laszlo Nagy 51b643b978 Makefile: Fix misc makefiles from projects and library 2021-10-05 14:24:48 +03:00
Adrian Costina 591a23156b Makefiles: Update header with the appropriate license 2021-09-16 16:50:53 +03:00
Iacob_Liviu 6763ddcda9 spi_engine_execution: Fix cs signal generation
The cs signal can now accept the IOB TRUE attribute.
2021-09-13 11:39:02 +03:00
stefan.raus 4a772265a9 Update Quartus Prime version from 19.3.0 to 20.1.0
adi_project_intel.tcl: Change quartus version to 20.1.0.
library: Set qsys version so that IP instances won't require a specific version.
2021-03-08 11:29:33 +02:00
Istvan Csomortani 93f46ef6e3 spi_engine_execution: Add constraints file 2021-02-04 11:04:32 +02:00
Istvan Csomortani ab10bd136e spi_engine_execution: Add echoed SCLK support
There are boards (e.g. AD4630-24) which take the SCLK and echo back to
the FPGA through a level shifter - doing this removes the effect of
round-trip timing delays from the level shifter. This is commonly done
whenever isolators are used since they are very slow.

By setting the ECHO_SCLK parameter to 1, the IP will use the incoming
echoed SCLK clock to latch the SDI line(s). The sdi_data_valid is still
synchronous to the SPI clock, and it's generated after the last valid
SDI latch.

The designer's responsibility is to time the SDI shift registers in order to
respect the design requirements.
2021-02-04 11:04:32 +02:00
Istvan Csomortani 37254358dd makefile: Regenerate make files 2020-10-20 12:51:10 +03:00
Istvan Csomortani b827322917 spi_engine_execution: Add missing parameter definition into hw.tcl script 2020-09-15 18:14:23 +03:00
Istvan Csomortani 46419f8d09 spi_engine: Fix ip scripts for regmap, offload and execution
Fix the *_ip.tcl scripts for axi_spi_engine and spi_engine_offload
module.

In case of a bool parameters the value_format and value properties must
be set for both user and hdl paramters. If not, in the generated verilog
code the tool will use "true" or "false" strings, instead of 0 or 1.
2020-08-24 16:45:02 +03:00
Istvan Csomortani c8fb3a1846 spi_engine_execution: Update IPXACT GUI layout 2020-08-18 08:53:32 +03:00
Stanca Pop 5d4d34477c spi_engine: Add Intel Support 2020-08-17 16:37:21 +03:00
Istvan Csomortani 11947f2e7e spi_engine_execution: code refactoring
The added modification do not chnage the functionality of the module.
2020-08-13 10:01:16 +03:00
Istvan Csomortani 45d806ff11 spi_engine_execution: Fix sdi_shift_reg reset and command latching 2020-08-13 10:01:16 +03:00
Istvan Csomortani 51ebe6b35d spi_engine_execution: Latch sdx_enabled
The sdo_enabled and sdi_enabled control lines are generated from the
current state of the CMD bus.

In case of a delayed SDI latching the sdi_enabled can be deasserted at
the moment of the last valid bit, losing the generation of the sdi_data_valid
signal, which eventually cause a data loss, or even deadlock  on software driver.

To make the logic mode robust, latch the value of the CMD[9:8] at every
transfer command. Doing so the sdo_enabled and sdi_enabled control lines will
store the last active transfer command state and they will be
independent of the current state of the CMD bus. This way we can add
longer time delay to the SDI latching if it's necessary.
2020-06-18 15:46:06 +03:00
Istvan Csomortani e0d47645de spi_engine_execution: Optimize SDI latch delay logic 2020-06-18 15:46:06 +03:00
Istvan Csomortani 4d54c7e2d6 spi_engine_execution: Merge the SDI lines into one vector
This modification will help to support multiple SPI engine
execution setups (e.g. different NUM_OF_SDI) for the same project.
2020-05-19 09:28:02 +03:00
Istvan Csomortani 3a029fc1f0 spi_engine_execution: Define all wires before use 2020-05-19 09:27:28 +03:00
Istvan Csomortani 8f2a223af9 spi_engine_execution: Fix the SDI latching
The commit 9ab88f1200 introduced a new
feature for the execution module, which provides the possibility to
delay the SDI line latch with one or more core clock cycle. Unfortunatly
the implementation was not correct and the SDI line was latched at the
wrong time.

This patch fix the aligment of the shift register and the SDI_DELAY parameter,
to latch the SDI line of the physical interface at the right time.

Improve the description of the feature.
2020-05-06 04:23:10 +01:00
Arpadi 5dc2ab9fe7 spi_engine/execution: dynamic length bugfix
ip can now send multiple words per transfer with dynamic data length
2019-10-28 12:00:23 +02:00
Istvan Csomortani 2ea8838f6a spi_engine/execution: wire/reg must be defined before usage
xsim does not like if a register or wire is used before their
definition. Make sure the every register and wire is defined before it's
used the first time.
2019-10-28 12:00:23 +02:00
Istvan Csomortani 363494ab9c library/scripts: Rename adi_ip.tcl to adi_ip_xilinx.tcl 2019-06-29 06:53:51 +03:00
Sergiu Arpadi ba4a915af0 ad40xx/zed: fixed system_bd
spi_engine_execution: fixed sdo default
2019-06-28 11:18:29 +03:00
Istvan Csomortani f4de1fecdc spi_engine_execution: Add an additional register stage for the physical SPI
The main reason is to improve timing when the SPI clock is more than
50 MHz. (the SPI Engine's spi_clk is more than 100MHz)
2019-06-28 11:18:29 +03:00
Istvan Csomortani 158b018f58 spi_execution: Improve timing by defining resets for the shift registers 2019-06-28 11:18:29 +03:00
Istvan Csomortani d802ece39e spi_engine: Reindent execution module source code 2019-06-28 11:18:29 +03:00
Istvan Csomortani 9ab88f1200 ad40xx: Initial commit 2019-06-28 11:18:29 +03:00
Istvan Csomortani 5f8269da03 spi_egine: Add a new register for dynamic transfer length configuration 2019-06-28 11:18:29 +03:00
Istvan Csomortani b81c8373e5 spi_engine: In read only mode SDO line should stay in its default level 2019-06-28 11:18:29 +03:00
Istvan Csomortani 19655b8092 spi_engine: Define SDO default state
There are devices where the SDO default state, between transactions, is
not GND, rather VCC.

Define a parameter, which can be used to set the default state of the
SDO line.
2019-06-28 11:18:29 +03:00
Istvan Csomortani 45a08a004d spi_engine:execution: Set default SDI driver value for all ports 2019-06-28 11:18:29 +03:00
Lars-Peter Clausen d72fac4b1e Add missing timescale annotations
For consistent simulation behavior it is recommended to annotate all source
files with a timescale. Add it to those where it is currently missing.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2018-10-17 10:32:47 +03:00
Lars-Peter Clausen 2b914d33c1 Move Altera IP core dependency tracking to library Makefiles
Currently the individual IP core dependencies are tracked inside the
library Makefile for Xilinx IPs and the project Makefiles only reference
the IP cores.

For Altera on the other hand the individual dependencies are tracked inside
the project Makefile. This leads to a lot of duplicated lists and also
means that the project Makefiles need to be regenerated when one of the IP
cores changes their files.

Change the Altera projects to a similar scheme than the Xilinx projects.
The projects themselves only reference the library as a whole as their
dependency while the library Makefile references the individual source
dependencies.

Since on Altera there is no target that has to be generated create a dummy
target called ".timestamp_altera" who's only purpose is to have a timestamp
that is greater or equal to the timestamp of all of the IP core files. This
means the project Makefile can have a dependency on this file and make sure
that the project will be rebuild if any of the files in the library
changes.

This patch contains quite a bit of churn, but hopefully it reduces the
amount of churn in the future when modifying Altera IP cores.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2018-04-11 15:09:54 +03:00
Lars-Peter Clausen 35a39ba2e6 Regenerate library Makefiles using the new shared Makefile include
This reduces the amount of boilerplate code that is present in these
Makefiles by a lot.

It also makes it possible to update the Makefile rules in future without
having to re-generate all the Makefiles.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2018-04-11 15:09:54 +03:00
Istvan Csomortani 425e803364 license: Fix a spelling mistake 2018-04-11 15:09:54 +03:00
Istvan Csomortani 269ae40f66 spi_engine: Add support for 8 SDI lines 2018-04-11 15:09:54 +03:00
Istvan Csomortani ed20d00f77 spi_engine: Add support for max 4 SDI lines 2017-08-04 14:49:17 +03:00
Istvan Csomortani 84b2ad51e2 license: Add some clarification to the header license 2017-05-31 18:18:56 +03:00