aboutsummaryrefslogtreecommitdiffstats
path: root/fpga/usrp3/sim/rfnoc
diff options
context:
space:
mode:
authorWade Fife <wade.fife@ettus.com>2020-05-14 09:08:21 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-05-28 15:04:05 -0500
commit902c6f4488d5a75cf7a83cc1dc998d42703b0929 (patch)
tree7e56abbd213d187abb68b4de8b93210a6a170a6f /fpga/usrp3/sim/rfnoc
parentf9fbb324f05a7771c135fb033d91474064e7bab3 (diff)
downloaduhd-902c6f4488d5a75cf7a83cc1dc998d42703b0929.tar.gz
uhd-902c6f4488d5a75cf7a83cc1dc998d42703b0929.tar.bz2
uhd-902c6f4488d5a75cf7a83cc1dc998d42703b0929.zip
fpga: sim: Add packet_info_equal function
Diffstat (limited to 'fpga/usrp3/sim/rfnoc')
-rw-r--r--fpga/usrp3/sim/rfnoc/PkgChdrData.sv2
-rw-r--r--fpga/usrp3/sim/rfnoc/PkgChdrIfaceBfm.sv13
-rw-r--r--fpga/usrp3/sim/rfnoc/PkgRfnocBlockCtrlBfm.sv1
3 files changed, 15 insertions, 1 deletions
diff --git a/fpga/usrp3/sim/rfnoc/PkgChdrData.sv b/fpga/usrp3/sim/rfnoc/PkgChdrData.sv
index a849346d6..f5ff0ed85 100644
--- a/fpga/usrp3/sim/rfnoc/PkgChdrData.sv
+++ b/fpga/usrp3/sim/rfnoc/PkgChdrData.sv
@@ -150,6 +150,6 @@ package PkgChdrData;
return 1;
endfunction : item_equal
- endclass
+ endclass : ChdrData
endpackage : PkgChdrData
diff --git a/fpga/usrp3/sim/rfnoc/PkgChdrIfaceBfm.sv b/fpga/usrp3/sim/rfnoc/PkgChdrIfaceBfm.sv
index 6d6dd9a5b..725888272 100644
--- a/fpga/usrp3/sim/rfnoc/PkgChdrIfaceBfm.sv
+++ b/fpga/usrp3/sim/rfnoc/PkgChdrIfaceBfm.sv
@@ -24,6 +24,19 @@ package PkgChdrIfaceBfm;
} packet_info_t;
+ // Return 1 if the packet info is equivalent, 0 otherwise.
+ function automatic bit packet_info_equal(const ref packet_info_t a, b);
+ // If there's no time then the timestamp value doesn't matter, so make them
+ // the same for comparison.
+ if (!a.has_time) begin
+ packet_info_t a_copy = a;
+ a_copy.timestamp = b.timestamp;
+ return a_copy == b;
+ end
+ return a == b;
+ endfunction : packet_info_equal
+
+
class ChdrIfaceBfm #(CHDR_W = 64, ITEM_W = 32) extends ChdrBfm #(CHDR_W);
// Redefine the ChdrPacket_t and chdr_word_t data types from ChdrBfm due to
diff --git a/fpga/usrp3/sim/rfnoc/PkgRfnocBlockCtrlBfm.sv b/fpga/usrp3/sim/rfnoc/PkgRfnocBlockCtrlBfm.sv
index 4c8cc2ff6..2e1b6a6b2 100644
--- a/fpga/usrp3/sim/rfnoc/PkgRfnocBlockCtrlBfm.sv
+++ b/fpga/usrp3/sim/rfnoc/PkgRfnocBlockCtrlBfm.sv
@@ -86,6 +86,7 @@ package PkgRfnocBlockCtrlBfm;
export PkgCtrlIfaceBfm::CtrlIfaceBfm;
export PkgChdrIfaceBfm::ChdrIfaceBfm;
export PkgChdrIfaceBfm::packet_info_t;
+ export PkgChdrIfaceBfm::packet_info_equal;
//---------------------------------------------------------------------------