Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Avalon Streaming simple example

Hi,

does anybody have a simple example of avalon streaming implementation? I have a system with huge amont of serial data and I want to use avalon streaming interface. simple example will give me an idea of starting point.

thanks:)

14 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It's as many symbols as you want. Symbols are similar to bytes in Avalon-MM where it's a unit of data. So you could have for example a 32-bit data port that has four 8-bit symbols, two 16-bit symbols, or a single 32-bit symbol for example (could even have 1-bit symbols although that's usually not useful). Every transfer of data (valid = 1 and ready = 1) the full width of the data is transferred which will be one or more symbols. The restriction is that the data width must be a multiple of the symbol size, or in other words DATA_WIDTH mod SYMBOL_SIZE must equal 0.

    If you are designing a streaming block that needs to hook up to some other streaming block, I recommend taking a look at the symbol size of other block. If you took two 32-bit streaming ports, one of which uses 8-bit symbols and another that uses 16-bit symbols Qsys won't be able to connect them. So if you check ahead of time on the symbol size you can save yourself work later one making gaskets that adapt one symbol size to another.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks BadOmen for the great response!

    That makes sense. If I am writing to an on-chip memory where each memory cell is a byte, Qsys tells me that the memory's Avalon-MM slave input has symbol width of 8, because each cell is 8 bits. Therefore my signal coming into that memory must also have a symbol width of 8.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    That's correct, Avalon-MM even has a concept of symbols. 99.9999999% of the time a symbol will be 8 bits (byte) but the reason why even the memory mapped standard supports non-eight bit bytes is for things like transporting parity or ECC information along with the data.

    In general if you are moving data between Avalon-ST and Avalon-MM (i.e. a DMA) then usually you use the same symbol size. If you are moving data between ST and MM pay close attention to symbol ordering because most ST IP has the least significant symbol in the MSBs (some people call this big endian.... but 'network order' is the more appropriate name for it) while MM IP is little endian. Some IP blocks are written without the developer knowing about this which can lead to symbols getting flipped around between the two domains.