diff options
author | Andrew Moch <Andrew.Moch@ni.com> | 2020-07-29 17:57:13 +0100 |
---|---|---|
committer | Wade Fife <wade.fife@ettus.com> | 2020-07-31 11:55:47 -0500 |
commit | 6ef642e3ac44c52b98b124f30dc84b1683859989 (patch) | |
tree | b6ff47d7b1cd939cbd26cf4c3142523e4964a4bc /fpga/usrp3/lib | |
parent | 3beb450e2ab29e6021f4091fd1a3cc6522f994c4 (diff) | |
download | uhd-6ef642e3ac44c52b98b124f30dc84b1683859989.tar.gz uhd-6ef642e3ac44c52b98b124f30dc84b1683859989.tar.bz2 uhd-6ef642e3ac44c52b98b124f30dc84b1683859989.zip |
fpga: lib: Update AxiLiteIf
This fixes a bug on wrstb in AxiLiteIf and adds a new AxiLiteIf_v that
can be used to stitch onto Verilog port_maps.
Diffstat (limited to 'fpga/usrp3/lib')
-rw-r--r-- | fpga/usrp3/lib/axi4lite_sv/AxiLiteIf.sv | 75 |
1 files changed, 74 insertions, 1 deletions
diff --git a/fpga/usrp3/lib/axi4lite_sv/AxiLiteIf.sv b/fpga/usrp3/lib/axi4lite_sv/AxiLiteIf.sv index beb095bc3..d7861a0d1 100644 --- a/fpga/usrp3/lib/axi4lite_sv/AxiLiteIf.sv +++ b/fpga/usrp3/lib/axi4lite_sv/AxiLiteIf.sv @@ -76,7 +76,7 @@ interface AxiLiteIf #( task automatic drive_w(input data_t data, input strb_t strb = '1); wdata = data; - wstrb = wstrb; + wstrb = strb; wvalid = 1; endtask @@ -207,3 +207,76 @@ interface AxiLiteIf #( ); endinterface : AxiLiteIf + +interface AxiLiteIf_v #( + int DATA_WIDTH = 64, + int ADDR_WIDTH = 1 +) ( + input logic clk, + input logic rst = 1'b0 +); + + import PkgAxiLite::*; + + localparam BYTES_PER_WORD = DATA_WIDTH/8; + // local type defs + typedef logic [DATA_WIDTH-1:0] data_t; + typedef logic [ADDR_WIDTH-1:0] addr_t; + typedef logic [BYTES_PER_WORD-1:0] strb_t; + + // Signals that make up an AxiLite interface + // AXI-Lite + // Write Address Channel + addr_t awaddr; + logic awvalid; + logic awready; + + // Write Data Channel + data_t wdata; + strb_t wstrb; + logic wvalid; + logic wready; + + // Write Response Channel + resp_t bresp; + logic bvalid; + logic bready; + + // Read Address Channel + addr_t araddr; + logic arvalid; + logic arready; + + // Read Data Channel + data_t rdata; + resp_t rresp; + logic rvalid; + logic rready; + + // View from the master side + modport master ( + input clk, rst, + output awaddr,awvalid,wdata,wstrb,wvalid,bready,araddr,arvalid,rready, + input awready,wready,bresp,bvalid,arready,rdata,rresp,rvalid, + import drive_aw, + import drive_w, + import drive_w_idle, + import drive_aw_idle, + import drive_read, + import drive_read_idle + + ); + + // View from the slave side + modport slave ( + input clk, rst, + input awaddr,awvalid,wdata,wstrb,wvalid,bready,araddr,arvalid,rready, + output awready,wready,bresp,bvalid,arready,rdata,rresp,rvalid, + import drive_write_resp, + import drive_write_resp_idle, + import drive_read_resp, + import drive_read_resp_idle + + ); + +endinterface : AxiLiteIf_v |