element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Chaining AXI Streams together
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: tcmichals
  • Date Created: 26 Aug 2020 4:05 AM Date Created
  • Views 474 views
  • Likes 0 likes
  • Comments 0 comments
Related
Recommended

Chaining AXI Streams together

tcmichals
tcmichals
26 Aug 2020

Background

 

In my last blog there was an example of a AXI Stream between the DMA IP and UART IP, here the module definition (from github)

 

module uart_axis #(    parameter CLKS_PER_BIT = 16 )

(

    /*

     */

    input  wire       axis_aclk,

    input  wire       axis_reset,

 

    /*

     * AXI input

     */

    input  wire [7:0]  s_axis_tdata,

    input  wire        s_axis_tvalid, 

    output wire        s_axis_tready,

 

    /** AXI output   */

    output wire [7:0]  m_axis_tdata,

    output wire        m_axis_tvalid,

    input  wire        m_axis_tready,

    output wire         m_axis_tlast,

 

    /*

     * UART: 1200000 bps, 8N1

     */

    input  wire       uart_rxd,

    output wire       uart_txd

      

);

 

DMA IP connects to m_axis_* and s_axis, and uses tready as flow control.  It is possible to chain several of these modules together m_axis to s_axis.  Instead of having one big file, connect each one back to back.

Serial protocol

The microblaze handles a lot of the encoding/decoding/CRC of the packet, see basicProtocol::onRecv and basicProtocol::sendPacket protocol.h in github.  So, I have been working breaking up the code into 3 AXI streams

  1. CRC AXI Stream module to do append a CRC at the end of the data (this replace computing the CRC in basicProtocol::sendPacket.
    1. There is a good Verilog code generator to create the proper code to calculate a CRC in parallel for a user defined polynomial.  For code example see github here is a simple test-bench
    2. Wrapped the CRC code to reset the CRC back to 0xFFFF and add it to the end of the stream when TLAST is asserted.  See github)
  2. AXI Stream to perform the packet formatting, the last part of the function basicProtocol::sendPacket.
    1. The first byte of the packet must be SOP (0x7E)
    2. If the SOP, EOP or ESC is in data stream replace with ESC and add the data xor'ed with 0x20.
  3. AXI Stream for TX serial.

 

I have been working on a single test bench using verilator to use the C++ code to generate ping  (without CRC and ESC processing) send it to the Verilog stream for calculating the CRC and ESC formatting then pipe the bytes back to C++ for decoding.  (That will be the next blog)  Here is a start of the test bench.

  • Makefile
  • axis_tx_protocol_tb.cpp
  • axis_tx_protocol_tb.v
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube