fpga: sim: Add packet_info_equal function

Original-commit: 902c6f4488d5a75cf7a83cc1dc998d42703b0929
This commit is contained in:
Wade Fife
2020-05-28 15:04:05 -05:00
committed by Aaron Rossetto
parent 6a5a23a7a2
commit 859accafb3
3 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -150,6 +150,6 @@ package PkgChdrData;
return 1;
endfunction : item_equal
endclass
endclass : ChdrData
endpackage : PkgChdrData
+13
View File
@@ -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
+1
View File
@@ -86,6 +86,7 @@ package PkgRfnocBlockCtrlBfm;
export PkgCtrlIfaceBfm::CtrlIfaceBfm;
export PkgChdrIfaceBfm::ChdrIfaceBfm;
export PkgChdrIfaceBfm::packet_info_t;
export PkgChdrIfaceBfm::packet_info_equal;
//---------------------------------------------------------------------------