diff --git a/sim/rfnoc/PkgAxiStreamBfm.sv b/sim/rfnoc/PkgAxiStreamBfm.sv index d1ca071..0470a3d 100644 --- a/sim/rfnoc/PkgAxiStreamBfm.sv +++ b/sim/rfnoc/PkgAxiStreamBfm.sv @@ -85,8 +85,11 @@ package PkgAxiStreamBfm; // Type Definitions //------------------ + // Round up width of TKEEP when TDATA is not a multiple of 8 + localparam int KEEP_WIDTH = (DATA_WIDTH+7)/8; + typedef logic [DATA_WIDTH-1:0] data_t; // Single bus TDATA word - typedef logic [DATA_WIDTH/8-1:0] keep_t; // Single TKEEP word + typedef logic [KEEP_WIDTH-1:0] keep_t; // Single TKEEP word typedef logic [USER_WIDTH-1:0] user_t; // Single TUSER word typedef AxiStreamPacket #(DATA_WIDTH, USER_WIDTH) AxisPacket_t; @@ -285,13 +288,15 @@ package PkgAxiStreamBfm; // Properties //------------ + localparam int KEEP_WIDTH = AxisPacket_t::KEEP_WIDTH; + // Default stall probability, as a percentage (0-100). local const int DEF_STALL_PROB = 38; // Default values to use for idle bus cycles local const AxisPacket_t::data_t IDLE_DATA = {DATA_WIDTH{1'bX}}; local const AxisPacket_t::user_t IDLE_USER = {(USER_WIDTH > 1 ? USER_WIDTH : 1){1'bX}}; - local const AxisPacket_t::keep_t IDLE_KEEP = {(DATA_WIDTH/8){1'bX}}; + local const AxisPacket_t::keep_t IDLE_KEEP = {KEEP_WIDTH{1'bX}}; // Virtual interfaces for master and slave connections to DUT local virtual AxiStreamIf #(DATA_WIDTH,USER_WIDTH,MAX_PACKET_BYTES,