Commit Graph
38 Commits
Author SHA1 Message Date
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
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
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 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
Martin Braun ec4fab0340 fpga: Remove Python2 support from build system
- 2to3 was used to convert the Python scripts, except where the tool
  choked and manual intervention was required
- All references to "python" where replaced with "python3"
- buffer() was replaced by memoryview()


Original-commit: ca68195b5d12c5410cfac8d459a0b0902c4c72c7
2021-01-04 13:28:36 -06:00
Aaron Rossetto 281efa74f1 fpga: Added AA image mappings to N320
Original-commit: 7e2fa6feb642b0970eafc68a0451ec4cde782106
2020-09-03 15:46:01 -05:00
Wade Fife 09461da1f5 fpga: rfnoc: Remove deprecated files
Original-commit: db0d2dddcc5d8e39e2b7843a326ad9392bbb4c3f
2020-08-23 13:52:26 -05:00
Andrew Moch 77cadca8a9 fpga: tools: RESOLVE_PATH checks for an empty path
Original-commit: ffdce1c3fc229579b9d30afe489d2749c0c956ed
2020-07-30 15:00:06 -05:00
Andrew Moch 05eb1bc2f1 fpga: lib: Add width agnostic version of Ethernet Interface
The rnfoc/xport section is refactored in System Verilog to allow the
following improvements
(1) CPU_W - Sets the size of the c2e and e2c pipes.  This can be run
    at a different clock rate than the main ethernet pipe
(2) CHDR_W - Sets the size of the v2e and e2v pipes. This can be run
    at a different clock rate than the main ethernet pipe
(3) ENET_W - Sets the size of the eth_tx and eth_rx pipes.

eth_interface_tb runs traffic from e2c,e2v,v2e,c2e simultaneously
against the original xport_sv implementation, and against the new
implementation with widths of 64/128/512. A chdr_management node
info request queries the port info of the node0 in the eth_interface.

eth_ifc_synth_test.sv can be compiled with the make xsim target to test
out the size of various configurations.


Original-commit: eed4988cc266a63370a4332351d02fadedde3a3b
2020-06-30 10:29:35 -05:00
Wade Fife 5f792ad48e fpga: tools: Highlight suppressible errors from vlint
Original-commit: 5244c06ae71589a08f337371d91798a6ac3d292b
2020-06-29 13:41:15 -05:00
Andrew Moch 23be04661f fpga: lib: Add synthesizable AXI4-Stream SV components
Components are connected together with AxiStreamIfc. Some features
include:
  (1) Add bytes to the start of a packet
  (2) Remove bytes from a packet
  (3) Wrappers for some older components
      a.  fifo - buffer but imediately pass a packet
      b.  packet_gate - buffer and hold till end of packet
      c.  width_conv - cross clock domains and change width of axi bus

The AxiStreamIf was moved from PkgAxiStreamBfm to its own file. It can
be used to connect to ports with continuous assignment.
AxiStreamPacketIf must be used procedurally but allows the following
new methods:
  - reached_packet_byte - notify when tdata contains a paritcular byte
  - get_packet_byte/get_packet_field - extract a byte or field from axi
  - put_packet_byte/put_packet_field - overwrite a byte or field onto axi


Original-commit: c3bca6c87700054c96320de119a58f6a688dbd5a
2020-06-25 14:44:04 -05:00
Wade Fife 7b1174ffd9 fpga: tools: Fix ModelSim return status
Original-commit: 05137529261bf9eae2a8b72cdf67e86a8ff96927
2020-06-18 15:26:07 -05:00
Max Köhler 2a8ec5df90 fpga: tools: remove temporary Xilinx directories for BD recreation
During recreation of block diagrams any RTL modules will be kept in
hidden directories within the build directory. Updates of the RTL
sources might not be taken into account. Solution is to remove Xilinx's
hidden project directories before calling vivado.


Original-commit: f17a5113e228ac1bc5312193eb8f687e127184a3
2020-06-15 13:54:35 -05:00
Wade Fife 523414b4ae fpga: tools: Allow multiple top modules with ModelSim
Original-commit: 5cda86b7e09be7865807700a58e41ec021bf3c74
2020-06-11 09:53:00 -05:00
Wade Fife 76a1cfa60e fpga: tools: Improve detection of setupenv sourcing
This change allows detection of attempting to execute setupenv.sh
rather than sourcing it, which is required.


Original-commit: 6faec1d4a14a1af52681aabf19c9040dcee772ff
2020-05-28 15:11:29 -05:00
Wade Fife d3615aefe0 fpga: tools: Improve native ModelSim support
This adds support for colored output and support for directories added
to the list of source files (for HLS support).


Original-commit: 5b3d66e5b7cedb7098de3e4dbbee70af04a3626e
2020-05-26 13:36:55 -05:00
Wade Fife 98463e99d0 fpga: tools: Add contents of directories for HDL source
For HLS builds, the output file names aren't known in advance. This
makes it difficult to write the Makefile to pull in the files and pass
them to the build tools. This change allows you to add a directory as
your HDL source so that all files in the directory will be pulled in by
the build process.


Original-commit: 90933d9b2faf392fd26f3f7ca32f73719614a40a
2020-05-26 13:36:55 -05:00
Martin Braun 17bafa621e fpga: tools: Remove uhd_image_builder
The image builder was replaced by rfnoc_image_builder, and has been
obsolete since then.


Original-commit: 676c3a37867f0e19476e9dc8495127bb3208a1a0
2020-05-18 17:57:38 -05:00
Humberto Jimenez f5a79baba7 fpga: tools: Fix HLS IP build with Cygwin
Original-commit: be252febd001feac093b36c987d276720e4244ab
2020-05-12 13:47:20 -05:00
Wade Fife 7e6e25df7a fpga: tools: Add -voptargs=+acc to ModelSim GUI
Add -voptargs=+acc to the default options when running vsim. This
option enables debug command access to objects in the design, which is
generally needed for debugging in the GUI.


Original-commit: eed2d2348cab7dc786673f0649373809d04027d5
2020-04-14 16:37:43 -05:00
Humberto Jimenez 9e946be598 fpga: tools: Option to check for full Vivado version
This commits enables the FPGA build infrastructure to require a very
specific Vivado version, all the way to the patch level.

Vivado typically has the following version format:
  Year.release.update_patch

This commit enables setupenv_base.sh to optionally look for the
environment variable VIVADO_VER_FULL, which should contain the
full Vivado version in the format specified above.
Vivado is directly used to retrieve the installed version, returning
an error if the requested version is not found.

Example in setupenv.sh (which calls setupenv_base.sh):

  VIVADO_VER=2019.1
  VIVADO_VER_FULL=2019.1.1_AR73068

The setupenv.sh script will setup Vivado 2019.1, but it will also
verify that both Update 1 and patch AR73068 are installed.


Original-commit: 932b7cbb040cef7fce0c83f81839722fd8ad5bdf
2020-04-14 10:43:51 -05:00
Paul Butler ce701301d0 fpga: tools: Add support for .sdc in Vivado
viv_utils.tcl will now read files with the .sdc suffix using the
read_xdc Vivado command. This is especially useful when I/O timing
constraints in the FPGA and CPLD need to depend on a common constant.


Original-commit: b47b1a467ee5796dbce359ff34c9d55a6acebc82
2020-04-02 08:13:35 -05:00
Wade Fife dcbc6a9c78 fpga: tools: Add default Vivado install location
Xilinx changed the default Vivado install location from /opt/Xilix to
/tools/Xilinx. This commit adds support for finding Vivado in either
the new location or the old location.


Original-commit: 156d714b8fb288100d242ea200ae1d1dcd6bcd57
2020-04-01 08:45:41 -05:00
Wade Fife 67e76118d6 fpga: tools: Add ModelSim to run_testbenches.py
This adds the "modelsim" simulator option to run_testbenches.py to allow
for regression testing of the native ModelSim simulation target.


Original-commit: 39d6007ca7e3b27e8230db6690faa7469ca62cb2
2020-03-23 18:01:53 -05:00
Wade Fife 795efc8224 fixup! fpga: tools: Add modelsim to make sim targets
Original-commit: 974b9d6140fe6d35ef6698d437e12beaf071ba63
2020-03-23 18:01:53 -05:00
Andrew Moch 09751b661e fpga: tools: Add modelsim to make sim targets
This adds a simulation make target that allows you to run ModelSim
natively rather than through Vivado.

Adds or modifies the following simulation make targets:
make vlint    - Brake up compilation to Verilog/SystemVerilog/VHDL
make modelsim - Depends on make vlint and invokes modelsim

Adds the following variables:
MODELSIM_ARGS - Added to invocation of ModelSim
SVLOG_ARGS    - Added to SystemVerilog invocation of vlog
VLOG_ARGS     - Added to Verilog invocation of vlog
VHDL_ARGS     - Added to VHDL invocation of vcom


Original-commit: b296b26053d4437b8ae97e3df415a3d041b7b51e
2020-03-20 10:34:59 -05:00
Humberto Jimenez 5367ec6006 fpga: tools: Ignore BD layout info for TCL-based BD
When using viv_modify_tcl_bd, two Vivado instances are open:
1. GUI-mode Vivado that opens a TCL-based BD for the user to edit.
2. Batch-mode Vivado that saves changes from (1) and rewrites the TCL
   source file.

During (2), the previous tool implementation was saving layout
information in the TCL source file. This layout info gets outdated
when the BD is reopened, because (1) regenerates the layout to provide
a clean BD diagram in the Vivado GUI.
Furthermore, each time the BD is open, the layout information will
vary due to Vivado's window size, thus creating untracked changes in
the source TCL file.

This commit removes the command option that requests Vivado to save
layout information.


Original-commit: feabc14cb5d5d26987d72b1a51638a83f8f39131
2020-03-12 10:33:24 -05:00
+18 6b67702ad7 Merge FPGA repository back into UHD repository
The FPGA codebase was removed from the UHD repository in 2014 to reduce
the size of the repository. However, over the last half-decade, the
split between the repositories has proven more burdensome than it has
been helpful. By merging the FPGA code back, it will be possible to
create atomic commits that touch both FPGA and UHD codebases. Continuous
integration testing is also simplified by merging the repositories,
because it was previously difficult to automatically derive the correct
UHD branch when testing a feature branch on the FPGA repository.

This commit also updates the license files and paths therein.

We are therefore merging the repositories again. Future development for
FPGA code will happen in the same repository as the UHD host code and
MPM code.

== Original Codebase and Rebasing ==

The original FPGA repository will be hosted for the foreseeable future
at its original local location: https://github.com/EttusResearch/fpga/

It can be used for bisecting, reference, and a more detailed history.

The final commit from said repository to be merged here is
05003794e2da61cabf64dd278c45685a7abad7ec. This commit is tagged as
v4.0.0.0-pre-uhd-merge.

If you have changes in the FPGA repository that you want to rebase onto
the UHD repository, simply run the following commands:

- Create a directory to store patches (this should be an empty
  directory):

    mkdir ~/patches

- Now make sure that your FPGA codebase is based on the same state as
  the code that was merged:

    cd src/fpga # Or wherever your FPGA code is stored
    git rebase v4.0.0.0-pre-uhd-merge

  Note: The rebase command may look slightly different depending on what
  exactly you're trying to rebase.

- Create a patch set for your changes versus v4.0.0.0-pre-uhd-merge:

    git format-patch v4.0.0.0-pre-uhd-merge -o ~/patches

  Note: Make sure that only patches are stored in your output directory.
  It should otherwise be empty. Make sure that you picked the correct
  range of commits, and only commits you wanted to rebase were exported
  as patch files.

- Go to the UHD repository and apply the patches:

    cd src/uhd # Or wherever your UHD repository is stored
    git am --directory fpga ~/patches/*
    rm -rf ~/patches # This is for cleanup

== Contributors ==

The following people have contributed mainly to these files (this list
is not complete):

Co-authored-by: Alex Williams <alex.williams@ni.com>
Co-authored-by: Andrej Rode <andrej.rode@ettus.com>
Co-authored-by: Ashish Chaudhari <ashish@ettus.com>
Co-authored-by: Ben Hilburn <ben.hilburn@ettus.com>
Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Co-authored-by: Daniel Jepson <daniel.jepson@ni.com>
Co-authored-by: Derek Kozel <derek.kozel@ettus.com>
Co-authored-by: EJ Kreinar <ej@he360.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Ian Buckley <ian.buckley@gmail.com>
Co-authored-by: Jörg Hofrichter <joerg.hofrichter@ni.com>
Co-authored-by: Jon Kiser <jon.kiser@ni.com>
Co-authored-by: Josh Blum <josh@joshknows.com>
Co-authored-by: Jonathon Pendlum <jonathan.pendlum@ettus.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Matt Ettus <matt@ettus.com>
Co-authored-by: Michael West <michael.west@ettus.com>
Co-authored-by: Moritz Fischer <moritz.fischer@ettus.com>
Co-authored-by: Nick Foster <nick@ettus.com>
Co-authored-by: Nicolas Cuervo <nicolas.cuervo@ettus.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Paul David <paul.david@ettus.com>
Co-authored-by: Ryan Marlow <ryan.marlow@ettus.com>
Co-authored-by: Sugandha Gupta <sugandha.gupta@ettus.com>
Co-authored-by: Sylvain Munaut <tnt@246tNt.com>
Co-authored-by: Trung Tran <trung.tran@ettus.com>
Co-authored-by: Vidush Vishwanath <vidush.vishwanath@ettus.com>
Co-authored-by: Wade Fife <wade.fife@ettus.com>


Original-commit: bafa9d95453387814ef25e6b6256ba8db2df612f
2020-01-28 09:35:36 -08:00