Commit Graph
310 Commits
Author SHA1 Message Date
Wade Fife 38e4708a4a fpga: Remove stale references to UHD_FPGA_DIR
Original-commit: 8c0c30642d47d17e2fa9d168b462d7ace18cc3d4
2021-09-08 08:36:05 -05:00
Wade Fife 79add58c25 fpga: tools: Add UHD_FPGA_DIR definition to synthesis
This adds a Verilog definition named `UHD_FPGA_DIR that corresponds to
the location of the UHD "fpga" directory. This allows you to include
files in your out-of-tree modules relative to the FPGA directory. For
example, you could include the library header file rfnoc_chdr_utils.vh
using the following:

`include `"`UHD_FPGA_DIR/usrp3/lib/rfnoc/core/rfnoc_chdr_utils.vh`"

Some simulators may not support `" outside of the context of a `define,
in which case you can do the following:

`define RFNOC_CHDR_UTILS_PATH \
  `"`UHD_FPGA_DIR/usrp3/lib/rfnoc/core/rfnoc_chdr_utils.vh`"
`include `RFNOC_CHDR_UTILS_PATH


Original-commit: 66267f515802ff3f965fd44e1f0d3097ada7484f
2021-09-08 08:36:05 -05:00
Wade Fife 869861c8cf fpga: Set default part for sim in setupenv.sh
This sets the ARCH and PART_ID environment variables so that the
selected part family is used for simulations by default. This can be
overridden by changing them in the Makefile for the testbench if a
testbench requires a specific part family. Prior to this change, the
default was always ARCH=kintex7, PART_ID=xc7k410t/ffg900/-2, which
required support for that part to be installed.


Original-commit: c176046dff4941bcec27b0b72e5a68264c4808e5
2021-08-30 08:20:10 -05:00
Wade Fife 3b15237d6b x300: Fix sfpp_io_core tuser width
Original-commit: 34b51b40f59412ae42e99246a60dd70de53ee180
2021-08-27 08:24:07 -05:00
Martin Braun 13633dd543 fpga: Fix Xilinx bitfile parser for Python 3
The script was previously only Python 2 compatible.

Python 2 support is now removed, so we don't maintain backwards
compatibility with Python 2.

This also fixes all linter warnings.


Original-commit: 6046e1a812ba2065d6ae13b4c4afdce8abc99d4f
2021-08-24 09:45:36 -05:00
michael-west 5983927439 sim: Update chdr_16sc_to_sc12 testbench
Modified to send 2 packets back to back at each packet size to test
output during sequential input packets.  Also fixed whitespace.

Signed-off-by: michael-west <michael.west@ettus.com>


Original-commit: 439770b964be45e6160cf99a0b1551fdd2002fa9
2021-08-10 15:19:32 -05:00
michael-west 946ff5574d fpga: Re-order error and data packets
Added delay to error packets so overrun error is back in-band.  Avoids
dropping good data packets in the case of an overrun.

Signed-off-by: michael-west <michael.west@ettus.com>


Original-commit: a69e6fcdc79dfa1ea48c99092b6edb9633b6fb24
2021-08-10 15:19:32 -05:00
michael-west 8332f5b161 fpga: Fix sc16 to sc12 converter
Re-wrote converter to remove clock cycle delay on i_tready when handling
residual output and fixed improper handling of tlast during residual
data processing.  Resolves some USB overflow issues when using sc12 data
type on B200 devices.

Signed-off-by: michael-west <michael.west@ettus.com>


Original-commit: 1fecf446e0358aa2b6a2d1f73a0daeac516435a0
2021-08-10 15:19:32 -05:00
Wade Fife f3085587fd fpga: rfnoc: Fix EOB loss in DUC
There were some rare corner cases where the EOB could get lost in the
DUC due to the dds_timed logic not always passing it through as it
should. This resulted in an underflow error message at the end of
transmission.

This commit also fixes an issue where part of the last packet
used a frequency shift of 0 instead of the requested frequency
shift, and an issue where the first few samples of a burst used the
wrong frequency shift value.

Part of the fix includes adding a TUSER port to dds_sin_cos_lut_only.
The TUSER port is built into the IP but was disabled. It is now
enabled and set to 1 bit wide. This has a very small effect on
resource usage and can be left unconnected when not needed.

The dds_freq_tune block was shared by the DUC and DDC. To avoid
affecting the DDC, a new version, dds_freq_tune_duc, is being
added for the DUC to use that has the necessary fixes.

The new dds_wrapper.v is a wrapper for the dds_sin_cos_lut_only IP.
This IP has the undesirable behavior that new inputs must be provided
to push previous outputs through the IP. This wrapper hides that
complexity by adding some logic to ensure all data gets pushed through
automatically. This logic uses the TUSER port on the IP.

Finally, a testbench for dds_timed was added.


Original-commit: 77975d108a704ce18ec52b4ee1764381b1893752
2021-08-08 14:59:26 -05:00
Wade Fife acc8486ac1 fpga: sim: Add PkgComplex, PkgMath, and PkgRandom
PkgComplex adds functions for doing complex arithmetic in SystemVerilog
simulation.

PkgMath provides mathematical operations and constants that aren't
built into SystemVerilog, such as a constant for pi and the function
round().

PkgRandom adds randomization functions beyond what standard Verilog
supports but that don't require any special licenses or simulators.


Original-commit: da4202e6f74796603072aa14544581604e81df02
2021-08-08 14:59:26 -05:00
Wade Fife 3a6961a3f4 fpga: lib: Clean up and document lib files
Clean-up and document axi_tag_time, dds_freq_tune, and axi_sync.


Original-commit: 8edd13e6eba61ef2bfd96c7dc88b2642decbaa7a
2021-08-08 14:59:26 -05:00
Wade Fife 3e94b6698e rfnoc: duc: Remove stale references to CORDIC
Updated some comments that still referenced the old CORDIC
implementation, which is no longer used.


Original-commit: 18e5bdfa100a40376147d1a497645345b2a938b1
2021-08-08 14:59:26 -05:00
michael-west 8164e94fbd N3xx: Fix White Rabbit
Reconnect the signals from the White Rabbit module to the TDC in the
FPGA.

Signed-off-by: michael-west <michael.west@ettus.com>


Original-commit: c0637bae1e4a0ddb996cf2b7eadfad22f782874b
2021-08-04 15:19:58 -05:00
Humberto Jimenez bb5bff88f6 fpga: x400: Remove stale information in register map
White Rabbit is not supported in X410, however the register map included an
incorrect reference to this unsupported feature.
This commit removes the WR reference from both the source and html files.


Original-commit: 7edd92dbcf2da1a1c0fabe02a97fdb6afdc89077
2021-07-28 10:08:47 -05:00
Wade Fife 95dfc4af53 fpga: x400: Fix x4xx_qsfp_wrapper testbench
Reorder dependencies so that sc_util_v1_0_vl_rfs.sv gets compiled
first when using ModelSim.


Original-commit: a9395823ed450aefa1c2d0c894dbcf976264365e
2021-06-22 16:24:54 -05:00
Wade Fife 29ac752be0 fpga: sim: Check for empty packet in clear_unused_bytes
Original-commit: 2615547a82bc4e06ff5fcb79c5c1efed76b058c7
2021-06-17 08:16:59 -05:00
Wade Fife 77a66a4de4 x400: sim: Move testbenches to sim folder
Original-commit: c0f9496d59947f8c9411b28d63d0c8e6244102a0
2021-06-17 08:16:59 -05:00
Wade Fife fcfc6bf387 fpga: Update testbenches to work in ModelSim
Original-commit: 0076076467303247c4e62e5824e5bf8ce79cbe66
2021-06-17 08:16:59 -05:00
Wade Fife 162632e7c1 fpga: x400: Add makefiles for RF testbenches
Original-commit: 319d8c6411f62a2150b21b38bfe5fd55366ee700
2021-06-17 08:16:59 -05:00
Wade Fife bdc67122b8 fpga: tools: Detect assertions in ModelSim simulation
This change allows assertion errors/failures in ModelSim to be
detected and causes ModelSim to return a non-zero value when such
an assertion error occurs. This allows the return value of ModelSim
to be used to determine whether or not the testbench passed.


Original-commit: 574146ec8909da367c3441189c2877a287892f7e
2021-06-17 08:16:59 -05:00
Wade Fife d37cc533a7 fpga: tools: Put SIM_SRCS at end of compile order
VHDL depends on the compile order. This commit changes the order so
that SIM_SRCS are compiled last with ModelSim to avoid issues with
dependencies.


Original-commit: b85b796cbc1f897a69ded1f3ecfba8ec92684c11
2021-06-17 08:16:59 -05:00
Wade Fife b5230b0256 fpga: tools: Support new FPGA types in viv_simulator.mak
This updates the existing PART_NAME generation used in simulation
makefiles to work with newer part families by calling
viv_gen_part_id.py to generate the part name needed by Vivado.


Original-commit: 648c70ae758ab1d15c7ec6cbe57672e8c27640cd
2021-06-17 08:16:59 -05:00
Wade Fife 81e8b63fb9 fpga: tools: Fix python2 reference in viv_ip_builder.mak
Original-commit: 244608187f824903ea2c8b003be1918d7dc21d5e
2021-06-17 08:16:59 -05:00
Wade Fife 99a4250c0b fpga: tools: Add modelsim.excludes
This is a list of testbenches that don't work with ModelSim and should
be excluded when running run_testbenches.py.


Original-commit: 6190eca14ec13db7456a059cbd69c93550aa45c7
2021-06-17 08:16:59 -05:00
Wade Fife 4baf8139c8 fpga: tools: Add modelsim.ini to ModelSim calls
This adds the MSIM_VIV_COMPLIBDIR environment variable to specify
a non-default location for the compilation libraries.

This also allows a modelsim.ini other than the one in the ModelSim
installation folder to be used. By default, the one in the simulation
libraries compilation directory will be used. This can be changed by
setting MSIM_MODELSIM_INI to the one you want to use, or set it to an
empty string to use the one in the ModelSim installation folder.


Original-commit: 08473776b28a949027ec8cf2596d8d1b438b979b
2021-06-17 08:16:59 -05:00
Wade Fife 1586d6c730 fpga: tools: Add features to run_testbenches.py
Run "make ip" in a separate step for each testbench. This allows some
testbenches to work better with ModelSim because it needs IP files that
aren't known until after the IP is generated.

Make run_testbenches.py more log friendly. Add a -l/--logged option for
when the output is being logged. In this case, we don't want to display
elapsed time every second.

Add "Begin TB Log:" and "End TB Log:" to the output to more easily tell
where the output from one testbench ends and another begins.

Use the basedir argument as the base directory in which to search for
testbenches so that a subset of the repo can be easily specified.


Original-commit: 5a4f0470919440819ab71f44fbc6f5f89a671e41
2021-06-17 08:16:59 -05:00
Wade Fife 69a7abba4d fpga: tools: Add ip target to simulation makefiles
Allow building of just the IP by running "make ip" in simulation
directories.


Original-commit: 4dc2b7010c0f3e41758b8192636ef7672caae0f7
2021-06-17 08:16:59 -05:00
Humberto Jimenez fd8c814f6f fpga: tools: Add X410 support for image packaging
Original-commit: 3398ab4cab84dfd950b4177cd3d48b692e50a628
2021-06-10 11:56:58 -05:00
a1d7c252c2 fpga: x400: zbx: Add support for ZBX CPLD
Co-authored-by: Cherwa Vang <cherwa.vang@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>


Original-commit: 99b841c75aa91709090cbf4046bf51b7ffb4f612
2021-06-10 11:56:58 -05:00
7e59e9516d fpga: x400: cpld: Add support for X410 motherboard CPLD
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Javier Valenzuela <javier.valenzuela@ni.com>


Original-commit: 7015f5ed2d495f3908773b7c7d74864d0cc3871a
2021-06-10 11:56:58 -05:00
61782b02d7 fpga: x400: Add support for X410 motherboard FPGA
Co-authored-by: Andrew Moch <Andrew.Moch@ni.com>
Co-authored-by: Daniel Jepson <daniel.jepson@ni.com>
Co-authored-by: Javier Valenzuela <javier.valenzuela@ni.com>
Co-authored-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
Co-authored-by: Kumaran Subramoniam <kumaran.subramoniam@ni.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Wade Fife <wade.fife@ettus.com>
Co-authored-by: Hector Rubio <hrubio@ni.com>


Original-commit: 6d3765605262016a80f71e36357f749ea35cbe5a
2021-06-10 11:56:58 -05:00
Wade Fife bfef20ea45 fpga: sim: Add slave_idle() to PkgAxiStreamBfm.sv
Original-commit: f706b89e6974e28ce76aadeeb06169becc86acba
2021-06-10 11:56:58 -05:00
Wade Fife a760762db3 fpga: lib: Update register comments in eth_regs.vh
Original-commit: 791bafd09a30a041a0c6f65dbf395cc4e567911f
2021-06-10 11:56:58 -05:00
Wade Fife 43e32abd11 fpga: Update rfnoc_image_core for all targets
Update rfnoc_image_core.v to take into account the new image_core_name
fields and version strings. Add new rfnoc_image_core.vh. Update YAML
where needed.


Original-commit: b0033158a4c520063540881451d8daac91e98714
2021-06-10 11:56:58 -05:00
Sam O'Brien 235703e806 fpga: tools: Fix part selection in setupenv
The script setupenv_base.sh, which is used to setup the development
environmnet in the open source toolchain, adds some functions to the
shell that are used to interact with vivado. Some of the functions were
looking in the wrong argument for the product name. This commit fixes
the bug.

In addition, supplying an incorrect part name returned a rather opaque
error message. This commit also fixes the error handling so that the
intended error message is displayed.

Signed-off-by: Sam O'Brien <sam.obrien@ni.com>


Original-commit: 471de61e4d9e53a038942f21f61d4b481b5f9853
2021-06-10 08:33:22 -05:00
Wade Fife 3b1d62928d fpga: Change RFNoC YAML version numbers to strings
Change version from a numeric to a string, in order to
differentiate between versions like "1.1" and "1.10".


Original-commit: ca21048bd2f832b20bb36763f76d46b861b697a5
2021-06-08 15:48:59 -05:00
Wade Fife 4188b6ccbc fpga: lib: Add modports to SV AXI-Stream blocks
Original-commit: da46dddbebab2ddb1f25f2f200431c2299b395f4
2021-06-03 11:26:54 -05:00
Wade Fife d6ca4f01fc fpga: lib: Add time_increment port to timekeeper
Adds a time_increment port for situations in which the parameter
TIME_INCREMENT can't be used. They offer the same behavior.


Original-commit: f9c97371048bfc69182187e6d8904a01efbe6d79
2021-06-03 11:26:54 -05:00
Wade Fife 3bc803026b fpga: lib: Pipeline ctrlport_timer
This pipelines ctrlport_timer to eliminate the long combinational path
caused by the time comparisons. This change also removes the
PRECISION_BITS parameter and converts it to a signal named
time_ignore_bits.


Original-commit: c6035320215f270d7658cfb6195a96a0b84d6aa7
2021-06-03 11:26:54 -05:00
Wade Fife ab09eb9b09 fpga: lib: Add clock domain comments to interfaces
Original-commit: c64258e09b221d0bfeb55e01085a20e37c5b62ba
2021-06-03 11:26:54 -05:00
Wade Fife b7bd308e9c fpga: lib: Add 2 to 1 gearbox module
Original-commit: 7f36cced81fb05d3cc107a0a0773fcdfc26f8d64
2021-06-03 11:26:54 -05:00
Wade Fife 7fda8365de fpga: lib: Add PHASE parameter to sim_clk_gen
Original-commit: f6f43baa0012a24ed5a8cdf49240e0cb4a1f7d04
2021-06-03 11:26:54 -05:00
Andrew Moch 8cb9bdd331 fpga: lib: Add AXI4 (full) interface
Add a SystemVerilog interface for connecting AXI4 ports, and an
associated header file with helper macros.


Original-commit: 04d29e85b0c0698e3de96b54fd3f6e04eb439f74
2021-06-03 11:26:54 -05:00
Andrew Moch d7acf31a38 fpga: lib: add pause support to ethernet xport
Original-commit: d099fc3b032250bcc70e4c24f78d5eb6508850e1
2021-06-03 11:26:54 -05:00
Wade Fife feb849051f fpga: lib: Add eth_ipv4_internal
This adds a generic version of eth_internal that allows you to specify
the CHDR width.


Original-commit: 30b522b268aed6e7b4bc1a556e88d2a4b2fe6f77
2021-06-03 11:26:54 -05:00
Humberto Jimenez 44d37a616f fpga: lib: Add zynquplus family to axi_bitq
Original-commit: 87574a7c322f9f1af954bcee5dd9f59929992a85
2021-06-03 11:26:54 -05:00
Wade Fife d6397f8f5e fpga: tools: Add ability to run commands before route
Original-commit: a617ff132fef4a28370d8b10b42463a459d44f6b
2021-06-03 10:22:04 -05:00
Wade Fife cfb4ba7f0b fpga: tools: Add ability to patch IP during generation
This adds the ability to call BUILD_VIVADO_IP, as before, followed by
REBUILD_VIVADO_IP_WITH_PATCH to patch a file generated by the IP and
then rebuild the IP with the patched file.


Original-commit: 78315eca698333ad4dc32818e24c7bf6a740c0cb
2021-06-03 10:22:04 -05:00
Humberto Jimenez ad6b7bdee8 fpga: tools: Add support for RFSoC
This commit includes the following changes to the tools:
- Change part definition in XCI and BD editors for the RFSoC family
- Resolve part name in Vivado IP management utilities with
  viv_gen_part_id.py


Original-commit: fba23eb42c91ca1bc1108b5ba50c1b567cb9b59d
2021-06-03 10:22:04 -05:00
Lars Amsel 7ec0561c4d fpga: lib: Minor cleanup of axi_lite.vh
Original-commit: 2a5f0ea13e6d7d00798d6547e1170ff85d4aa42a
2021-06-03 09:34:20 -05:00