AXI Slave Write Driver object.It does :
Receives AW Command and the WLAST from the interface and then passes that transaction to the user environment, the user will then create a BRESP transaction and pass it back to the driver to drive the B channel.
Receives WRITE transactions from the user environment and drives the AW and W channels.
Trigger an event when the AW Command is accepted.
Trigger an event when the WLAST is accepted.
Receives READY transactions from the user environment and drives the AWREADY signal of the AW channel.
Receives READY transactions from the user environment and drives the WREADY signal of the W channel.
Generates re-ordered B Channel responses.
axi_vif_mem_proxy `AXI_PARAM_ORDER vif_proxy;AXI VIF Proxy Class
xil_seq_item_pull_port #(axi_ready_gen, axi_ready_gen) awready_seq_item_port;provides the method to send awready information to axi_slv_wr_driver
xil_seq_item_pull_port #(axi_ready_gen, axi_ready_gen) wready_seq_item_port;provides the method to send wready information to axi_slv_wr_driver
xil_seq_item_pull_port #(axi_transaction,axi_transaction) seq_item_port;provides method to send write transaction to axi_slv_wr_driver
function new( |
| ); |
Constructor to create an AXI slave write driver
function void set_vif( |
| ); |
Assigns the virtual interface of the driver.
function void set_awready_gen( |
| ); |
Sets awready of the AXI slave write driver. There are three ways for awready generation in AXI slave write driver.
1.User can first create a axi_ready_gen, customerize it and then use set_awready_gen to send it to AXI slave write driver. User can't fill in more than 500 axi_ready_gen at one time, otherwise it will error out.
2.User can can first create a axi_ready_gen, customerize it and then use send_awready to send it to AXI slave write driver.
3. If neither of above method is being called, then AXI slave write driver will a) if XIL_DO_NOT_USE_ADV_RANDOMIZATION is being defined, awready is being generated with cheap_random(this is for tools which doesn't support advanced randomization. b) else awready will be randomly generated
Returns awready_gen
function void set_wready_gen( |
| ); |
Sets wready of the AXI slave write driver. There are three ways for wready generation in AXI slave write driver.
1.User can first create a axi_ready_gen, customerize it and then use set_wready_gen to send it to AXI slave write driver. User can't fill in more than 500 axi_ready_gen at one time, otherwise it will error out.
2.User can can first create a axi_ready_gen, customerize it and then use send_wready to send it to AXI slave write driver.
3. If neither of above method is being called, then AXI slave write driver will a) if XIL_DO_NOT_USE_ADV_RANDOMIZATION is being defined, wready is being generated with cheap_random(this is for tools which doesn't support advanced randomization. b) else wready will be randomly generated
Returns wready_gen
function void set_reorder_response_ability ( |
| ); |
Sets reorder_response_ability of the Driver. refer xil_axi_reorder_ability_t about reorder transaction.
Returns reorder_response_ability of the Driver. refer xil_axi_reorder_ability_t about reorder transaction.
function void set_reorder_backoff_range( |
| ); |
Sets the reordering backoff timer range of the slave write driver. Since the slave may pop the BRESP quicker than one is available, if there is only one entry then insert a backoff that will allow for some accumulation of time. so perhaps another BRESP will be ready to send. This time is randomized between min and max.
function void get_reorder_backoff_range( |
| ); |
Gets the reordering backoff timer range
function void set_forward_progress_timeout_value ( |
| ); |
Sets the number of cycles that the driver will wait for AW/W/B accepted until it will flag a watch dog error of the axi_slv_wr_driver. Default value is 50000. Setting this to a very large value will cause a hung simulation to continue for a longer time. Setting this to a very small number may not allow enough time for simulation to respond.
Returns the number of cycles that the driver will wait for AW/W/B accepted until it will flag a watch dog error of the axi_slv_wr_driver. Default value is 50000 and user can use set_forward_progress_timeout_value to change it.
function void set_waiting_valid_timeout_value ( |
| ); |
Sets waiting_valid_timeout_value of the slave write driver. waiting_valid_timeout_value is used for driver to wait a certain number of cycles for bvalid/bready handshake occurs before it time out.
Returns waiting_valid_timeout_value of the slave write driver. waiting_valid_timeout_value is used for driver to wait a certain number of cycles for bvalid/bready handshake occurs before it time out.
function void set_transaction_depth( |
| ); |
Sets the number of WRITE transactions that the Driver will have in flight at one time.
Returns the maximum number of WRITE transactions that the Driver will have in flight at one time.
Returns number of commands in pending
virtual function void set_xfer_wrcmd_order( |
| ); |
Sets wrcmd_order of the slave write driver. Refer xil_axi_xfer_wrcmd_order_t for order between write command and write data.
Returns wrcmd_order of the slave write driver.Refer xil_axi_xfer_wrcmd_order_t for order between write command and write data.
virtual function void set_inbound_fifo_depth( |
| ); |
Sets inbound_fifo_depth of the slave write driver for wready generation.In axi slave write driver, when write command order is not XIL_AXI_WRCMD_ORDER_CMD_BEFORE_DATA, wready generation mimics an inbound buffer of depth inbound_fifo_depth.Once wdata beat counts reach inbound_fifo_depth, it checks whether there is outstanding commands. If there is no pending command request,stop wready generation and wait till there is at least one active request.
Returns inbound_fifo_depth of the Driver
Returns TRUE if the Driver is idle, else FALSE
function void set_awaddr_watchdog_delay( |
| ); |
Sets awaddr_watchdog_delay of the slave write driver.When axi_transaction's xfer_wrcmd_order is XIL_AXI_WRCMD_ORDER_DATA_BEFORE_CMD, awready generation of axi_slv_wr_driver will fire watchdog AXI_WR_SLV_DATA_BEFORE_CMD_DEADLOCK WATCHDOG if it doesn't see wvalid assert high after waiting awaddr_watchdog_delay clock cycles.
Returns awaddr_watchdog_delay of the slave write driver.When axi_transaction's xfer_wrcmd_order is XIL_AXI_WRCMD_ORDER_DATA_BEFORE_CMD, awready generation of axi_slv_wr_driver will fire watchdog AXI_WR_SLV_DATA_BEFORE_CMD_DEADLOCK WATCHDOG if it doesn't see wvalid assert high after waiting awaddr_watchdog_delay clock cycles.
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.
Start control processes for operation
Stops all control processes.
virtual task get_wr_reactive ( |
| ); |
Returns write reactive transaction with write command information. The slave VIP agent gets write transaction command information,fill in write response and send it back to Slave VIP interface.The usage of this API is shown below and it MUST be put in initial, forever procedure since get_wr_reactive is blocking, so does send. Please refer example design simset sim_allconfig for more details.
initial begin
forever begin :slv_run
slv_agent.wr_driver.get_wr_reactive(wr_reactive);
fill_reactive(wr_reactive);
slv_agent.wr_driver.send(wr_reactive);
end
end
//fill reactive response for write transaction
function automatic void fill_reactive(inout axi_transaction t);
xil_axi_resp_t bresp;
xil_axi_user_beat buser;
buser = $urandom_range(0,1<< <=:c_buser_width:> -1);
if( <=:c_has_bresp:>== 0) begin
bresp = XIL_AXI_RESP_OKAY;
end else begin
if(t.get_all_resp_okay() == XIL_AXI_TRUE) begin
bresp = XIL_AXI_RESP_OKAY;
end else begin
if(t.get_axi_version() != XIL_VERSION_LITE) begin
if (t.get_exclude_resp_exokay() == XIL_AXI_TRUE) begin
void'(randomize(bresp)with{bresp inside {XIL_AXI_RESP_OKAY, XIL_AXI_RESP_DECERR, XIL_AXI_RESP_SLVERR };});
end else begin
bresp = XIL_AXI_RESP_DECERR;
end
end else begin
void'(randomize(bresp) with {bresp inside {XIL_AXI_RESP_OKAY, XIL_AXI_RESP_DECERR, XIL_AXI_RESP_SLVERR};});
end
end
end
t.set_buser(buser);
t.set_bresp(bresp);
endfunction: fill_reactive
virtual function axi_transaction create_transaction ( |
| ); |
Returns an AXI transaction class that has been "newed"
task send_wready( |
| ); |
Sends the ready structure to the driver for controlling the WREADY channel
virtual function axi_ready_gen create_ready ( |
| ); |
Returns a ready class that has been "newed".
task send_awready( |
| ); |
Sends the ready structure to the slave write driver for controlling the AWREADY channel.his is blocking process which will not return till this ready is being sent out.
task wait_rsp( |
| ); |
This blocking function will not return until driver send back response transaction