fpga: sim: Add packet_info_equal function
Original-commit: 902c6f4488d5a75cf7a83cc1dc998d42703b0929
This commit is contained in:
committed by
Aaron Rossetto
parent
6a5a23a7a2
commit
859accafb3
@@ -150,6 +150,6 @@ package PkgChdrData;
|
||||
return 1;
|
||||
endfunction : item_equal
|
||||
|
||||
endclass
|
||||
endclass : ChdrData
|
||||
|
||||
endpackage : PkgChdrData
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -86,6 +86,7 @@ package PkgRfnocBlockCtrlBfm;
|
||||
export PkgCtrlIfaceBfm::CtrlIfaceBfm;
|
||||
export PkgChdrIfaceBfm::ChdrIfaceBfm;
|
||||
export PkgChdrIfaceBfm::packet_info_t;
|
||||
export PkgChdrIfaceBfm::packet_info_equal;
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user