Package: axistream_bfm_pkg
- File: axistream_bfm_pkg.vhd
Description
========================================================================================================================
Constants
Name | Type | Value | Description |
---|---|---|---|
C_SCOPE | string | "AXISTREAM_BFM" | |
C_MAX_TUSER_BITS | positive | 8 | ======================================================================================================================== C_MAX_*_BITS : Maximum number of bits per data word supported by the BFM. These constant can be increased as needed. |
C_MAX_TSTRB_BITS | positive | 32 | Must be large enough for number of data bytes per transfer, C_MAX_TSTRB_BITS >= tdata/8 |
C_MAX_TID_BITS | positive | 8 | Recommended maximum in protocol specification (ARM IHI0051A) |
C_MAX_TDEST_BITS | positive | 4 | Recommended maximum in protocol specification (ARM IHI0051A) |
C_RANDOM | integer | -1 | |
C_MULTIPLE_RANDOM | integer | -2 | |
C_AXISTREAM_BFM_CONFIG_DEFAULT | t_axistream_bfm_config | ( max_wait_cycles => 100, max_wait_cycles_severity => ERROR, clock_period => -1 ns, clock_period_margin => 0 ns, clock_margin_severity => TB_ERROR, setup_time => -1 ns, hold_time => -1 ns, bfm_sync => SYNC_ON_CLOCK_ONLY, match_strictness => MATCH_EXACT, byte_endianness => LOWER_BYTE_LEFT, valid_low_at_word_num => 0, valid_low_multiple_random_prob => 0.5, valid_low_duration => 0, valid_low_max_random_duration => 5, check_packet_length => false, protocol_error_severity => ERROR, ready_low_at_word_num => 0, ready_low_multiple_random_prob => 0.5, ready_low_duration => 0, ready_low_max_random_duration => 5, ready_default_value => '0', id_for_bfm => ID_BFM ) |
Define the default value for the BFM config |
Types
Name | Type | Description |
---|---|---|
t_user_array | array(natural range <>) of std_logic_vector(C_MAX_TUSER_BITS-1 downto 0) | |
t_strb_array | array(natural range <>) of std_logic_vector(C_MAX_TSTRB_BITS-1 downto 0) | |
t_id_array | array(natural range <>) of std_logic_vector(C_MAX_TID_BITS-1 downto 0) | |
t_dest_array | array(natural range <>) of std_logic_vector(C_MAX_TDEST_BITS-1 downto 0) | |
t_axistream_if | ======================================================================================================================== Interface record for BFM signals | |
t_axistream_bfm_config | Configuration record to be assigned in the test harness. |
Functions
- init_axistream_if_signals ( is_master : boolean;
-- When true,
this BFM drives data signals data_width : natural;
user_width : natural;
id_width : natural;
dest_width : natural;
config : t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return t_axistream_if
Description
BFM procedures
- This function returns an AXI Stream interface with initialized signals.
- All input signals are initialized to 0
- All output signals are initialized to Z
- axistream_transmit_bytes ( constant data_array : in t_byte_array;
-- Byte in index 0 is transmitted first constant user_array : in t_user_array;
constant strb_array : in t_strb_array;
constant id_array : in t_id_array;
constant dest_array : in t_dest_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
AXIStream Transmit
Source: BFM
Sink: DUT
ยจ
DEPRECATE: procedure with data_array as t_byte_array will be removed in next major release
- axistream_transmit ( constant data_array : in t_slv_array;
-- Byte in index 0 is transmitted first constant user_array : in t_user_array;
constant strb_array : in t_strb_array;
constant id_array : in t_id_array;
constant dest_array : in t_dest_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
t_slv_array overload
- axistream_transmit ( constant data_array : in std_logic_vector;
constant user_array : in t_user_array;
constant strb_array : in t_strb_array;
constant id_array : in t_id_array;
constant dest_array : in t_dest_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
std_logic_vector overload
- axistream_transmit_bytes ( constant data_array : in t_byte_array;
constant user_array : in t_user_array;
constant strb_array : in t_strb_array;
constant id_array : in t_id_array;
constant dest_array : in t_dest_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if_tdata : inout std_logic_vector;
signal axistream_if_tkeep : inout std_logic_vector;
signal axistream_if_tuser : inout std_logic_vector;
signal axistream_if_tstrb : inout std_logic_vector;
signal axistream_if_tid : inout std_logic_vector;
signal axistream_if_tdest : inout std_logic_vector;
signal axistream_if_tvalid : inout std_logic;
signal axistream_if_tlast : inout std_logic;
signal axistream_if_tready : inout std_logic;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
Overloaded version without records
DEPRECATE: procedure with data_array as t_byte_array will be removed in next major release
- axistream_transmit ( constant data_array : in t_slv_array;
constant user_array : in t_user_array;
constant strb_array : in t_strb_array;
constant id_array : in t_id_array;
constant dest_array : in t_dest_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if_tdata : inout std_logic_vector;
signal axistream_if_tkeep : inout std_logic_vector;
signal axistream_if_tuser : inout std_logic_vector;
signal axistream_if_tstrb : inout std_logic_vector;
signal axistream_if_tid : inout std_logic_vector;
signal axistream_if_tdest : inout std_logic_vector;
signal axistream_if_tvalid : inout std_logic;
signal axistream_if_tlast : inout std_logic;
signal axistream_if_tready : inout std_logic;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
t_slv_array overload
- axistream_transmit ( constant data_array : in std_logic_vector;
constant user_array : in t_user_array;
constant strb_array : in t_strb_array;
constant id_array : in t_id_array;
constant dest_array : in t_dest_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if_tdata : inout std_logic_vector;
signal axistream_if_tkeep : inout std_logic_vector;
signal axistream_if_tuser : inout std_logic_vector;
signal axistream_if_tstrb : inout std_logic_vector;
signal axistream_if_tid : inout std_logic_vector;
signal axistream_if_tdest : inout std_logic_vector;
signal axistream_if_tvalid : inout std_logic;
signal axistream_if_tlast : inout std_logic;
signal axistream_if_tready : inout std_logic;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
std_logic_vector overload
- axistream_transmit_bytes ( constant data_array : in t_byte_array;
-- Byte in index 0 is transmitted first constant user_array : in t_user_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
Overload for default strb_array, id_array, dest_array
DEPRECATE: procedure with data_array as t_byte_array will be removed in next major release
- axistream_transmit ( constant data_array : in t_slv_array;
-- Byte in index 0 is transmitted first constant user_array : in t_user_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
t_slv_array overload
- axistream_transmit ( constant data_array : in std_logic_vector;
constant user_array : in t_user_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
std_logic_vector overload
- axistream_transmit_bytes ( constant data_array : in t_byte_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
Overload for default user_array, strb_array, id_array, dest_array
DEPRECATE: procedure with data_array as t_byte_array will be removed in next major release
- axistream_transmit ( constant data_array : in t_slv_array;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
t_slv_array overload
- axistream_transmit ( constant data_array : in std_logic_vector;
constant msg : in string := "";
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
std_logic_vector overload
- axistream_receive_bytes ( variable data_array : inout t_byte_array;
variable data_length : inout natural;
-- Number of bytes received variable user_array : inout t_user_array;
variable strb_array : inout t_strb_array;
variable id_array : inout t_id_array;
variable dest_array : inout t_dest_array;
constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT;
constant ext_proc_call: in string := "" -- External proc_call. Overwrite if called from another BFM procedure ) return ()
Description
AXIStream Receive
Source: DUT
Sink: BFM
DEPRECATE: procedure with data_array as t_byte_array will be removed in next major release
- axistream_receive ( variable data_array : inout t_slv_array;
variable data_length : inout natural;
-- Number of bytes received variable user_array : inout t_user_array;
variable strb_array : inout t_strb_array;
variable id_array : inout t_id_array;
variable dest_array : inout t_dest_array;
constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT;
constant ext_proc_call: in string := "" -- External proc_call. Overwrite if called from another BFM procedure ) return ()
- axistream_receive_bytes ( variable data_array : inout t_byte_array;
variable data_length : inout natural;
-- Number of bytes received variable user_array : inout t_user_array;
variable strb_array : inout t_strb_array;
variable id_array : inout t_id_array;
variable dest_array : inout t_dest_array;
constant msg : in string;
signal clk : in std_logic;
signal axistream_if_tdata : inout std_logic_vector;
signal axistream_if_tkeep : inout std_logic_vector;
signal axistream_if_tuser : inout std_logic_vector;
signal axistream_if_tstrb : inout std_logic_vector;
signal axistream_if_tid : inout std_logic_vector;
signal axistream_if_tdest : inout std_logic_vector;
signal axistream_if_tvalid : inout std_logic;
signal axistream_if_tlast : inout std_logic;
signal axistream_if_tready : inout std_logic;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT;
constant ext_proc_call : in string := "" -- External proc_call. Overwrite if called from another BFM procedure ) return ()
Description
Overloaded version without records
DEPRECATE: procedure with data_array as t_byte_array will be removed in next major release
- axistream_receive ( variable data_array : inout t_slv_array;
variable data_length : inout natural;
-- Number of bytes received variable user_array : inout t_user_array;
variable strb_array : inout t_strb_array;
variable id_array : inout t_id_array;
variable dest_array : inout t_dest_array;
constant msg : in string;
signal clk : in std_logic;
signal axistream_if_tdata : inout std_logic_vector;
signal axistream_if_tkeep : inout std_logic_vector;
signal axistream_if_tuser : inout std_logic_vector;
signal axistream_if_tstrb : inout std_logic_vector;
signal axistream_if_tid : inout std_logic_vector;
signal axistream_if_tdest : inout std_logic_vector;
signal axistream_if_tvalid : inout std_logic;
signal axistream_if_tlast : inout std_logic;
signal axistream_if_tready : inout std_logic;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT;
constant ext_proc_call : in string := "" -- External proc_call. Overwrite if called from another BFM procedure ) return ()
Description
Overloaded version without records
- axistream_expect_bytes ( constant exp_data_array : in t_byte_array;
-- Expected data constant exp_user_array : in t_user_array;
-- Expected tuser constant exp_strb_array : in t_strb_array;
-- Expected tstrb constant exp_id_array : in t_id_array;
-- Expected tid constant exp_dest_array : in t_dest_array;
-- Expected tdest constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
AXIStream Expect
DEPRECATE: procedure with data_array as t_byte_array will be removed in next major release
- axistream_expect ( constant exp_data_array : in t_slv_array;
-- Expected data constant exp_user_array : in t_user_array;
-- Expected tuser constant exp_strb_array : in t_strb_array;
-- Expected tstrb constant exp_id_array : in t_id_array;
-- Expected tid constant exp_dest_array : in t_dest_array;
-- Expected tdest constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
t_slv_array overload
- axistream_expect ( constant exp_data_array : in std_logic_vector;
-- Expected data constant exp_user_array : in t_user_array;
-- Expected tuser constant exp_strb_array : in t_strb_array;
-- Expected tstrb constant exp_id_array : in t_id_array;
-- Expected tid constant exp_dest_array : in t_dest_array;
-- Expected tdest constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
std_logic_vector overload
- axistream_expect_bytes ( constant exp_data_array : in t_byte_array;
-- Expected data constant exp_user_array : in t_user_array;
-- Expected tuser constant exp_strb_array : in t_strb_array;
-- Expected tstrb constant exp_id_array : in t_id_array;
-- Expected tid constant exp_dest_array : in t_dest_array;
-- Expected tdest constant msg : in string;
signal clk : in std_logic;
signal axistream_if_tdata : inout std_logic_vector;
signal axistream_if_tkeep : inout std_logic_vector;
signal axistream_if_tuser : inout std_logic_vector;
signal axistream_if_tstrb : inout std_logic_vector;
signal axistream_if_tid : inout std_logic_vector;
signal axistream_if_tdest : inout std_logic_vector;
signal axistream_if_tvalid : inout std_logic;
signal axistream_if_tlast : inout std_logic;
signal axistream_if_tready : inout std_logic;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
Overloaded version without records
DEPRECATE: procedure with exp_data_array as t_byte_array will be removed in next major release
- axistream_expect ( constant exp_data_array : in t_slv_array;
-- Expected data constant exp_user_array : in t_user_array;
-- Expected tuser constant exp_strb_array : in t_strb_array;
-- Expected tstrb constant exp_id_array : in t_id_array;
-- Expected tid constant exp_dest_array : in t_dest_array;
-- Expected tdest constant msg : in string;
signal clk : in std_logic;
signal axistream_if_tdata : inout std_logic_vector;
signal axistream_if_tkeep : inout std_logic_vector;
signal axistream_if_tuser : inout std_logic_vector;
signal axistream_if_tstrb : inout std_logic_vector;
signal axistream_if_tid : inout std_logic_vector;
signal axistream_if_tdest : inout std_logic_vector;
signal axistream_if_tvalid : inout std_logic;
signal axistream_if_tlast : inout std_logic;
signal axistream_if_tready : inout std_logic;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
t_slv_array overload
- axistream_expect ( constant exp_data_array : in std_logic_vector;
-- Expected data constant exp_user_array : in t_user_array;
-- Expected tuser constant exp_strb_array : in t_strb_array;
-- Expected tstrb constant exp_id_array : in t_id_array;
-- Expected tid constant exp_dest_array : in t_dest_array;
-- Expected tdest constant msg : in string;
signal clk : in std_logic;
signal axistream_if_tdata : inout std_logic_vector;
signal axistream_if_tkeep : inout std_logic_vector;
signal axistream_if_tuser : inout std_logic_vector;
signal axistream_if_tstrb : inout std_logic_vector;
signal axistream_if_tid : inout std_logic_vector;
signal axistream_if_tdest : inout std_logic_vector;
signal axistream_if_tvalid : inout std_logic;
signal axistream_if_tlast : inout std_logic;
signal axistream_if_tready : inout std_logic;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
std_logic_vector overload
- axistream_expect_bytes ( constant exp_data_array : in t_byte_array;
constant exp_user_array : in t_user_array;
constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
Overload for default strb_array, id_array, dest_array
DEPRECATE: procedure with exp_data_array as t_byte_array will be removed in next major release
- axistream_expect ( constant exp_data_array : in t_slv_array;
constant exp_user_array : in t_user_array;
constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
t_slv_array overload
- axistream_expect ( constant exp_data_array : in std_logic_vector;
constant exp_user_array : in t_user_array;
constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
std_logic_vector overload
- axistream_expect_bytes ( constant exp_data_array : in t_byte_array;
constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
Overload for default user_array, strb_array, id_array, dest_array
DEPRECATE: procedure with exp_data_array as t_byte_array will be removed in next major release
- axistream_expect ( constant exp_data_array : in t_slv_array;
constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
t_slv_array overload
- axistream_expect ( constant exp_data_array : in std_logic_vector;
constant msg : in string;
signal clk : in std_logic;
signal axistream_if : inout t_axistream_if;
constant alert_level : in t_alert_level := error;
constant scope : in string := C_SCOPE;
constant msg_id_panel : in t_msg_id_panel := shared_msg_id_panel;
constant config : in t_axistream_bfm_config := C_AXISTREAM_BFM_CONFIG_DEFAULT ) return ()
Description
std_logic_vector overload