The axi_transaction class is the base class of AXI protocol. It inherits all the methods of xil_sequence_item.
function new( |
| ); |
Constructor to create a new axi_transaction. ~name~ is the name of the instance.
function void copy( |
| ); |
Copies the contents of the input transaction to the current transaction
Returns the name of <the axi_transaction>. AXI_TRANSACTION
Copys the current transaction and returns a handle to the new transaction.
virtual function void set_protocol( |
| ); |
Sets the protocol type of the transaction. update = 0 => protocol = XIL_VERSION_AXI4; update = 1 => protocol = XIL_VERSION_AXI3; update = 2 => protocol = XIL_VERSION_LITE;
Returns the current state of adjust_response_delay_enabled of the transaction.
virtual function void set_adjust_response_delay_enabled( |
| ); |
Sets the value of adjust_response_delay_enabled of the transaction.
Returns the current state of adjust_addr_delay_enabled of the transaction.
virtual function void set_adjust_addr_delay_enabled( |
| ); |
Sets the value of adjust_addr_delay_enabled of the transaction.
Returns the current state of adjust_data_beat_delay_enabled of the transaction.
virtual function void set_adjust_data_beat_delay_enabled( |
| ); |
Sets the value of adjust_data_beat_delay_enabled of the transaction.
virtual function void set_supports_narrow( |
| ); |
Sets the value of supports_narrow of the transaction. Internal use only
virtual function void set_has_burst( |
| ); |
Sets the value of has_burst of the transaction. Internal use only
virtual function void set_has_lock( |
| ); |
Sets the value of has_lock of the transaction. Internal use only
virtual function void set_has_cache( |
| ); |
Sets the value of has_cache of the transaction.Internal use only
virtual function void set_has_region( |
| ); |
Sets the value of has_region of the transaction.Internal use only
virtual function void set_has_prot( |
| ); |
Sets the value of has_prot of the transaction.Internal use only
virtual function void set_has_qos( |
| ); |
Sets the value of has_qos of the transaction. Internal use only
virtual function void set_has_wstrb( |
| ); |
Sets the value of has_wstrb of the transaction. Internal use only
virtual function void set_has_bresp( |
| ); |
Sets the value of has_bresp of the transaction. Internal use only
virtual function void set_has_rresp( |
| ); |
Sets the value of has_rresp of the transaction. Internal use only
Returns the value of supports_narrow of the transaction.
Returns the value of has_burst of the transaction.
Returns the value of has_lock of the transaction.
Returns the value of has_cache of the transaction.
Returns the value of has_region of the transaction.
Returns the value of has_prot of the transaction.
Returns the value of has_qos of the transaction.
Returns the value of has_wstrb of the transaction.
Returns the value of has_bresp of the transaction.
Returns the value of has_rresp of the transaction.
Returns the value of protocol type of the transaction.
virtual function void set_addr_width( |
| ); |
Sets the value of address width of the transaction. Internal use only
Returns the value of address width of the transaction.
virtual function void set_data_width( |
| ); |
Sets the value of WDATA/RDATA width of the transaction. Internal use only
Returns the value of WDATA/RDATA width of the transaction.
virtual function void set_id_width( |
| ); |
Sets the value of ID width of the transaction. Internal use only
Returns the value of ID width of the transaction.
virtual function void set_awuser_width( |
| ); |
Sets the value of AWUSER width of the transaction.Internal use only
Returns the value of AWUSER width of the transaction.
virtual function void set_wuser_width( |
| ); |
Sets the value of WUSER width of the transaction. Internal use only
Returns the value of WUSER width of the transaction.
virtual function void set_buser_width( |
| ); |
Sets the value of BUSER width of the transaction.Internal use only
Returns the value of BISER width of the transaction.
virtual function void set_aruser_width( |
| ); |
Sets the value of ARUSER width of the transaction. Internal use only
Returns the value of ARUSER width of the transaction.
virtual function void set_ruser_width( |
| ); |
Sets the value of RUSER width of the transaction. Internal use only
Returns the value of RUSER width of the transaction.
Returns the value of AXI version of the transaction. please refer xil_axi_vif_axi_version_t for possible axi version
virtual function void set_axi_version( |
| ); |
Sets the value of AXI VERSION of the transaction. Internal use only
Returns the enum string name of the AXI version of the transaction.please refer xil_axi_vif_axi_version_t for possible axi version name.
virtual function void set_creation_time( |
| ); |
Sets creation_time of the transaction. It is the time when the transaction is being created.
Returns creation_time of the transaction.
Returns the string of the AXI basic command properties which are cmd name,cmd_id,addr,id,length,size name, burst name, cache,lock name and prot. This is debugging tool to observe the transaction.
Returns the string of cmd_convert2string. refer cmd_convert2string for AXI basic command properties. This is debugging tool to observe the transaction.
Returns the string with the properties of the AXI transaction. This is debugging tool to observe the transaction.
Name
CMD
ADDR
W/RID
LEN
SIZE
BURST
CACHE
LOCK
PROT
REGION
QOS
AWUSER/BUSER/BRESP/ARUSER
DRIVER_RETURN_ITEM
CREATION_TIME
SUBMIT_TIME
PAYLOAD
virtual function void set_submit_time( |
| ); |
Sets the sumbit_time of the transaction. to be removed
Gets the submit_time of the transaction. to be removed
virtual function void set_submit_cycle( |
| ); |
Sets the sumbit_cycle of the transaction.
Gets the submit_cycle of the transaction.
virtual function void get_region_range( |
| ); |
Returns the MIN/MAX values that are used to constrain the AxREGION value.
virtual function void set_region_range( |
| ); |
Sets the MIN/MAX values that are used to constrain the AxREGION value. Internal use only
Returns the number of bytes of DATA in the transaction based on the current properties of the transaction. It equals to (length +1) * size(in bytes)
virtual function void set_read_cmd( |
| ); |
Helper function to set the most common READ command properties of the transaction. Address,burst type,length, and size can be set through this command.This API is being used for READ Command only.
virtual function void set_write_cmd( |
| ); |
Helper function to set the most common WRITE command properties of the transaction. It sets address, burst type, id, length and size of the WRITE transaction. This API can only be used for WRITE Command only.
virtual function void set_cmd( |
| ); |
Helper function to set the most common command properties of the transaction. It sets cmd type,address, burst type, id, length and size of the transaction,
Returns the value of AxREGION of the transaction.
virtual function void set_region ( |
| ); |
Sets the value of AxREGION of the transaction.
virtual function void set_qos ( |
| ); |
Sets the value of AxQOS of the transaction.
Returns the value of AxID/RID/BID of the transaction.
virtual function void set_id ( |
| ); |
Sets the value of AxID/RID/BID of the transaction.
Sets the driver_return_item property to XIL_AXI_PAYLOAD_RETURN of the transaction.
virtual function void set_driver_return_item_policy ( |
| ); |
Sets the driver_return_item property of the transaction. If user want to get the data back from driver, the driver_return_item has to be set to not XIL_AXI_NO_RETURN.
Simple usage of this API to get read data back from driver from master agent is listed below, more details please refer PG267 section about How to Receive Read Data and/or example design in Vivado about sim-set sim_adv_mst_active__pt_slv__slv_passive, under there look for *mst_stimulus.sv file :
rd_trans = agent.rd_driver.create_transaction("read transaction with randomization for getting data back");
fully_randomized_transaction(rd_trans);
rd_trans.set_driver_return_item_policy(XIL_AXI_PAYLOAD_RETURN);
agent.rd_driver.send(rd_trans);
agent.rd_driver.wait_rsp(rd_trans);
data_block_for_read = rd_trans.get_data_block();
$display("Read data from Driver: Block Data %h ", data_block_for_read);
DataBeat_for_read = new[rd_trans.get_len()+1];
for( xil_axi_uint beat=0; beat<rd_trans.get_len()+1; beat++) begin
DataBeat_for_read[beat] = rd_trans.get_data_beat(beat);
$display("Read data from Driver: beat index %d, Data beat %h ", beat, DataBeat_for_read[beat]);
Returns the value of driver_return_item property of the transaction.
Returns the value of AxADDR of the transaction. AxADDR here can be AWADDR or ARADDR
virtual function void set_addr ( |
| ); |
Sets the value of AxADDR of the transaction. AxADDR here can be AWADDR or ARADDR .If user accidently set the address out of range(0, 1<< this.get_addr_width() -1), a warning message will pop up and the address will be truncated to make sure it is in the address range.
Gets address offset of the transaction. to be removed
Returns the value of an ID field for the transaction. This can be used for tracking the transaction within the DRIVER or environment.
Returns the command type (READ/WRITE) of the transaction.
virtual function void set_cmd_type( |
| ); |
Sets the command type (READ/WRITE) of the transaction.
Returns the string name of the command type of the transaction.
Returns the value of AxLEN of the transaction. AxLEN can be ARLEN and AWLEN.
virtual function void set_len( |
| ); |
Sets the value of AxLEN of the transaction,AxLEN can be ARLEN and AWLEN, A fatal DRC occurs when any of the following conditions occur:
If AXI VIP is configured to be AXI4LITE and the user sets the length other than 0
If AXI VIP is configured to be AXI3 and the user sets the length greater than 16
If the burst type is not INCR and the user sets the length to a value great than 16.
If the burst type is fixed and the user sets the length to a value great than 16.
If the burst type is WRAP and the user sets the length to a value that is not 2,4,8,16
Returns the value of AxSIZE of the transaction, AxSIZE can be ARSIZE and AWSIZE.
Returns the string name of the value of AxSIZE of the transaction,AxSIZE can be ARSIZE and AWSIZE.
Helper function that will convert the data width value to AxSIZE and return the value,AxSIZE can be ARSIZE and AWSIZE.
virtual function void set_size( |
| ); |
Sets the value of AxSIZE of the transaction,AxSIZE can be ARSIZE and AWSIZE.
Returns the value of AxBURST of the transaction, AxBURST can be ARBURST and AWBURST.
Returns the string name of the value of AxBURST of the transaction,AxBURST can be ARBURST and AWBURST.
virtual function void set_burst( |
| ); |
Sets the value of AxBURST of the transaction,AxBURST can be ARBURST and AWBURST. When AXI VIP HAS_BURST is low, burst type can only be set to INCR, otherwise, FATAL DRC will be file. When AXI VIP HAS_BURST is high and it is AXI4LITE, burst type can only be set to INCR. otherwise, FATAL DRC will be file
Returns the value of AxLOCK of the transaction,AxLOCK can be ARLOCK and AWLOCK.
virtual function void set_lock( |
| ); |
Sets the value of AxLOCK of the transaction,AxLOCK can be ARLOCK and AWLOCK.
Returns the value of AxCACHE of the transaction,AxCACHE can be ARCACHE and AWCACHE.
virtual function void set_cache( |
| ); |
Sets the value of AxCACHE of the transaction,AxCACHE can be ARCACHE and AWCACHE.
Returns the value of AxPROT of the transaction,AxPROT can be ARPROT and AWPROT.
virtual function void set_prot( |
| ); |
Sets the value of AxPROT of the transaction,AxPROT can be ARPROT and AWPROT.
virtual function void set_trans_state( |
| ); |
Sets trans_state of the transaction.
Returns trans_state of the transaction.
Returns the value of AWUSER of axi_transaction.
virtual function void set_awuser( |
| ); |
Sets the value of the AWUSER of axi_transaction.Warning will be poped out if user try to set awuser value which is out of range
Returns the value of the ARUSER of axi_transaction.
virtual function void set_aruser( |
| ); |
Sets the value of the ARUSER of axi_transaction. Warning will be poped out if user try to set aruser value which is out of range
Returns the value of the BUSER of axi_transaction.
virtual function void set_buser( |
| ); |
Sets the value of the BUSER of the transaction.Warning will be poped out if user try to set buser value which is out of range
Get current beat index of the axi_transaction.
Increment beat index of axi_transaction.
Clear beat index of axi_transaction.
Returns the value of the address delay from the time command being recevied by write/read driver of master agent to the time the command being put on interface bus.-Refer PG267 AXI VIP Agent and Flow Methology about Write Command and Data Flow
virtual function void set_addr_delay( |
| ); |
Sets the value of the address delay from the time command being recevied by write/read driver of master agent to the time the command being put on interface bus. --Refer PG267 AXI VIP Agent and Flow Methology about Write Command and Data Flow
virtual function void adjust_data_insertion_delay( |
| ); |
Adjust data insertion delay of the transaction. This API is disabled when adjust_data_beat_delay_enabled is low, when it is high, it will be used to adjust the delay between the time when the command is to be processed and the time when the data is applied to the interface.
virtual function void adjust_addr_delay( |
| ); |
Adjust address delay of the transaction. This API is disabled when adjust_addr_delay_enabled is low, when it is high, it will be used to adjust the address delay of the transaction.
virtual function void adjust_response_delay( |
| ); |
Adjust the response delay of the transaction. This API is disabled when adjust_response_delay_enabled is low, when it is high, it will be used to adjust the response delay.
Returns the transactions insertion delay value. The delay value is the number of clock cycles between transfer being processed to the data transfer being applied to the interface.--Refer PG267 AXI VIP Agent and Flow Methology about Write Command and Data Flow.
virtual function void set_data_insertion_delay( |
| ); |
Sets the transactions data insertion delay value, it is number of cycles. This is the delay from the time the transfer is processed to the time the transfer is applied to the interface.--Refer PG267 AXI VIP Agent and Flow Methology about Write Command and Data Flow.
Returns the number of cycles that the driver will wait before sending the response.Refer PG267 AXI VIP Agent and Flow Methology about Write Response/Reaction and Data Flow.
virtual function void set_response_delay( |
| ); |
Sets the number of cycles that the driver will wait before sending the response.
Returns allow_data_before_cmd of the transaction. allow_data_before_cmd is the number of data beat in one transfer which is being written to interface data bus before command is being written.If it is zero, it means that command is being written before data.
virtual function void set_allow_data_before_cmd( |
| ); |
Sets allow_data_before_cmd of the transaction.allow_data_before_cmd is the number of data beat in one transfer which is being written to interface data bus before command is being written.If it is zero, it means that command is being written before data.
The default xfer_wrcmd_order of the transaction is XIL_AXI_WRCMD_ORDER_NONE. When this API is being called, user has to make sure that xfer_wrcmd_order of the transaction has to be set to XIL_AXI_WRCMD_ORDER_DATA_BEFORE_CMD so that this API is doing what user expected. user can user set_xfer_wrcmd_order to set the xfer_wrcmd_order of the transaction.
Gets xfer_preemptive_probability of the transaction.
virtual function void set_xfer_preemptive_probability( |
| ); |
Sets xfer_preemptive_probability of the transaction.
Returns the value of BRESP of the transaction.
virtual function void set_bresp( |
| ); |
Sets the value of BRESP of the transaction.
Gets bresp name of the transaction.
Returns 1 if bresp of axi_transaction is XIL_AXI_RESP_OKAY, else returns 0
Returns 1 if bresp of axi_transaction is XIL_AXI_RESP_SLVERR, else returns 0
Returns 1 if bresp of axi_transaction is XIL_AXI_RESP_DECERR, else returns 0
Returns 1 if bresp of axi_transaction is XIL_AXI_RESP_EXOKAY, else returns 0
Returns 1 if rresp of axi_transaction is XIL_AXI_RESP_OKAY, else returns 0
Returns 1 if rresp of axi_transaction is XIL_AXI_RESP_EXOKAY, else returns 0
Returns 1 if rresp of axi_transaction is XIL_AXI_RESP_SLVERR, else returns 0
Returns 1 if rresp of axi_transaction is XIL_AXI_RESP_DECERR, else returns 0
Returns the current beat delay of the transaction.
virtual function void set_beat_index_delay( |
| ); |
Sets the specified beat delay of the transaction.
function void set_strb_beat_unpacked( |
| ); |
Sets the strobe of one beat of the transaction.
function void set_data_beat_unpacked( |
| ); |
Sets the data of one beat in the transaction.
function void get_data_beat_unpacked( |
| ); |
Returns the data of one beat in the transaction.
Sets all_resp_okay of the transaction to be true
Returns all_resp_okay of the transaction.
Sets all_resp_okay of the transaction.
Sets exclude_resp_exokay of the transaction to be true
Returns exclude_resp_exokay of the transaction.
Sets exclude_resp_exokay of the transaction to be false
virtual function void set_xfer_alignment( |
| ); |
Sets xfer_alignent of the transaction. refer xil_axi_xfer_alignment_t for more details.
Returns xfer_alignment of the transaction.
virtual function void set_xfer_wrcmd_order( |
| ); |
Sets xfer_wrcmd_order of the transaction.
Gets xfer_wrcmd_order of the transaction.
virtual function void set_xfer_wrdata_insertion_policy( |
| ); |
Sets xfer_wrdata_insertion_policy of the transaction.
Gets xfer_wrdata_insertion_policy of the transaction.
function void get_addr_delay_range( |
| ); |
Returns min_addr_delay and max_addr_delay of the transaction.
virtual function void set_addr_delay_range( |
| ); |
Sets min_addr_delay and max_addr_delay of the transaction.when transaction is randomized,addr_insertion_delay will be inside the range of min_addr_insertion_delay and max_addr_insertion_delay.
function void get_data_insertion_delay_range( |
| ); |
Returns min_data_insertion_delay and max_data_insertion_delay of the transaction.
function void get_response_delay_range( |
| ); |
Returns min_response_delay and max_response_delay of the transaction.
virtual function void set_data_insertion_delay_range( |
| ); |
Sets min_data_insertion_delay and max_data_insertion_delay of the transaction.when transaction is randomized,data_insertion_delay will be inside the range of min_data_insertion_delay and max_data_insertion_delay.
virtual function void set_response_delay_range( |
| ); |
Sets min_response_delay and max_response_delay of the transaction.when transaction is randomized,response_delay will be inside the range of min_response_delay and max_response_delay.
function void get_allow_data_before_cmd_range( |
| ); |
Returns min_allow_data_before_cmd and max_allow_data_before_cmd of the transaction.
virtual function void set_allow_data_before_cmd_range( |
| ); |
Sets min_allow_data_before_cmd and max_allow_data_before_cmd of the transaction.when transaction is randomized, allow_data_before_cmd will be inside the range of min_allow_data_before_cmd and max_allow_data_before_cmd.
function void get_beat_delay_range( |
| ); |
Returns min_beat_delay and max_beat_delay of the transaction.
virtual function void set_beat_delay_range( |
| ); |
Sets min_beat_delay and max_beat_delay of the transaction. when transaction is randomized,beat_delay will be inside the range of min_beat_delay and max_beat_delay.
Returns report_errors_number of the transaction.
virtual function void set_report_errors_number( |
| ); |
Sets report_errors_number of the transaction. report_errors_number is being used to decide maximum number of miscomparsion error messages about data beat,rresp,ruser,wuser will be printed out when API do_compare is being called.
function xil_axi_uint get_burst_byte_offset( |
| ); |
Returns burst byte offset of beat(index) of the transaction. It is being used to calculate burst byte offset.
Returns total number of bytes of one transfer. It equals to transfer.size * (transfer.len+1)
Sets all strobe bits of the transaction to 0
Sets all strobe bits of the transaction to 1
Sets data to unknown and strobe to be unknown for write transaction
Sets data,strobe and wuser(if WUSER_WIDTH>0),beat_delay of write transaction
Sets data,rresp and ruser(if RUSER_WIDTH>0),beat_delay of read transaction
Adjust strobe bit of unaligned head of the transaction to be 0
Sets final value of region,prot,qos,cache,address,bresp,rresp,strobe of transaction to be removed
virtual function void set_beat_delay( |
| ); |
Assign the inter-beat delay of the specified beat.
virtual function xil_axi_uint get_beat_delay( |
| ); |
Returns the inter-beat delay of the specified beat.
virtual function void set_data_beat( |
| ); |
Convenience function that will assign the value of the specified beat. it will set the assigned index data and strobe information, default strb is {128{1'b1}} .
virtual function void set_data_block( |
| ); |
Convenience function that will assign the data payload for the complete transaction. The maximum of one transactin is 4k Bytes and that is why the input of this API is 8*4096 bits. According to the transaction length and size, this API will just take what is needed to fill the data of the transaction.
virtual function void set_strb_beat( |
| ); |
Convenience function that will assign the value STRB of the specified beat, default strb is {128{1'b1}}.
virtual function xil_axi_data_beat get_data_beat( |
| ); |
Returns the value of the specified beat. This is NOT always the RDATA/WDATA representation. It will align the signification bytes to the lower bytes and set the unused bytes to zeros.
Returns the 4K bytes of the payload for the transaction. This is NOT always the RDATA/WDATA representation. It will align the signification bytes to the lower bytes and set the unused bytes to zeros.
virtual function xil_axi_strb_beat get_strb_beat( |
| ); |
Returns the value of the specified beat. This is NOT always the WSTRB representation. It will align the signification strobes to the lower bytes and set the unused strobes to zeros.
virtual function void set_user_beat( |
| ); |
Sets user value of the specified beat.
virtual function void set_ruser( |
| ); |
Sets the value of the RUSER for the specified beat.
virtual function void set_wuser( |
| ); |
Sets the value of the WUSER for the specified beat.
virtual function void set_rresp( |
| ); |
Sets the value of the RRESP for the specified beat.
virtual function xil_axi_resp_t get_rresp( |
| ); |
Returns the value of the RRESP for the specified beat.
virtual function string get_rresp_name( |
| ); |
Returns the name of the RRESP for the specified beat.
virtual function xil_axi_user_beat get_user_beat( |
| ); |
Returns the value of the xUSER beat at the index provided of the transaction. xUSER here can be WUSER/RUSER.
virtual function xil_axi_user_beat get_wuser( |
| ); |
Returns the value of the WUSER for the specified beat.
virtual function xil_axi_user_beat get_ruser( |
| ); |
Returns the value of the RUSER for the specified beat.
Returns the INCR address of the WRAP transaction. The returned INCR address will be aligned to the AxSIZE of the transaction.
Returns an axi_transaction with INCR burst type based on the current transaction which has WRAP burst type. This function will change the resultant INCR transaction address to be aligned.
virtual function axi_transaction convert_incr_to_wrap( |
| ); |
Returns an axi_transaction with WRAP burst type based on the current transaction which has INCR burst type. This function requires the WRAP offset to correctly return the target word.
virtual function void import_data_beat_fields( |
| ); |
Sets data,strobe,wuser of write beat to be removed
virtual function void import_cmd_fields ( |
| ); |
Sets addr, cmd, len,size,burst,lock,cache,prot,region,qos,data and beat_delay of current axi_transaction with xil_axi_cmd_beat cmd contents. For write command, set awuser(if AWUSER_WIDTH>0),wuser(if WUSER_WIDTH>0), For read command, set aruser(if ARUSER_WIDTH>0),ruser(if RUSER_WIDTH>0).
virtual function void import_rd_beat( |
| ); |
Sets data, ruser(if RUSER_WIDTH>0),rresp of xil_axi_read_beat.
function void auto_fill_transaction( |
| ); |
Fill the transaction with different patterns based on the data_pat/strb_pat selected. When the data_pat is NOT set to XIL_AXI_DATA_FILL_NOTOUCH, The values of the strb's will all be set even if the strb_pat is set to XIL_AXI_DATA_FILL_NOTOUCH. refer xil_axi_data_fill_t, xil_axi_strb_fill_t for more information.