xil_axi_slv_mem_model

AXI Memory Model class. It is an associate array of Systemverilog. The write transaction can write to the memory and the read transaction can read data from the memory. These two features are implemented in the Slave VIP and Passthrough VIP in runtime slave mode. At the same time, the memory model has backdoor APIs for user to access memory directly. Please refer PG267 section about Simple SRAM Memory Model for more details.

Functions
new
function new(
string name "unnamed_xil_axi_slv_mem_model"
);

Constructor to create an AXI slave memory model, ~name~ is instance name.

set_bresp_delay_policy
virtual function void set_bresp_delay_policy(
input xil_axi_memory_delay_policy_t in
);

Sets BRESP delay policy of xil_axi_slv_mem_model.

get_bresp_delay_policy
virtual function xil_axi_memory_delay_policy_t get_bresp_delay_policy();

Returns the current value of the BRESP delay policy of xil_axi_slv_mem_model.

set_inter_beat_gap_delay_policy
virtual function void set_inter_beat_gap_delay_policy(
input xil_axi_memory_delay_policy_t in
);

Sets RDATA delay policy of xil_axi_slv_mem_model.

get_inter_beat_gap_delay_policy
virtual function xil_axi_memory_delay_policy_t get_inter_beat_gap_delay_policy();

Returns the current value of the RDATA delay policy of xil_axi_slv_mem_model.

set_memory_fill_policy
virtual function void set_memory_fill_policy(
input xil_axi_memory_fill_policy_t default_fill_type
);

Sets default memory content fill type of xil_axi_slv_mem_model.

get_memory_fill_policy
virtual function xil_axi_memory_fill_policy_t get_memory_fill_policy();

Gets default memory content fill type of xil_axi_slv_mem_model.

set_default_memory_value
virtual function void set_default_memory_value(
input logic [C_AXI_WDATA_WIDTH-1:0value
);

Sets default memory value of xil_axi_slv_mem_model.

get_default_memory_value
virtual function logic [C_AXI_WDATA_WIDTH-1:0] get_default_memory_value();

Returns default memory value of xil_axi_slv_mem_model.

set_inter_beat_gap
function void set_inter_beat_gap(
input xil_axi_uint in 
);

Sets inter beat gap value of xil_axi_slv_mem_model.

get_inter_beat_gap
function xil_axi_uint get_inter_beat_gap();

Returns inter beat gap value of xil_axi_slv_mem_model.

set_inter_beat_gap_range
function void set_inter_beat_gap_range(
input xil_axi_uint min,
input xil_axi_uint max 
);

Sets inter beat gap range of xil_axi_slv_mem_model.

get_inter_beat_gap_range
function void get_inter_beat_gap_range(
output xil_axi_uint min,
output xil_axi_uint max 
);

Gets inter beat gap range of xil_axi_slv_mem_model.

set_bresp_delay
function void set_bresp_delay(
input xil_axi_uint in 
);

Sets BRESP delay value of xil_axi_slv_mem_model.

get_bresp_delay
function xil_axi_uint get_bresp_delay();

Returns BRESP delay value of xil_axi_slv_mem_model.

set_bresp_delay_range
function void set_bresp_delay_range(
input xil_axi_uint min,
input xil_axi_uint max 
);

Sets BRESP delay range of xil_axi_slv_mem_model.

get_bresp_delay_range
function void get_bresp_delay_range(
output xil_axi_uint min,
output xil_axi_uint max 
);

Gets BRESP delay range of xil_axi_slv_mem_model.

backdoor_memory_write
function void backdoor_memory_write(
input xil_axi_ulong addr,
input logic [C_AXI_WDATA_WIDTH-1:0payload,
input logic [C_AXI_WDATA_WIDTH/8-1:0strb 
);

Back door write data to memory.

It will write to the memory with address(addr) with VIP's data_width bits wide data(payload) and data_width/8 bits wide strobe(strb). Default strobe is all on.  It will truncate the address if the addr user give is out of range.  It will give fatal message if strobe bits is asserted at lower bits than address offset.

backdoor_memory_write_4byte
function void backdoor_memory_write_4byte(
input xil_axi_ulong addr,
input logic [31:0payload,
input logic [3:0strb 
);

Back door write data to memory in 4 byte chunks.  It will write to the memory with address(addr) with VIP's data_width bits wide data(payload) and data_width/8 bits wide strobe(strb). Default strobe is all on {4{1'b1}}.  It will truncate the address if the addr user give is out of range.  It will give fatal message if strobe bits is asserted at lower bits than address offset.

backdoor_memory_read
function bit[C_AXI_WDATA_WIDTH-1:0] backdoor_memory_read(
input xil_axi_ulong addr 
);

Back door read data from the address(addr) of memory.

backdoor_memory_read_4byte
function bit[31:0] backdoor_memory_read_4byte(
input xil_axi_ulong addr
);

Back door read data from the address(addr) of memory in 4 byte chunks.

fill_rd_reactive
function axi_transaction fill_rd_reactive(
input axi_transaction t
);

Fill in read data channel from memory model.

fill_wr_reactive
function void fill_wr_reactive(
inout axi_transaction t
);

Fill in write bresponse channel.

write_transaction_to_memory
function void write_transaction_to_memory(
input axi_transaction t
);

Write transaction to memory.

pre_load_mem
function void pre_load_mem(
string data_file,
xil_axi_ulong addr
);

load binary file into memory with addr offset 1. open the file,fire error if it doesn't exist 2. get one byte information by $fgetc file error if the file is empty. else,put byte into tmp_data and start to increment byte_cnt 3. once bytes count reach to memory data width,assign tmp_data to memory address with address offset,reset byte_cnt 4. repeat 2.3 till it reach the EOF of the file