axi4stream_transaction

The axi4stream_transaction class is the base class of AXI4STREAM Verification Component.It inherits all the methods of xil_sequence_item.In this transaction, it has cmd_id,dest,id,data,user,strb,keep,last, signal_set etc which can be accessed by set/get_x APIs.

Functions
new

function new( |
input | string | name | = | "unnamed_axi4stream_transaction",
| xil_axi4stream_sigset_t | set | = | XIL_AXI4STREAM_SIGSET_READY | XIL_AXI4STREAM_SIGSET_DATA,
| xil_axi4stream_uint | dw | = | 32,
| xil_axi4stream_uint | uw | = | 32,
| xil_axi4stream_uint | bpb | = | 8,
| xil_axi4stream_uint | idw | = | 2,
| xil_axi4stream_uint | destw | = | 4
| );

Constructor to create a new axi4stream_transaction. ~name~ is the name of the instance.

copy

function void copy( |
axi4stream_transaction | rhs
| );

Copies the contents of the input transaction to the current transaction

my_clone
virtual function axi4stream_transaction my_clone ();

Returns a clones of the contents of the transaction.

get_id
virtual function xil_axi4stream_uint get_id ();

Returns the value of TID of the transaction.

set_id

virtual function void set_id ( |
input | xil_axi4stream_uint | new_id
| );

Sets the value of TID of the transaction.

get_dest
function xil_axi4stream_uint get_dest ();

Returns the value of TDEST of the transaction.

set_dest

virtual function void set_dest ( |
input | xil_axi4stream_uint | new_dest
| );

Sets the value of TDEST of the transaction.

get_last
function bit get_last ();

Returns the value of TLAST of the transaction. This transaction will return 1 when the TLAST signal is not enabled.

set_last

virtual function void set_last ( |
input | bit | new_last
| );

Sets the value of TLAST of the transaction.

get_strb

function void get_strb( |
inout xil_axi4stream_strb | ext_strb | []
| );

Returns the unpacked version of TSTRB of the transaction.

set_strb

virtual function void set_strb ( |
input xil_axi4stream_strb | updated | []
| );

Sets the value of TSTRB of the transaction using an unpacked array.

get_strb_beat
function xil_axi4stream_strb_beat get_strb_beat();

Returns the beat type version of TSTRB of the transaction.

set_strb_beat

virtual function void set_strb_beat ( |
input | xil_axi4stream_strb_beat | updated
| );

Sets the value of TSTRB of the transaction using a beat type.

get_keep

function void get_keep( |
inout xil_axi4stream_strb | ext_keep | []
| );

Returns the unpacked version of TKEEP of the transaction.

set_keep

virtual function void set_keep ( |
input xil_axi4stream_strb | updated | []
| );

Sets the value of TKEEP of the transaction using an unpacked array.

get_keep_beat
function xil_axi4stream_strb_beat get_keep_beat();

Returns the beat type version of TKEEP of the transaction. It is different from get_keep since get_keep returns unpacked version of TKEEP.

set_keep_beat

virtual function void set_keep_beat ( |
input | xil_axi4stream_strb_beat | updated
| );

Sets the value of TKEEP of the transaction using a beat type. It is different from set_keep since set_keep using unpacked version of array.

get_data

virtual function void get_data( |
inout xil_axi4stream_data_byte | ext_data | []
| );

Returns the unpacked version of TDATA of the transaction.

set_data

virtual function void set_data( |
input | xil_axi4stream_data_byte | updated[]
| );

Sets the value of TDATA of the transaction using an unpacked array.

get_data_beat
function xil_axi4stream_data_beat get_data_beat();

Returns the beat type version of TDATA of the transaction.

set_data_beat

function void set_data_beat( |
input | xil_axi4stream_data_beat | updated
| );

Sets the value of TDATA of the transaction using a beat type.

set_user_beat

virtual function void set_user_beat( |
input | xil_axi4stream_user_beat | updated
| );

Sets the value of TUSER of the transaction using a beat type.

get_user_beat
virtual function xil_axi4stream_user_beat get_user_beat();

Returns the beat type version of TUSER of the transaction.

get_signal_set
virtual function xil_axi4stream_sigset_t get_signal_set();

Returns the current settings of the interface.

set_signal_set

virtual function void set_signal_set( |
input | xil_axi4stream_sigset_t | updated
| );

Sets the value of signal set. This value MUST match the interface properties.

get_data_width
virtual function xil_axi4stream_uint get_data_width();

Returns the DATA width of the transaction.

resize_payload_arrays
virtual function void resize_payload_arrays();

Creates/Adjusts the different internal data structures.

set_data_width

virtual function void set_data_width( |
input | xil_axi4stream_uint | updated
| );

Sets the value of DATA width for the transaction.

get_dest_width
virtual function xil_axi4stream_uint get_dest_width();

Returns the DEST width of the transaction.

set_dest_width

virtual function void set_dest_width( |
input | xil_axi4stream_uint | updated
| );

Sets the value of DEST width for the transaction.

get_id_width
virtual function xil_axi4stream_uint get_id_width();

Returns the ID width of the transaction.

set_id_width

virtual function void set_id_width( |
input | xil_axi4stream_uint | updated
| );

Sets the value of ID width for the transaction.

get_user_width
virtual function xil_axi4stream_uint get_user_width();

Returns the USER width of the transaction.

set_user_width

virtual function void set_user_width( |
input | xil_axi4stream_uint | updated
| );

Sets the value of USER width for the transaction.

set_user_bits_per_byte

virtual function void set_user_bits_per_byte( |
input | xil_axi4stream_uint | updated
| );

Sets the value of the user bits per byte for the transaction.

get_user_bits_per_byte
virtual function xil_axi4stream_uint get_user_bits_per_byte();

Returns the value of the user bits per byte of the transaction.

set_driver_return_item
virtual function void set_driver_return_item ();

Sets the driver_return_item property to XIL_AXI4STREAM_AT_ACCEPT_RETURN. driver_return_item can be XIL_AXI4STREAM_NO_RETURN,XIL_AXI4STREAM_AT_ASSERT_RETURN,XIL_AXI4STREAM_AT_ACCEPT_RETURN. please refer xil_axi4stream_driver_return_policy_t for more details.

set_driver_return_item_policy

virtual function void set_driver_return_item_policy ( |
input | xil_axi4stream_driver_return_policy_t | set
| );

Sets the driver_return_item property of the transaction. Driver return item policy can be XIL_AXI4STREAM_NO_RETURN,XIL_AXI4STREAM_AT_ASSERT_RETURN, XIL_AXI4STREAM_AT_ACCEPT_RETURN. please refer xil_axi4stream_driver_return_policy_t for more details.

get_driver_return_item_policy
virtual function xil_axi4stream_driver_return_policy_t get_driver_return_item_policy ();

Returns the value of driver_return_item property of the transaction. Driver return item policy can be XIL_AXI4STREAM_NO_RETURN,XIL_AXI4STREAM_AT_ASSERT_RETURN, XIL_AXI4STREAM_AT_ACCEPT_RETURN. please refer xil_axi4stream_driver_return_policy_t for more details.

clr_driver_return_item
virtual function void clr_driver_return_item ();

Set driver return item policy to be XIL_AXI4STREAM_NO_RETURN. Driver return item policy can be XIL_AXI4STREAM_NO_RETURN,XIL_AXI4STREAM_AT_ASSERT_RETURN,XIL_AXI4STREAM_AT_ACCEPT_RETURN. please refer xil_axi4stream_driver_return_policy_t for more details.

get_cmd_id
virtual function xil_axi4stream_uint get_cmd_id();

Returns cmd_id of the transaction

set_xfer_alignment

virtual function void set_xfer_alignment ( |
input | xil_axi4stream_xfer_alignment_t | set
| );

Sets xfer_alignment of the transaction. axi4stream transaction has four types of transfer alignment XIL_AXI4STREAM_XFER_ALL_SET, XIL_AXI4STREAM_XFER_ALL_NULLBYTE,XIL_AXI4STREAM_XFER_ALL_POSBYTE, XIL_AXI4STREAM_XFER_RANDOM. please refer xil_axi4stream_xfer_alignment_t for more details.

get_xfer_alignment
virtual function xil_axi4stream_xfer_alignment_t get_xfer_alignment ();

Returns xfer_alignment of the transaction. axi4stream transaction has four types of transfer alignment XIL_AXI4STREAM_XFER_ALL_SET, XIL_AXI4STREAM_XFER_ALL_NULLBYTE,XIL_AXI4STREAM_XFER_ALL_POSBYTE, XIL_AXI4STREAM_XFER_RANDOM. please refer xil_axi4stream_xfer_alignment_t for more details.

convert2string
virtual function string convert2string();

Returns a form of string for axi4stream transaction which includes SIGNAL_SET, DEST, ID, USER, LAST,PAYLOAD(data, strb, keep) user bits.

do_compare

virtual function bit do_compare ( |
xil_object | rhs
| );

Compare current transaction with rhs, it includes comparison of signal_set and all the information of a transaction which are keep, strb, data, user, last, id, dest etc .

get_delay
virtual function xil_axi4stream_uint get_delay();

Returns delay of the transaction This delay is from when the driver get the transaction item till it starts to drive data onto the data bus.

set_delay

virtual function void set_delay( |
input | xil_axi4stream_uint | updated
| );

Sets delay of the transaction This delay is from when the driver get the transaction item till it starts to drive data onto the data bus.

get_delay_policy
virtual function xil_axi4stream_xfer_delay_insertion_policy_t get_delay_policy();

Returns delay_policy of the transaction

set_delay_policy

virtual function void set_delay_policy( |
input | xil_axi4stream_xfer_delay_insertion_policy_t | updated
| );

This function is to set delay_policy of the axi4stream_transaction. Delay policy can be XIL_AXI4STREAM_DELAY_INSERTION_ALWAYS or XIL_AXI4STREAM_DELAY_INSERTION_FROM_IDLE. Please refer xil_axi4stream_xfer_delay_insertion_policy_t for delay policy explanation.

get_delay_range

function void get_delay_range( |
output | xil_axi4stream_uint | min,
output | xil_axi4stream_uint | max
| );

Returns min_delay and max_delay of the transaction

set_delay_range

virtual function void set_delay_range( |
input | xil_axi4stream_uint | min,
input | xil_axi4stream_uint | max
| );

There is a delay between the driver get the transaction and it starts to drive the data onto data bus. This delay is randomized in the range of min_delay and max_delay. set_delay_range is to set min_delay and max_delay of the axi4stream_transaction which late is used to generate delay when randomization of axi4stream_transaction is being called.

set_strb_array_all_disabled
virtual function void set_strb_array_all_disabled();

Sets all strobe bits to 0 when HAS_STRB is on

set_strb_array_all_enabled
virtual function void set_strb_array_all_enabled();

Sets all strobe bits to 1 when HAS_STRB is on

set_keep_array_all_disabled
virtual function void set_keep_array_all_disabled();

Sets all keep bits to 0 when HAS_KEEP is on

set_keep_array_all_enabled
virtual function void set_keep_array_all_enabled();

Sets all keep bits to 1 when HAS_KEEP is on

post_randomize
function void post_randomize();

Sets final value of strobe of the transaction