Coder Social home page Coder Social logo

Comments (8)

alexforencich avatar alexforencich commented on May 22, 2024

Not sure what the issue is. If max burst size is larger than 4096, then the only thing that can split a burst is a 4kb address boundary. If I remove that check, then the only line in the lower block that gets hit would be when a 4kb boundary is crossed, and this is handled by the top block in exactly the same way so doing a separate check based on the burst length is not necessary.

from verilog-axi.

alexforencich avatar alexforencich commented on May 22, 2024

Think about it like this: this code is splitting the requested transfer into valid bursts. The burst must end either 1. when the configured max burst size is met, 2. when a 4 kb address boundary is reached, or 3. at the end of the transfer.

The max burst size is checked first (op_word_count_reg <= AXI_MAX_BURST_SIZE - (addr_reg & OFFSET_MASK)). If this check passes, then the requested transfer should fit into one burst. Then, the 4k boundary crossing is checked (addr_reg[12] != addr_plus_max_burst[12]). But here's the thing: if AXI_MAX_BURST_SIZE is 4096 or greater, the transfer will either fit into a burst or it will cross a 4kb address boundary, so in this case the max burst size check can be skipped completely because the 4kb address boundary check will ensure that the burst size is capped at 4096, which can only happen when the transfer starts on a 4kb address boundary.

If I remove || AXI_MAX_BURST_SIZE >= 4096, then when AXI_MAX_BURST_SIZE is 4096 or larger and the op_word_count_reg <= AXI_MAX_BURST_SIZE - (addr_reg & OFFSET_MASK) check fails, addr_reg[12] != addr_plus_max_burst[12] will also be true and the burst will end on the address boundary. The line tr_word_count_next = AXI_MAX_BURST_SIZE - (addr_reg & OFFSET_MASK); is unreachable. The whole point of || AXI_MAX_BURST_SIZE >= 4096 is to save some logic resources by removing the redundant op_word_count_reg <= AXI_MAX_BURST_SIZE - (addr_reg & OFFSET_MASK) comparison.

from verilog-axi.

luyong6 avatar luyong6 commented on May 22, 2024

Here is the problematic waveform:
AXI_MAX_BURST_SIZE = 4096
len = 0xfb1c

DATA_WIDTH = 128bit (16Bytes)
Starting Address = 0 (I have appended several higher bits)
There should be 15 full 4K bursts and 1 'end of the transfer'.
However, only two ARVALID were sent and the second ARLEN was wrong.
image

from verilog-axi.

alexforencich avatar alexforencich commented on May 22, 2024

Alright, it looks like my 'optimized' check for 4k boundary crossings is problematic. I will rework that.

from verilog-axi.

alexforencich avatar alexforencich commented on May 22, 2024

Try replacing

if (addr_reg[12] != addr_plus_count[12]) begin

with

if (((addr_reg & 13'hfff) + (op_word_count_reg & 13'hfff)) >> 12 != 0 || op_word_count_reg >> 12 != 0) begin

and let me know what happens.

from verilog-axi.

alexforencich avatar alexforencich commented on May 22, 2024

I just committed those changes to the repo, try it out and see if that bug is fixed.

from verilog-axi.

luyong6 avatar luyong6 commented on May 22, 2024

Yes, It has been fixed. Thank you Alex!
image

from verilog-axi.

alexforencich avatar alexforencich commented on May 22, 2024

Good to hear!

from verilog-axi.

Related Issues (20)

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.