Coder Social home page Coder Social logo

verilog-axi's Introduction

Verilog AXI Components Readme

Build Status

For more information and updates: http://alexforencich.com/wiki/en/verilog/axi/start

GitHub repository: https://github.com/alexforencich/verilog-axi

Introduction

Collection of AXI4 and AXI4 lite bus components. Most components are fully parametrizable in interface widths. Includes full cocotb testbenches that utilize cocotbext-axi.

Documentation

axi_adapter module

AXI width adapter module with parametrizable data and address interface widths. Supports INCR burst types and narrow bursts. Wrapper for axi_adapter_rd and axi_adapter_wr.

axi_adapter_rd module

AXI width adapter module with parametrizable data and address interface widths. Supports INCR burst types and narrow bursts.

axi_adapter_wr module

AXI width adapter module with parametrizable data and address interface widths. Supports INCR burst types and narrow bursts.

axi_axil_adapter module

AXI to AXI lite converter and width adapter module with parametrizable data and address interface widths. Supports INCR burst types and narrow bursts. Wrapper for axi_axil_adapter_rd and axi_axil_adapter_wr.

axi_axil_adapter_rd module

AXI to AXI lite converter and width adapter module with parametrizable data and address interface widths. Supports INCR burst types and narrow bursts.

axi_axil_adapter_wr module

AXI to AXI lite converter and width adapter module with parametrizable data and address interface widths. Supports INCR burst types and narrow bursts.

axi_cdma module

AXI to AXI DMA engine with parametrizable data and address interface widths. Generates full-width INCR bursts only, with parametrizable maximum burst length. Supports unaligned transfers, which can be disabled via parameter to save on resource consumption.

axi_cdma_desc_mux module

Descriptor multiplexer/demultiplexer for AXI CDMA module. Enables sharing the AXI CDMA module between multiple request sources, interleaving requests and distributing responses.

axi_crossbar module

AXI nonblocking crossbar interconnect with parametrizable data and address interface widths and master and slave interface counts. Supports all burst types. Fully nonblocking with completely separate read and write paths; ID-based transaction ordering protection logic; and per-port address decode, admission control, and decode error handling. Wrapper for axi_crossbar_rd and axi_crossbar_wr.

Wrappers can generated with axi_crossbar_wrap.py.

axi_crossbar_addr module

Address decode and admission control module for AXI nonblocking crossbar interconnect.

axi_crossbar_rd module

AXI nonblocking crossbar interconnect with parametrizable data and address interface widths and master and slave interface counts. Read interface only. Supports all burst types. Fully nonblocking with completely separate read and write paths; ID-based transaction ordering protection logic; and per-port address decode, admission control, and decode error handling.

axi_crossbar_wr module

AXI nonblocking crossbar interconnect with parametrizable data and address interface widths and master and slave interface counts. Write interface only. Supports all burst types. Fully nonblocking with completely separate read and write paths; ID-based transaction ordering protection logic; and per-port address decode, admission control, and decode error handling.

axi_dma module

AXI to AXI stream DMA engine with parametrizable data and address interface widths. Generates full-width INCR bursts only, with parametrizable maximum burst length. Supports unaligned transfers, which can be disabled via parameter to save on resource consumption. Wrapper for axi_dma_rd and axi_dma_wr.

axi_dma_desc_mux module

Descriptor multiplexer/demultiplexer for AXI DMA module. Enables sharing the AXI DMA module between multiple request sources, interleaving requests and distributing responses.

axi_dma_rd module

AXI to AXI stream DMA engine with parametrizable data and address interface widths. Generates full-width INCR bursts only, with parametrizable maximum burst length. Supports unaligned transfers, which can be disabled via parameter to save on resource consumption.

axi_dma_wr module

AXI stream to AXI DMA engine with parametrizable data and address interface widths. Generates full-width INCR bursts only, with parametrizable maximum burst length. Supports unaligned transfers, which can be disabled via parameter to save on resource consumption.

axi_dp_ram module

AXI dual-port RAM with parametrizable data and address interface widths. Supports FIXED and INCR burst types as well as narrow bursts.

axi_fifo module

AXI FIFO with parametrizable data and address interface widths. Supports all burst types. Optionally can delay the address channel until either the write data is completely shifted into the FIFO or the read data FIFO has enough capacity to fit the whole burst. Wrapper for axi_fifo_rd and axi_fifo_wr.

axi_fifo_rd module

AXI FIFO with parametrizable data and address interface widths. AR and R channels only. Supports all burst types. Optionally can delay the address channel until either the read data FIFO is empty or has enough capacity to fit the whole burst.

axi_fifo_wr module

AXI FIFO with parametrizable data and address interface widths. WR, W, and B channels only. Supports all burst types. Optionally can delay the address channel until the write data is shifted completely into the write data FIFO, or the current burst completely fills the write data FIFO.

axi_interconnect module

AXI shared interconnect with parametrizable data and address interface widths and master and slave interface counts. Supports all burst types. Small in area, but does not support concurrent operations.

Wrappers can generated with axi_interconnect_wrap.py.

axi_ram module

AXI RAM with parametrizable data and address interface widths. Supports FIXED and INCR burst types as well as narrow bursts.

axi_ram_rd_if module

AXI RAM read interface with parametrizable data and address interface widths. Handles bursts and presents a simplified internal memory interface. Supports FIXED and INCR burst types as well as narrow bursts.

axi_ram_wr_if module

AXI RAM write interface with parametrizable data and address interface widths. Handles bursts and presents a simplified internal memory interface. Supports FIXED and INCR burst types as well as narrow bursts.

axi_ram_wr_rd_if module

AXI RAM read/write interface with parametrizable data and address interface widths. Handles bursts and presents a simplified internal memory interface. Supports FIXED and INCR burst types as well as narrow bursts. Wrapper for axi_ram_rd_if and axi_ram_wr_if.

axi_register module

AXI register with parametrizable data and address interface widths. Supports all burst types. Inserts simple buffers or skid buffers into all channels. Channel register types can be individually changed or bypassed. Wrapper for axi_register_rd and axi_register_wr.

axi_register_rd module

AXI register with parametrizable data and address interface widths. AR and R channels only. Supports all burst types. Inserts simple buffers or skid buffers into all channels. Channel register types can be individually changed or bypassed.

axi_register_wr module

AXI register with parametrizable data and address interface widths. WR, W, and B channels only. Supports all burst types. Inserts simple buffers or skid buffers into all channels. Channel register types can be individually changed or bypassed.

axil_adapter module

AXI lite width adapter module with parametrizable data and address interface widths. Wrapper for axi_adapter_rd and axi_adapter_wr.

axil_adapter_rd module

AXI lite width adapter module with parametrizable data and address interface widths.

axil_adapter_wr module

AXI lite width adapter module with parametrizable data and address interface widths.

axil_cdc module

AXI lite clock domain crossing module with parametrizable data and address interface widths. Wrapper for axi_cdc_rd and axi_cdc_wr.

axil_cdc_rd module

AXI lite clock domain crossing module with parametrizable data and address interface widths.

axil_cdc_wr module

AXI lite clock domain crossing module with parametrizable data and address interface widths.

axil_crossbar module

AXI lite nonblocking crossbar interconnect with parametrizable data and address interface widths and master and slave interface counts. Fully nonblocking with completely separate read and write paths; FIFO-based transaction ordering protection logic; and per-port address decode, admission control, and decode error handling. Wrapper for axil_crossbar_rd and axil_crossbar_wr.

Wrappers can generated with axil_crossbar_wrap.py.

axil_crossbar_addr module

Address decode and admission control module for AXI lite nonblocking crossbar interconnect.

axil_crossbar_rd module

AXI lite nonblocking crossbar interconnect with parametrizable data and address interface widths and master and slave interface counts. Read interface only. Fully nonblocking with completely separate read and write paths; FIFO-based transaction ordering protection logic; and per-port address decode, admission control, and decode error handling.

axil_crossbar_wr module

AXI lite nonblocking crossbar interconnect with parametrizable data and address interface widths and master and slave interface counts. Write interface only. Fully nonblocking with completely separate read and write paths; FIFO-based transaction ordering protection logic; and per-port address decode, admission control, and decode error handling.

axil_interconnect module

AXI lite shared interconnect with parametrizable data and address interface widths and master and slave interface counts. Small in area, but does not support concurrent operations.

Wrappers can generated with axil_interconnect_wrap.py.

axil_ram module

AXI lite RAM with parametrizable data and address interface widths.

axil_reg_if module

AXI lite register interface with parametrizable data and address interface widths. Can be used to assemble a set of control registers across multiple modules and hierarchy levels without complicated arbitration logic. Wrapper for axil_reg_if_rd and axil_reg_if_wr.

axil_reg_if_rd module

AXI lite register interface with parametrizable data and address interface widths. Read direction only. Can be used to assemble a set of control registers across multiple modules and hierarchy levels without complicated arbitration logic.

axil_reg_if_wr module

AXI lite register interface with parametrizable data and address interface widths. Write direction only. Can be used to assemble a set of control registers across multiple modules and hierarchy levels without complicated arbitration logic.

axil_register module

AXI lite register with parametrizable data and address interface widths. Inserts skid buffers into all channels. Channel registers can be individually bypassed. Wrapper for axil_register_rd and axil_register_wr.

axil_register_rd module

AXI lite register with parametrizable data and address interface widths. AR and R channels only. Inserts simple buffers into all channels. Channel registers can be individually bypassed.

axil_register_wr module

AXI lite register with parametrizable data and address interface widths. WR, W, and B channels only. Inserts simple buffers into all channels. Channel registers can be individually bypassed.

Common signals

awid     : Write address ID
awaddr   : Write address
awlen    : Write burst length
awsize   : Write burst size
awburst  : Write burst type
awlock   : Write locking
awcache  : Write cache handling
awprot   : Write protection level
awqos    : Write QoS setting
awregion : Write region
awuser   : Write user sideband signal
awvalid  : Write address valid
awready  : Write address ready (from slave)
wdata    : Write data
wstrb    : Write data strobe (byte select)
wlast    : Write data last transfer in burst
wuser    : Write data user sideband signal
wvalid   : Write data valid
wready   : Write data ready (from slave)
bid      : Write response ID
bresp    : Write response
buser    : Write response user sideband signal
bvalid   : Write response valid
bready   : Write response ready (from master)
arid     : Read address ID
araddr   : Read address
arlen    : Read burst length
arsize   : Read burst size
arburst  : Read burst type
arlock   : Read locking
arcache  : Read cache handling
arprot   : Read protection level
arqos    : Read QoS setting
arregion : Read region
aruser   : Read user sideband signal
arvalid  : Read address valid
arready  : Read address ready (from slave)
rid      : Read data ID
rdata    : Read data
rresp    : Read response
rlast    : Read data last transfer in burst
ruser    : Read data user sideband signal
rvalid   : Read response valid
rready   : Read response ready (from master)

Common parameters

ADDR_WIDTH           : width of awaddr and araddr signals
DATA_WIDTH           : width of wdata and rdata signals
STRB_WIDTH           : width of wstrb signal
ID_WIDTH             : width of *id signals
AWUSER_ENABLE        : enable awuser signal
AWUSER_WIDTH         : width of awuser signal
WUSER_ENABLE         : enable wuser signal
WUSER_WIDTH          : width of wuser signal
BUSER_ENABLE         : enable buser signal
BUSER_WIDTH          : width of buser signal
ARUSER_ENABLE        : enable aruser signal
ARUSER_WIDTH         : width of aruser signal
RUSER_ENABLE         : enable ruser signal
RUSER_WIDTH          : width of ruser signal

Source Files

rtl/arbiter.v                   : Parametrizable arbiter
rtl/axi_adapter.v               : AXI lite width converter
rtl/axi_adapter_rd.v            : AXI lite width converter (read)
rtl/axi_adapter_wr.v            : AXI lite width converter (write)
rtl/axi_axil_adapter.v          : AXI to AXI lite converter
rtl/axi_axil_adapter_rd.v       : AXI to AXI lite converter (read)
rtl/axi_axil_adapter_wr.v       : AXI to AXI lite converter (write)
rtl/axi_cdma.v                  : AXI central DMA engine
rtl/axi_cdma_desc_mux.v         : AXI CDMA descriptor mux
rtl/axi_crossbar.v              : AXI nonblocking crossbar interconnect
rtl/axi_crossbar_addr.v         : AXI crossbar address module
rtl/axi_crossbar_rd.v           : AXI crossbar interconnect (read)
rtl/axi_crossbar_wr.v           : AXI crossbar interconnect (write)
rtl/axi_dma.v                   : AXI DMA engine
rtl/axi_dma_desc_mux.v          : AXI DMA descriptor mux
rtl/axi_dma_rd.v                : AXI DMA engine (read)
rtl/axi_dma_wr.v                : AXI DMA engine (write)
rtl/axi_dp_ram.v                : AXI dual-port RAM
rtl/axi_fifo.v                  : AXI FIFO
rtl/axi_fifo_rd.v               : AXI FIFO (read)
rtl/axi_fifo_wr.v               : AXI FIFO (write)
rtl/axi_interconnect.v          : AXI shared interconnect
rtl/axi_ram.v                   : AXI RAM
rtl/axi_ram_rd_if.v             : AXI RAM read interface
rtl/axi_ram_wr_if.v             : AXI RAM write interface
rtl/axi_ram_wr_rd_if.v          : AXI RAM read/write interface
rtl/axi_register.v              : AXI register
rtl/axi_register_rd.v           : AXI register (read)
rtl/axi_register_wr.v           : AXI register (write)
rtl/axil_adapter.v              : AXI lite width converter
rtl/axil_adapter_rd.v           : AXI lite width converter (read)
rtl/axil_adapter_wr.v           : AXI lite width converter (write)
rtl/axil_cdc.v                  : AXI lite CDC
rtl/axil_cdc_rd.v               : AXI lite CDC (read)
rtl/axil_cdc_wr.v               : AXI lite CDC (write)
rtl/axil_crossbar.v             : AXI lite nonblocking crossbar interconnect
rtl/axil_crossbar_addr.v        : AXI lite crossbar address module
rtl/axil_crossbar_rd.v          : AXI lite crossbar interconnect (read)
rtl/axil_crossbar_wr.v          : AXI lite crossbar interconnect (write)
rtl/axil_interconnect.v         : AXI lite shared interconnect
rtl/axil_ram.v                  : AXI lite RAM
rtl/axil_reg_if.v               : AXI lite register interface
rtl/axil_reg_if_rd.v            : AXI lite register interface (read)
rtl/axil_reg_if_wr.v            : AXI lite register interface (write)
rtl/axil_register.v             : AXI lite register
rtl/axil_register_rd.v          : AXI lite register (read)
rtl/axil_register_wr.v          : AXI lite register (write)
rtl/priority_encoder.v          : Parametrizable priority encoder

AXI4-Lite Interface Example

Write

            ___     ___     ___     ___     ___    
clk     ___/   \___/   \___/   \___/   \___/   \___
            _______
awid    XXXX_ID____XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
awaddr  XXXX_ADDR__XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
awlen   XXXX_00____XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
awsize  XXXX_0_____XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
awburst XXXX_0_____XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
awprot  XXXX_PROT__XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
awvalid ___/       \_______________________________
        ___________         _______________________
awready            \_______/
            _______________
wdata   XXXX_DATA__________XXXXXXXXXXXXXXXXXXXXXXXX
            _______________
wstrb   XXXX_STRB__________XXXXXXXXXXXXXXXXXXXXXXXX
            _______________
wvalid  ___/               \_______________________
                    _______
wready  ___________/       \_______________________
                                    _______
bid     XXXXXXXXXXXXXXXXXXXXXXXXXXXX_ID____XXXXXXXX
                                    _______
bresp   XXXXXXXXXXXXXXXXXXXXXXXXXXXX_RESP__XXXXXXXX
                                    _______
bvalid  ___________________________/       \_______
        ___________________________________________
bready

Read

            ___     ___     ___     ___     ___    
clk     ___/   \___/   \___/   \___/   \___/   \___
            _______
arid    XXXX_ID____XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
araddr  XXXX_ADDR__XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
arlen   XXXX_00____XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
arsize  XXXX_0_____XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
arburst XXXX_0_____XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
arprot  XXXX_PROT__XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            _______
arvalid ___/       \_______________________________
        ___________________________________________
arready
                                    _______
rid     XXXXXXXXXXXXXXXXXXXXXXXXXXXX_ID____XXXXXXXX
                                    _______
rdata   XXXXXXXXXXXXXXXXXXXXXXXXXXXX_DATA__XXXXXXXX
                                    _______
rresp   XXXXXXXXXXXXXXXXXXXXXXXXXXXX_RESP__XXXXXXXX
                                    _______
rvalid  ___________________________/       \_______
        ___________________________________________
rready

Testing

Running the included testbenches requires cocotb, cocotbext-axi, and Icarus Verilog. The testbenches can be run with pytest directly (requires cocotb-test), pytest via tox, or via cocotb makefiles.

verilog-axi's People

Contributors

alexforencich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

verilog-axi's Issues

axil_ram handshake between AW/AR-READY and B/R-RESP

Hi, @alexforencich

I am doing a formal verificaion for verilog-axi IPs, see my repo verilog-axi-formal. And I found an AXI4 lite handshake issue with axil_ram interface, the aw/w-ready is assert with bvalid at the same clock, see the code below

verilog-axi/rtl/axil_ram.v

Lines 118 to 124 in 314ea7d

if (s_axil_awvalid && s_axil_wvalid && (!s_axil_bvalid || s_axil_bready) && (!s_axil_awready && !s_axil_wready)) begin
s_axil_awready_next = 1'b1;
s_axil_wready_next = 1'b1;
s_axil_bvalid_next = 1'b1;
mem_wr_en = 1'b1;
end

And the AXI standard says,

the slave must wait for both WVALID and WREADY to be asserted before asserting BVALID
An explain from https://community.arm.com/ is here
Which means bvalid should at least one clock after wready.

question about axi_ram

Dear Alex,
I have a question about the module of axi_ram. When you use "initial begin end " to initialize the mem[(2**VALID_ADDR_WIDTH)-1:0], should you use "VALID_ADDR_WIDTH" instead of "ADDR_WIDTH"? The attached files is more explict. I am looking for your answer.Thanks!
1574171937(1)

Long logic depth leads to bad timing

Hi another question (and also curious):

Why dma_wr uses a different structure to dma_rd on the generation of status_len/tag?
dma_wr uses status_fifo, but dma_rd doesn't.

My recent synthesis tells me that it has 16 logic levels. It's a challenge for 300MHz+.

Max Delay Paths
--------------------------------------------------------------------------------------
Slack (VIOLATED) :        -1.535ns  (required time - arrival time)
  Source:                 u_fpga/u_net_wrapper/u_udp_aximm_write/axi_dma_wr_inst/offset_reg_reg[1]/C
                            (rising edge-triggered cell FDRE clocked by txoutclk_out[0]  {[email protected] [email protected] period=3.103ns})
  Destination:            u_fpga/u_net_wrapper/u_udp_aximm_write/axi_dma_wr_inst/status_fifo_len_reg_0_31_0_13/RAMF_D1/I
                            (rising edge-triggered cell RAMD32 clocked by txoutclk_out[0]  {[email protected] [email protected] period=3.103ns})
  Path Group:             txoutclk_out[0]
  Path Type:              Setup (Max at Slow Process Corner)
  Requirement:            3.103ns  (txoutclk_out[0] [email protected] - txoutclk_out[0] [email protected])
  Data Path Delay:        4.406ns  (logic 1.681ns (38.153%)  route 2.725ns (61.848%))
  Logic Levels:           16  (CARRY8=2 LUT2=1 LUT3=1 LUT4=2 LUT5=3 LUT6=7)
  Clock Path Skew:        -0.105ns (DCD - SCD + CPR)
    Destination Clock Delay (DCD):    3.522ns = ( 6.625 - 3.103 )
    Source Clock Delay      (SCD):    3.931ns
    Clock Pessimism Removal (CPR):    0.304ns
  Clock Uncertainty:      0.046ns  ((TSJ^2 + DJ^2)^1/2) / 2 + PE
    Total System Jitter     (TSJ):    0.071ns
    Discrete Jitter          (DJ):    0.060ns
    Phase Error              (PE):    0.000ns
  Clock Net Delay (Source):      3.716ns (routing 1.706ns, distribution 2.010ns)
  Clock Net Delay (Destination): 3.330ns (routing 1.550ns, distribution 1.780ns)

dma_rd.v only generates status_tag output. I used the same way to generate status_len (this is important to count how many bytes has been transferred) and it looks much simpler than the status_fifo in dma_wr.v

axi_interconnect Synthesis

Hello, I found that the "priority_encoder" was optimized out when synthesizing "axi_interconnect" using Vivado. Do you know the reason behind this?
The following image shows the synthesis schematic results:
schematic

BRAM inference for Xilinx FPGAs

Hey @alexforencich,

for the axi_ram.v design, do you have a version with the macros instantiations (BRAM_SDP_MACRO/BRAM_TDP_MACRO) or a tip to force bram inference by Vivado? I'm actually suffering with Vivado consuming LUT RAMs instead of BRAMs for my memories in the design....I suppose only adding (* ram_style = "block" *) will not force the inference once the design doesn't follow "Xilinx pattern of design".

About axil-interconnect

Hi sir,
In axi lite interconnect, if a write operation is performed first and awvalid and awready shake hands already, but the write operation is not required , I want to start a read operation. Will the write operation be invalid and the read operation be performed?

axil_adapter_wr : Modelsim error "part select is reversed"

Simulator: Modelsim

Tb connection:
axi4lite-master-bfm <-> axil_adapter <-> axil_ram

In simulation I found error:
" ** Fatal: (vsim-3373) /home/peio/fpgawork/cores/verilog-axi/rtl/axil_adapter_wr.v(215): Range of part-select into 'm_axil_awaddr_reg' is reversed."

axil_adapter_wr.v(215) is:
m_axil_wstrb_next = s_axil_wstrb << (m_axil_awaddr_reg[M_ADDR_BIT_OFFSET - 1:S_ADDR_BIT_OFFSET] * S_STRB_WIDTH);

M_ADDR_BIT_OFFSET=2
S_ADDR_BIT_OFFSET=2

simulator doesn't like m_axil_awaddr_reg[1:2]
is it a bug in axil_adapter_wr?

Does the AXI bus adapter support the downsizer from 256bits to 8bits?

Many thanks for your axi-bus project.
I try to use your axi adapter ip to narrow the bus width from 256 bits to 32 bits.
It works.
Moreover, I want to further narrow the bus width from 256 bits to 8 bits.
The simulation waveform shows that the burst_reg signal is not correct.
So, could you please tell me whether the 256-to-8 configuration is supportable in your project?

About priority_encoder

Hi, Sir. I am studying the priority_encoder module and I have some confusion about the following code. I would appreciate it if you could provide me with some explanation

// compress down to single valid bit and encoded bus
for (l = 1; l < LEVELS; l = l + 1) begin : loop_levels
    for (n = 0; n < W/(2*2**l); n = n + 1) begin : loop_compress
        assign stage_valid[l][n] = |stage_valid[l-1][n*2+1:n*2];//compress down to single valid.
        if (LSB_HIGH_PRIORITY) begin
            // bit 0 is highest priority
            assign stage_enc[l][(n+1)*(l+1)-1:n*(l+1)] = stage_valid[l-1][n*2+0] ? {1'b0, stage_enc[l-1][(n*2+1)*l-1:(n*2+0)*l]} : {1'b1, stage_enc[l-1][(n*2+2)*l-1:(n*2+1)*l]};
        end else begin
            // bit 0 is lowest priority
            assign stage_enc[l][(n+1)*(l+1)-1:n*(l+1)] = stage_valid[l-1][n*2+1] ? {1'b1, stage_enc[l-1][(n*2+2)*l-1:(n*2+1)*l]} : {1'b0, stage_enc[l-1][(n*2+1)*l-1:(n*2+0)*l]};
        end
    end
end

Q1:Why do you use the value of stage_valid[l-1][n2+0] to make the selection when LSB_HIGH_PRIORITY is set to 1? I believe that in the code above, you compressed two requests into one valid value with the line "assign stage_valid[0][n] = |input_padded[n2+1:n2];", so why do you skip the odd bit and use the [n2+0] bit here? What I understand is that when LSB_HIGH_PRIORITY is set to 1, it means that the priority is given to the lower bits. However, I don't see the relation between this code and the priority.

Q2:When Width is 4, LEVELS equals 2. Then 'stage_enc[l][(n+1)(l+1)-1:n(l+1)]' is 2 bits, and '{1'b0, stage_enc[l-1][(n*2+1)l-1:(n2+0)*l]}' is 3 bits. This means that the bit width is not matched. Am I misunderstanding something?

Bug in 4K boundary crossing detection in DMA modules

In axi_dma_rd.v and axi_dma_wr.v

Take axi_dma_rd.v as an example:

339         AXI_STATE_START: begin
340             // start state - initiate new AXI transfer
341             if (!m_axi_arvalid) begin
342                 if (op_word_count_reg <= AXI_MAX_BURST_SIZE - (addr_reg & OFFSET_MASK) || AXI_MAX_BURST_SIZE >= 4096) begin
343                     // packet smaller than max burst size
344                     if (addr_reg[12] != addr_plus_count[12]) begin
345                         // crosses 4k boundary
346                         tr_word_count_next = 13'h1000 - addr_reg[11:0];
347                     end else begin
348                         // does not cross 4k boundary
349                         tr_word_count_next = op_word_count_reg;
350                     end
351                 end else begin
352                     // packet larger than max burst size
353                     if (addr_reg[12] != addr_plus_max_burst[12]) begin
354                         // crosses 4k boundary
355                         tr_word_count_next = 13'h1000 - addr_reg[11:0];
356                     end else begin
357                         // does not cross 4k boundary
358                         tr_word_count_next = AXI_MAX_BURST_SIZE - (addr_reg & OFFSET_MASK);
359                     end
360                 end

Line 342, if setting AXI_MAX_BURST_SIZE = 4096, which is the maximum number defined in AXI4 spec, line 342 always returns "true", and then no matter what the remaining length is, the packet is treated as "smaller than max burst size". That means the last burst beat with possible invalid bytes masked by strobe (for write) or ignored (for read).

This issue can be fixed by changing ">=" to ">" or completely removing the expression of || AXI_MAX_BURST_SIZE >= 4096.

About CDMA testbench with AXI_DATA_WIDTH > 64

Dear Sir,

I am trying to simulate with the testbench cocotb code with AXI_DATA_WIDTH above 64.
It went fine with 32 and 64 but failed when I set data width to 128. Not sure if the verilog module does not support it or I need to revise the Makefile and/or the test_axi_cdma.py ?

image

Thanks,

Brian

axil_ram. How to adjust rvaild delay.

I want to modify axil_ram.v to control block ram. But it is about two or three clock to read data from block ram. How can I modify to fit this feature?

AxiLiteMaster hangs with Verilator

I am using the latest Version of cocotbext-axi.

In my code I am using

AxiLiteMaster(AxiLiteBus.from_prefix(dut, "s_axi_if"), dut.clk_i, dut.reset_ni, reset_active_level = False)

This is working when I simulate it with iverilog but it hangs with Verilator.

About VCS Compile

Can this project be compiled with VCS ?what is $from_myhdl and $to_myhdl?

Query: Maximum number of outstanding read request

I am wondering what is the maximum number of outstanding read request supported in the mmap interface of AXI in the axi_crossbar implementation. Xilinx IPs have a limit of 32 and I want something like 256.

about AXI_VFIFO

I tried to use the AXI_vfifo module you wrote, and I tried to configure it as a single channel FIFO. The other side is connected to a DDR MIG controller, it seems that the input of the FIFO is normal, and the AXI reading and writing of the MIG are also normal, but the FIFO has no output. I don't know where the problem lies at the moment

AXI Lite interconnect in N to 1 configuration

Hi Mr Forencich,

First of all, thank you very much for all your work on this repository and for publishing this.

I'm currently trying tu use your axil_interconnect IP in a N to 1 configuration, in order to connect several Masters outputs to a single Slave input.

However, I have a problem using this module. I tried to do a test-bench with Cocotb with the following setup for the axil_interconnect component :

S_COUNT = 2,
M_COUNT = 1,
DATA_WITH = 32,
ADDR_WIDTH = 32,
M_BASE_ADDR = 0,
M_ADDR_WIDTH = 32

In the Cocotb test-bench I then defined 2 AxiLiteMaster connected to the 2 input ports and an AxiLiteRam on the output bus. But during the execution of the test, it blocks when writing on the input ports.

I guess I'm setting up the parameters wrong, I'm having trouble understanding the purpose of M_BASE_ADDR and M_ADDR_WIDTH. Could you please give me some advice on how to get the AXI Lite interconnect to work in an N to 1 configuration?

Thanks in advance :)

CDC module

Hi, sir
I have tried to write CDC module, and I understand how to write async FIFO(using gray code), but I don't know how to make axi-full interface. For example, how should ID signals and address signals be saved in async FIFO?
And may I take the liberty to ask if you could write axi-full cdc first? ToT

axi_interconnect question

Hey @alexforencich,

about the axi_interconnect module, could you give an example of how to create the memory map of masters / slaves using your design? I'm bit confused of how to define it like exists for instance in the bus matrix from ARM. Basically in the bus matrix you have a xml where you define the relation between m+s and then generates the design of the interconnect, in your case I suppose we handle the parameters of the design, but how exactly I can tweak it to have a scenario like this:

  __________________
| 0x0000 | slave # 0 |
| 0x1000 | slave # 1 |
| 0x4000 | slave # 2 |
| 0x5000 | slave # 3 |
| 0x6000 | slave # 4 |
  ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻

Why assume packet smaller than max burst size when AXI_MAX_BURST_SIZE >=4096?

axi_dma_wr lines 465
if (op_word_count_reg <= AXI_MAX_BURST_SIZE - (addr_reg & OFFSET_MASK) || AXI_MAX_BURST_SIZE >= 4096) begin
// packet smaller than max burst size
https://github.com/alexforencich/verilog-axi/blob/38915fb5330cb8270b454afc0140a94489dc56db/rtl/axi_dma_wr.v#LL465C26-L465C26

If AXI_MAX_BURST_LEN set to 256 and AXI_DATA_WIDTH set to 128, the AXI_MAX_BURST_SIZE will be 4096, it will always go to the 'if' and assume the packet smaller than max burst size, if we send a data stream large than the max burst size, the axi_dma will hanging.
Did I miss some limitation of the axi_dma?

application problem

Hi, Alex
Can Axi-interconnect be used in ASIC? And I want to apply it to a school teaching project.
Thanks,
Tuuyii

questions about axicrossbar

hey sir :
I just start learning axi stuff, when i read pg059-axi-interconnect [xilinx], im confused about 'Avoiding Deadlock Using Single Slave Per ID', i want to know if you implement this function in axi crossbar? and what part of the code achieved that?
Thanks a lot.

question about axi_ram

Dear Alex,
I have a question about the module of axi_ram. When you use "initial begin end " to initialize the mem[(2**VALID_ADDR_WIDTH)-1:0], should you use "VALID_ADDR_WIDTH" instead of "ADDR_WIDTH"? The attached files is more explicit. I am looking forward to your answer.Thanks!
1574171937(1)

Parametrization doesn't work correctly in testbenches

The data_width parameter is constant 32 in the tests according to logs, despite it having been defined to take values from the [8, 16, 32] range.

 90890.02ns INFO     AXI lite master configuration:
 90890.02ns INFO       Address width: 32 bits
 90890.02ns INFO       Byte size: 8 bits
 90890.02ns INFO       Data width: 32 bits (4 bytes)
 90890.02ns INFO     AXI lite master signals:
 90890.02ns INFO       awaddr width: 32 bits
 90890.02ns INFO       awprot width: 3 bits
 90890.02ns INFO       awready width: 1 bits
 90890.02ns INFO       awvalid width: 1 bits
 90890.02ns INFO       wdata width: 32 bits
 90890.02ns INFO       wready width: 1 bits
 90890.02ns INFO       wstrb width: 4 bits
 90890.02ns INFO       wvalid width: 1 bits
 90890.02ns INFO       bready width: 1 bits
 90890.02ns INFO       bresp width: 2 bits
 90890.02ns INFO       bvalid width: 1 bits

Logs for all tests show 32-bit data width.

Missing WID signal in axi_ram

AXI specification requires a WID signal which should match AWID of the corresponding address.

Edit: My fault that I missed that AXI4 removed this signal.

Correct understanding of axi_dma

Hey @alexforencich,

thanks for the IPs, such amazing job for the open source community! I have a question for you about the axi_dma design, basically from my understanding the write descriptors interface (s_axis_write_desc_*) configures the way the s_axis_write_data* will be reflected/processed in the m_axi_aw/w channels so if you see the image below, in this test, the descriptor length is 7 bytes. I see that in the write address channel you launch a two beat burst due to fact you can only send 4 bytes per beat. Although in the write data channel I see that you only send 5 bytes, is this because the randomisation of the test didn't set the other 2x tkeep bits and you just mirror the same in the write data channel or am I missing something? why the descriptor finishes with only 5 bytes transferred?

Screenshot 2021-07-30 at 10 39 07

questions about about the AXI_DMA module

Hi,I have some problems about the AXI_DMA module,what does parameter OFFSET_WIDTH,OFFSET_MASK,ADDR_MASK and CYCLE_COUNT_WIDTH mean?Can I ask you for a AXI_DMA_RD_TB.V and AXI_DMA_WR_TB.V file?Maybe can help me understand this module,thanks.

tb simulation failed

I am getting following error during test bench execution

make -C axi_ram/. all
make[1]: Entering directory '/hdd2/verilog-axi/tb/axi_ram'
rm -f results.xml
make -f Makefile results.xml
make[2]: Entering directory '/hdd2/verilog-axi/tb/axi_ram'
rm -f results.xml
MODULE=test_axi_ram TESTCASE= TOPLEVEL=axi_ram TOPLEVEL_LANG=verilog \
         /usr/bin/vvp -M /home/apisal/.local/lib/python3.6/site-packages/cocotb/libs -m libcocotbvpi_icarus   sim_build/sim.vvp -fst
     -.--ns INFO     gpi                                ..mbed/gpi_embed.cpp:78   in set_program_name_in_venv        Did not detect Python virtual environment. Using system-wide Python interpreter
     -.--ns INFO     gpi                                ../gpi/GpiCommon.cpp:101  in gpi_print_registered_impl       VPI registered
     0.00ns INFO     cocotb                             Running on Icarus Verilog version 10.1 (stable)
     0.00ns INFO     cocotb                             Running tests with cocotb v1.7.2 from /home/apisal/.local/lib/python3.6/site-packages/cocotb
     0.00ns INFO     cocotb                             Seeding Python random module with 1677128929
     0.00ns CRITICAL cocotb.regression                  Failed to import module test_axi_ram: No module named 'cocotb._vendor.find_libpython'
     0.00ns INFO     cocotb.regression                  MODULE variable was "test_axi_ram"
     0.00ns INFO     cocotb.regression                  Traceback: 
     0.00ns INFO     cocotb.regression                  Traceback (most recent call last):
                                                          File "/home/apisal/.local/lib/python3.6/site-packages/cocotb/regression.py", line 189, in _discover_tests
                                                            module = _my_import(module_name)
                                                          File "/home/apisal/.local/lib/python3.6/site-packages/cocotb/regression.py", line 72, in _my_import
                                                            mod = __import__(name)
                                                          File "/home/apisal/.local/lib/python3.6/site-packages/_pytest/assertion/rewrite.py", line 171, in exec_module
                                                            exec(co, module.__dict__)
                                                          File "/hdd2/verilog-axi/tb/axi_ram/test_axi_ram.py", line 30, in <module>
                                                            import cocotb_test.simulator
                                                          File "/home/apisal/.local/lib/python3.6/site-packages/_pytest/assertion/rewrite.py", line 171, in exec_module
                                                            exec(co, module.__dict__)
                                                          File "/home/apisal/.local/lib/python3.6/site-packages/cocotb_test/simulator.py", line 13, in <module>
                                                            import cocotb._vendor.find_libpython as find_libpython
                                                        ModuleNotFoundError: No module named 'cocotb._vendor.find_libpython'
                                                        
     0.00ns ERROR    gpi                                Passing event to upper layer failed
/home/apisal/.local/lib/python3.6/site-packages/cocotb/share/makefiles/simulators/Makefile.icarus:75: recipe for target 'results.xml' failed
make[2]: Leaving directory '/hdd2/verilog-axi/tb/axi_ram'
/home/apisal/.local/lib/python3.6/site-packages/cocotb/share/makefiles/Makefile.inc:39: recipe for target 'sim' failed
make[1]: Leaving directory '/hdd2/verilog-axi/tb/axi_ram'
Makefile:27: recipe for target 'axi_ram/.' failed

AXI interconnect/crossbar hanging while mult. writes

Hey @alexforencich,

I'm using your axi_interconnect design to build a small SoC and I'm having an issue where a CPU is hanging due to the intcon not being available to receive more requests. The configuration for the interconnect is:

axi_interconnect_wrapper #(
    .N_MASTERS        (2),
    .N_SLAVES         (4),
    .M_BASE_ADDR      ({32'hB000_0000, 32'hA000_0000, 32'h8000_0000, 32'h1000_0000}),
    .M_ADDR_WIDTH     ({32'd17, 32'd17, 32'd17, 32'd17})
  ) u_axi_intcon (
    .clk              (clk),
    .arst             (rst_int),
    .*
  );

Basically M0 is CPU fetch I/F (only rd requests) and M1 is CPU I/F LSU, and the 4x slaves are AXI memories. I'm attaching the waves and a template for gtkwave if you can take a look and have a better guess but it's not that clear what can lead to such scenario. Also, is there a way/config to improve the interconnect throughput?

Screenshot 2022-02-22 at 17 34 16

Archive.zip

AXI Reset Signal

Hi,

This is a nice library, but I think the reset signals should be active low as defined by the protocol.

Cheers

Circular logic in axi_crossbar

Verilator complains about circular logic in several places.
I believe most of them are false positive, but I'm not sure about this one, thread_trans_start:

assign thread_trans_start[n] = (thread_match[n] || (!thread_active[n] && !thread_match && !(thread_trans_start & ({S_INT_THREADS{1'b1}} >> (S_INT_THREADS-n))))) && trans_start;

I met a question about simulation, please some one help me?

there are the same error when I sim the tb module or make all clean.
`make: Entering directory “/home/ICer/ic_prjs/github_AXI_prj/verilog-axi-master/tb/axi_adapter”
rm -f results.xml
make -f Makefile results.xml
make[1]: Entering directory “/home/ICer/ic_prjs/github_AXI_prj/verilog-axi-master/tb/axi_adapter”
mkdir -p sim_build
/usr/local/bin/iverilog -o sim_build/sim.vvp -D COCOTB_SIM=1 -s axi_adapter -P axi_adapter.M_DATA_WIDTH=32 -P

axi_adapter.ADDR_WIDTH=32 -P axi_adapter.BUSER_WIDTH=1 -P axi_adapter.CONVERT_BURST=1 -P axi_adapter.WUSER_WIDTH=1 -P axi_adapter.BUSER_ENABLE=0 -P axi_adapter.FORWARD_ID=1 -P axi_adapter.WUSER_ENABLE=0 -P axi_adapter.S_STRB_WIDTH=4 -P axi_adapter.RUSER_WIDTH=1 -P axi_adapter.ARUSER_WIDTH=1 -P axi_adapter.S_DATA_WIDTH=32 -P axi_adapter.AWUSER_WIDTH=1 -P axi_adapter.CONVERT_NARROW_BURST=1 -P axi_adapter.RUSER_ENABLE=0 -P axi_adapter.ID_WIDTH=8 -P axi_adapter.M_STRB_WIDTH=4 -P axi_adapter.ARUSER_ENABLE=0 -P axi_adapter.AWUSER_ENABLE=0 -f sim_build/cmds.f -g2012 ../../rtl/axi_adapter.v ../../rtl/axi_adapter_wr.v ../../rtl/axi_adapter_rd.v

rm -f results.xml
MODULE=test_axi_adapter TESTCASE= TOPLEVEL=axi_adapter TOPLEVEL_LANG=verilog
/usr/local/bin/vvp -M /usr/local/lib64/python3.6/site-packages/cocotb/libs -m libcocotbvpi_icarus sim_build/sim.vvp -fst
-.--ns INFO gpi ..mbed/gpi_embed.cpp:78 in set_program_name_in_venv Did not detect Python virtual environment. Using system-wide Python interpreter
-.--ns INFO gpi ../gpi/GpiCommon.cpp:101 in gpi_print_registered_impl VPI registered
FST support disabled since zlib not available
make[1]: *** [/usr/local/lib64/python3.6/site-packages/cocotb/share/makefiles/simulators/Makefile.icarus:95:results.xml] error 1
make[1]: Leaving directory “/home/ICer/ic_prjs/github_AXI_prj/verilog-axi-master/tb/axi_adapter”
make: *** [/usr/local/lib64/python3.6/site-packages/cocotb/share/makefiles/Makefile.inc:40:sim] error 2
make: Leaving directory “/home/ICer/ic_prjs/github_AXI_prj/verilog-axi-master/tb/axi_adapter”`

I have installed:
$ pip3 install cocotb
$ pip3 install cocotb-bus
$ pip3 install cocotb-test
$ pip3 install cocotbext-axi
$ pip3 install cocotbext-eth
$ pip3 install cocotbext-pcie
$ pip3 install pytest
$ pip3 install scapy
$ pip3 install tox
$ pip3 install pytest-xdist
$ pip3 install pytest-sugar

the python version is 3.6
cocotb version is 1.8.0

So what should I to do for these errors?

update python version?

please

Documentation for axil_interconnect

I am using axil_interconnect with this configuration (ADDRESS_WIDTH = 16)

axil_interconnect_wrap_1x4 #(
    .DATA_WIDTH(32),
    .ADDR_WIDTH(ADDRESS_WIDTH),
    .M_REGIONS(1),
    .M00_ADDR_WIDTH(ADDRESS_WIDTH),
    .M01_ADDR_WIDTH(ADDRESS_WIDTH),
    .M02_ADDR_WIDTH(ADDRESS_WIDTH),
    .M03_ADDR_WIDTH(ADDRESS_WIDTH),
    .M00_BASE_ADDR(16'h1000),
    .M01_BASE_ADDR(16'h2000),
    .M02_BASE_ADDR(16'h3000),
    .M03_BASE_ADDR(16'h4000)
)

I am getting this error

INFO cocotb: Region not aligned:
INFO cocotb:  0 ( 0): 1000 / 16 -- 0000-ffff

Is there somewhere a documentation how the parameters of this core work?

Range of part-select into 'addr_reg' is reversed, modelsim error in axi_adapter

Hi, first of all excellent library, many thanks for releasing it.

Playing with axi_adapter.v going from a 256 bit wide slave to a 128 bit master.

so we have
.S_DATA_WIDTH (256),
.S_STRB_WIDTH (32),
.M_DATA_WIDTH (128),
.M_STRB_WIDTH (16),

M_ADDR_BIT_OFFSET is 4
S_ADDR_BIT_OFFSET is 5

in axi_adapter_wr/rd we have several places where this happens :
** Fatal: (vsim-3373) replay_common/lib/axi/axi_adapter_wr.v(385): Range of part-select into 's_axi_awaddr' is reversed.

s_axi_awaddr[M_ADDR_BIT_OFFSET-1:S_ADDR_BIT_OFFSET])
would be:

s_axi_awaddr[3:5])

and modelsim (correctly) complains that this range is backwards.
I'm assuming the logic requires s_axi_awaddr[5:3]) in this case?

In which case I'm wondering if a pragmatic solution may be to swap the two constants over if
M_ADDR_BIT_OFFSET < S_ADDR_BIT_OFFSET

edit that doesn't work, but perhaps a H and L offset in addition to the above.

I'm guessing the simulator you are using doesn't error on this?
Best,
Mike

Quick question about clock domain crossing (CDC)

Hi Alex,

Do you plan to add support for "auto" clock domain crossing between master and slaves? E.g. I have multiple slaves that operate in different domains of each other. Now, all my writing and reading of register in the slave needs to go through CDC as the AXI bus is operating in another domain. However, if the bus itself were CDC'd for each slave in another domain than the master, a lot of hassle could be avoided. I also think I would save a lot of resources.

I understand completely if this is far fetched :)

Ola

Q: Do axi_dma_rd and axi_dma_wr support out of order transactions?

I'm planning to use your DMAs in a high performance design. Since DDR delivers data after several clocks, it would be ideal if the DMA can issue multiple outstanding AXI transactions, without waiting for each transaction to complete.

Is this feature already included? Or are you planning to add it in the future?

Btw, thanks a lot for this amazing repo!!

question: how to read this syntax?

Hi, this isnt an issue, it's a question, about verilog, since you're using a notation I haven't seen before, and not quite sure how to Google.

At e.g.

reg [7:0] m_axi_awlen_reg = 8'd0, m_axi_awlen_next;

reg [7:0] m_axi_awlen_reg = 8'd0, m_axi_awlen_next;

So, I'm interpreting this to mean that, you create an 8 bit register m_axi_awlen_reg, and assign it the value of m_axi_awlen_next. However, I'm not sure what the 8'd0, does? I'm guessing it does something like assert the number of bits in m_axi_awlen_next? (I looked through verilog-std-1364-2005.pdf, eg section 6.2, 9.2, but wasn't able to find the relevant syntax).

AXI interconnect

Hi ,
I like to use AXI interconnect , I am going to connect 3 slave device to the master IO of interconnect , I want to have different base address , How to det different base address.

About CDC module

Hi, sir
I have some questions about the synchronization techniques.

  1. Is your axil-CDC implemented with dual latches? Or MCP formulation?

  2. I want to implement a axi-full cdc module. so, for AXI-Full , is clock domain synchronization implemented using an asynchronous FIFO?

Sorry to bother you. ^ ^. I'm a little weak on the basics, so I'm hoping for your help badly! Thank you!
Best wishes.

Support read data interleaving

None of the components currently support read data interleaving. I think the only module this affects is the AXI crossbar.

AXIL crossbar doesn't support M_ADDR_WIDTH < 12

Hi,

I've checked out you "verilog-axi" repo (which is really cool and contains pretty much all the AXI tools) and I've found a bug in the AXIL crossbar where it doesn't support M_ADDR_WIDTH < 12. I've created a testbench with one master and 2 slaves and it works perfectly for M_ADDR_WIDTH >= 12, but asserts an error for M_ADDR_WIDTH < 12.

The root cause is in axil_register_wr.v (line 131), in axil_register_rd.v (line 119) and in axil_crossbar_addr.v (line 138). Looking at the AXIL interconnect, I've found that this limitation doesn't exist, so I copied the address check in the AXIL crossbar (M_ADDR_WIDTH[i*32 +: 32] < 0) and it works perfectly fine.

Is there any reason for not supporting M_ADDR_WIDTH < 12 ?

By the way, the AXI crossbar (not AXIL) also has the same limitation.

Thanks.

Martin Tanguay

Question on address decoder to determine master interface

I took some time to understand the code below and has the following question

for (i = 0; i < M_COUNT; i = i + 1) begin for (j = 0; j < M_REGIONS; j = j + 1) begin if (M_ADDR_WIDTH[(i*M_REGIONS+j)*32 +: 32] && (!M_SECURE[i] || !axi_prot_reg[1]) && ((read ? M_CONNECT_READ : M_CONNECT_WRITE) & (1 << (s_select+i*S_COUNT))) && (axi_addr_reg >> M_ADDR_WIDTH[(i*M_REGIONS+j)*32 +: 32]) == (M_BASE_ADDR_INT[(i*M_REGIONS+j)*ADDR_WIDTH +: ADDR_WIDTH] >> M_ADDR_WIDTH[(i*M_REGIONS+j)*32 +: 32])) begin m_select_next = i; axi_region_next = j; match = 1'b1; end end end

May I know why it is necessary to have a long if condition list? For example...

M_ADDR_WIDTH[(i*M_REGIONS+j)*32 +: 32] <==This will be always TRUE no matter how as long as user define those parameters.

((read ? M_CONNECT_READ : M_CONNECT_WRITE) <== This will be always TRUE as well.

I might be wrong in my interpretation.
If you don't mind, could you please share probably they is a strong reason to have this checking?

Endianness of axis_fifo_adapter

I'm using the axis_fifo_adapter with an input data width of 32 and output data width of 8. I was surprised to see that the output data stream seems to come out in little endian. For example if the input data word is "DEAD_BEEF", it's coming out of the FIFO as "EF", "BE", "AD", "DE".

Is this by design? I would have expected the fifo to use Netowrk byte order or have an option to do that. Am I doing something wrong?

AXI DMA never gives out a ready HIGH

I am using AXI DMA and AXI RAM to implement a on-chip RAM accessed through DMA engine.
The files I used are axi_dma.v, and axi_ram.v

The problem is that I found s_axis_write_desc_ready and s_axis_read_desc_ready coming from the DMA engine were always 0 no matter what inputs I gave into.

This is a screenshot of how I generate the AXI_DMA module and connect them to the outside world. I made write_enable always be 1 but still failed
image

Any ideas about what would possibly be the reasons?

Thank you

awready and wready set high in master without slave value

I am a newbie to axi-lite. I was trying to mimic the example figure in the documentation.
I have 1x1 crossbar. My master awchannel and wchannel are the following. From the slave side I assign awready and wready to 0. But I see these signals asserts themselves in master. Is it bug, or am I missing something?

// w_en signal is external signal from testbench.
// aw channel
always_ff @(posedge clk) begin
   if (rst) begin
		awaddr  <= 32'h0;
		awvalid <= 1'b0;
		su_addr <= DEFAULT_VAL;
   end
	else if(w_en) begin
		awvalid <= 1'b1;
		awaddr <= su_addr;
	end
	else awvalid <= 1'b0;
end 

// wchannel
always_ff @(posedge clk) begin
   if(rst) begin
		wvalid <= 1'b0;
		su_data <= DEFAULT_VAL;
	end
   else if(w_en) begin
		 wvalid <= 1'b1;
		 wdata <= su_data;
	  end
	else wvalid <= 1'b0;
end

Screenshot from 2023-05-18 13-04-14

questions about data transfer order

Hi @alexforencich
when i read the file axi_cdma.v , I have a question about the data transfer order. when output is not ready , data will be stored in the temp. When output is ready in the next cycle, the data in temp should be sent to the output first. But in line 773, int_to_output has the highest priority, and the input data is sent directly to output, skipping the data in temp.
The reg m_axi_wready_int_reg is only associated with input status,so I wonder if there's a problem with the logic here.

(line 773,axi_cdma.v)

if (m_axi_wready_int_reg) begin
    // input is ready
    if (m_axi_wready || !m_axi_wvalid_reg) begin
        // output is ready or currently not valid, transfer data to output
        m_axi_wvalid_next = m_axi_wvalid_int;
        store_axi_w_int_to_output = 1'b1;
    end else begin
        // output is not ready, store input in temp
        temp_m_axi_wvalid_next = m_axi_wvalid_int;
        store_axi_w_int_to_temp = 1'b1;
    end
end else if (m_axi_wready) begin
    // input is not ready, but output is ready
    m_axi_wvalid_next = temp_m_axi_wvalid_reg;
    temp_m_axi_wvalid_next = 1'b0;
    store_axi_w_temp_to_output = 1'b1;
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.