Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
This contains only for write response pls. help me find the read response also

What I have tried:

`timescale 1ns / 1ps

import axi_vip_pkg::*;
import vip_axi4full_axi_vip_0_0_pkg::*;

// Test Bench Signals

bit aclk = 0, aresetn = 1;
bit rsta_busy;
bit [31:0] data, addr, base_addr = 32'hc000_0000;
xil_axi_resp_t resp;
bit [128-1:0] datas = {128'h0000_1111_0000_2222_0000_3333_0000_4444};

module tb_axi4vip( );

vip_axi4full_wrapper UUT
(
    .aclk       (aclk),
    .aresetn    (aresetn),
    .rsta_busy  (rsta_busy)
);

always #10ns aclk = ~aclk;

initial begin
    //Assert the reset
    aresetn = 0;
    #500ns
    aresetn = 1;
end

vip_axi4full_axi_vip_0_0_mst_t      master_agent;

initial begin

    master_agent = new("master vip agent",UUT.vip_axi4full_i.axi_vip_0.inst.IF);
    master_agent.start_master();
    
    wait (aresetn == 1'b1);
    
    #500ns
    myAXI4_WRITE_BURST(base_addr * addr,0,datas,resp);
    
    $display("========end=======");
    #500ns;
    $finish;

end

task myAXI4_WRITE_BURST (
    input xil_axi_ulong     addr,
    input xil_axi_prot_t    prot,
    input bit [128-1:0]     data,
    output xil_axi_resp_t   resp
  );
  master_agent.AXI4_WRITE_BURST(
    0,
    addr,
    4,
    XIL_AXI_SIZE_4BYTE,
    XIL_AXI_BURST_TYPE_INCR,
    XIL_AXI_ALOCK_NOLOCK,
    'h0,
    prot,
    'h0,
    'h0,
    'h0,
    data,
    'h0,
    resp
  ); 
endtask

endmodule
Posted
Updated 13-Jul-22 5:59am

Do you have any idea how much work explaining code line by line is?
Every single line needs a paragraph of explanation! For example:
int next = r.Next();

Create a new variable called "next" which can hold a integer value. From the previously declared Random instance "r", call the "Next" method to get a new random number, and assign it to the "next" variable.

Can you imagine how long it would take us to explain even a very short code fragment like your example, line by line?

No. It is not going to happen. If you have a specific problem, then ask a question about it. But think first - would you want to sit down for 45 minutes and type up a line-by-line description for no good reason?
 
Share this answer
 
See VLSI Design - Verilog Introduction[^] for full details.
 
Share this answer
 
Verilog and other hardware languages don't get much support here because of the very small user base compared to general programming languages. The best person to ask for questions such as your is the person who wrote the code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900