Commit Graph
31 Commits
Author SHA1 Message Date
Wade Fife 894e5aa9a4 fpga: sim: Fix cast in PkgRandom
Original-commit: c6561226d819b75b18fffad283ec59d58109a951
2024-05-16 09:30:05 -05:00
Wade Fife 70ab61e202 fpga: sim: Fix test_status indices in PkgTestExec
Original-commit: 19a6ad3073647b0a7d98bded0a7d23133dc97945
2024-05-16 09:29:37 -05:00
Wade Fife df4953a60d fpga: sim: Fix typo in clk_wait_f
Original-commit: cadc906649f438d425926f7fd629857d439c6dca
2022-12-19 08:57:18 -06:00
Wade Fife c09489b6b0 fpga: sim: Support unused tkeep in AxiStreamPacket::dump_bytes()
Original-commit: 0af84329a7d0f8c97131e14a522a2e0939dbb951
2022-08-29 17:01:45 -05:00
Humberto Jimenez fb83fe3830 fpga: sim: Workaround Vivado bug in ChdrIfaceBfm_tb
Original-commit: 9e4de0d0b7a1a35a5b3220a605c329e60f8b5e83
2022-08-25 13:55:30 -05:00
Wade Fife 3fc345d3ae fpga: sim: Update struct enum initialization
In Vivado 2021.1, it is no longer allowed to use "default: 0" to
initialize an enum within a packed struct. So we must initalize enum
data members explicitly now.


Original-commit: 8007b6b4dff5b64d476b2e3ccb68a777c2f02c8b
2022-08-25 13:55:30 -05:00
Wade Fife 287659ddeb fpga: Fix first arg in calls to $fatal()
This fixes warnings regarding the first argument to $fatal(), which is
supposed to be a number indicating what diagnostics to display. 1
corresponds to "Prints simulation time and location".


Original-commit: 58763bdfdaa276155ec6b79a3e5420de17172c7a
2022-06-28 10:34:18 -05:00
Martin Braun f645d3d613 fpga: Remove noc_shell_regs.vh and sim_rfnoc_lib.svh
Both files are a UHD 3 remnant and potentially confusing for UHD
4 codebase readers.


Original-commit: b29af0ea0d340f37628f65e7b739fa1865d212a9
2022-01-25 14:09:15 -07: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 29ac752be0 fpga: sim: Check for empty packet in clear_unused_bytes
Original-commit: 2615547a82bc4e06ff5fcb79c5c1efed76b058c7
2021-06-17 08:16:59 -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 7fda8365de fpga: lib: Add PHASE parameter to sim_clk_gen
Original-commit: f6f43baa0012a24ed5a8cdf49240e0cb4a1f7d04
2021-06-03 11:26:54 -05:00
Wade Fife 15d9d740ef fpga: sim: Fix stream command and status models
This updates PkgChdrBfm to correct some errors when modeling stream
command and stream status packets.

- Fix behavior when CHDR_W = 512
- Fix assertions in read_ctrl()


Original-commit: ccf5d1e0a06bf8d46d7bf6dc33a17e3228a1bff4
2020-08-31 08:16:43 -05:00
Andrew Moch d5bbce58cb fpga: sim: Update PkgEthernet
Consolidated calcuation of last_tkeep and tkeep_last. Changed error
checking to support unwrinkling tkeep/trailing changes in 100G
etherent and support for testing packet dropping on backup.


Original-commit: 473b0f5abe882ca316a7fe1a59234676940ef26b
2020-07-31 13:22:29 -05:00
Andrew Moch 02e4ef3318 fpga: sim: Fix AxiLiteBfm
AxiLiteBfm incorrectly included stb argument on rd() and printed actual
response instead of expected in debug message.


Original-commit: cb7e9e24578ccf4db79878a7437a6a85ad315ee2
2020-07-31 13:10:00 -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
Andrew Moch e008853357 fpga: lib: Add interface and model for AXI4-Lite
(1) Synthesizable AxiLiteIf
(2) Simulation model for AxiLite contains an AxiLiteTransaction class
    and an AxiLiteBfm class.

Important Methods
  a. wr - performs non-blocking write and checks for expected response
  b. wr_block - performs a blocking write and provides response
  c. rd - performs a non-blocking read and checks for expected response
  d. rd_block - persforms a blocking read  and provides response

The model allows parallel execution of reads and writes, but enforces
rd and write ordering when using the above methods.  When transactions
are posted directly, ordering is not guaranteed, and reads and writes
are put on the interface immediately.


Original-commit: afee1888dd7c2d9d95e537f505ce7ab36252763a
2020-06-24 09:56:31 -05:00
Andrew Moch 55881469ac fpga: rfnoc: Add support for 512-bit CHDR widths
This fixes the rfnoc_null_src_sink, chdr_crossbar_nxn, and
chdr_stream_endpoint blocks so that wider CHDR widths are properly
supported. It also updates PkgChdrBfm to able to properly test these
blocks. The testbenches have been updated to test both 64 and 512-bit
widths.


Original-commit: 3af8dcaacfa4bf36dcae3bdbf0b353385b7063c6
2020-06-18 09:09:34 -05:00
Wade Fife 859accafb3 fpga: sim: Add packet_info_equal function
Original-commit: 902c6f4488d5a75cf7a83cc1dc998d42703b0929
2020-05-28 15:04:05 -05:00
Wade Fife 1de388c61b fpga: sim: Don't affect packet arguments in chdr_to_axis
This updates the chdr_to_axis method so that it doesn't change the
input chdr_packet object. This is useful in case there are other
references to that object in use. Not modifying the object means that
you don't always have to copy the object before passing it to this
method.


Original-commit: 259506c4993834d9ef8ccb48635623552b075237
2020-05-04 23:40:25 -05:00
Wade Fife 1563d0e5af fpga: sim: Fix get_slave_data_bfm method
Original-commit: d1e0c6a6c46eb24d23e80cdcfe89b21c8fe4573c
2020-05-04 23:40:25 -05:00
Wade Fife 9e1d9c46d1 fpga: sim: Export return types in PkgRfnocBlockCtrlBfm
Original-commit: c45ea14e41adfd97f526f19070d97ae28e3ee35e
2020-05-04 23:40:25 -05:00
Wade Fife 2f4fe4fdbd fpga: sim: Export ChdrPacket in PkgRfnoBlockCtrlBfm
Original-commit: 975dbdf01f351cd05364586e326e7d43c28c6e6e
2020-04-14 16:37:43 -05:00
Wade Fife 72f619c429 sim: Rename class typedefs
For example, the ChdrPacket typedef is being renamed from ChdrPacket to
ChdrPacket_t. This allows the code to distinguish between the
unparameterized class and the already parameterized class. This isn't
strictly necessary, but it makes some Vivado 2019.1 bugs easier to work
around. It also makes the code slightly less ambiguous.


Original-commit: df27e9fa05d2d767f69182763852f6803c5b2a34
2020-03-09 13:43:05 -05:00
Wade Fife 2711d7f618 sim: Add ChdrIfaceBfm test
Original-commit: 6f42ab7c1c962bfc425b6790fe41b2c14769e561
2020-03-09 13:43:05 -05:00
Wade Fife faa360a0f9 sim: Add item support to RFNoC simulation
This adds variants of the send and recv methods in RfnocBlockCtrlBfm
and ChdrIfaceBfm that input/output items instead of CHDR words.


Original-commit: aebcaea5eb4e28c5c2a1c78b5e8dd42e5d1247b6
2020-03-09 13:43:05 -05:00
Wade Fife 14dc3950cf sim: Parameterize chdr_word_t data type
This replaces chdr_word_t, which was a statically defined 64-bit data
type, with a paramaterizable data type that matches the defined CHDR_W.
Code that formerly referenced the chdr_word_t data type can now define
the data type for their desired CHDR_W and ITEM_W as follows:

  // Define the CHDR word and item/sample data types
  typedef ChdrData #(CHDR_W, ITEM_W)::chdr_word_t chdr_word_t;
  typedef ChdrData #(CHDR_W, ITEM_W)::item_t      item_t;

ITEM_W is optional when defining chdr_word_t if items are not
needed. Static methods in the ChdrData class also provide the ability to
convert between CHDR words and data items. For example:

  // Convert CHDR data buffer to a buffer of samples
  samples = ChdrData#(CHDR_W, ITEM_W)::chdr_to_item(data);


Original-commit: fc895feacb8dde3b02c9a4eccb4b4f4a654f2881
2020-03-09 13:43:05 -05:00
Wade Fife 1db22ce4ec sim: Split PkgRfnocBlockCtrlBfm into separate packages
Original-commit: 369594ef16d7b2d519940269d2af035cfe648f50
2020-03-09 13:43:05 -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
Martin Braun 74893643ca Removed copy of FPGA source files.
Original-commit: fd3e84941de463fa1a7ebab0a69515b4bf2614cd
2014-10-07 11:25:20 +02:00
Ben Hilburn fbbc991a7d Pushing the bulk of UHD-3.7.0 code.
Original-commit: ff1546f8137f7f92bb250f685561b0c34cc0e053
2014-02-14 12:05:07 -08:00