FPGA Internal Interface Design: AXI vs. Custom Protocols
Most FPGA designs follow a top-down methodology. You start with a high-level functional block diagram and a data flow map, then decompose those functions into primary modules, which further break down into secondary and tertiary sub-modules. While designing the logic inside these modules is the primary task, the method used to connect them—the internal module interface—is just as critical for a successful design.
The Role of Internal Interfaces 🏗️ #
How you connect modules determines the scalability, timing closure, and ease of debugging for your entire project. Choosing the right interface depends on whether the module is intended for external integration or internal data movement.
The Standard Choice: AXI Interfaces 🔌 #
Modern Xilinx and Intel IP cores predominantly support AXI interfaces. It is the industry standard for a reason. Because it is so widely adopted, using AXI ensures high portability. If you design a module with an AXI interface, it can be dropped into various projects without modifying the interface logic or worrying about misaligned protocol interpretations.
This standardization is a major advantage when interfacing with external customers or partners. It minimizes communication overhead and reduces the risk of integration errors. However, AXI is complex. If your design is strictly internal—meaning it won’t be shared outside your team or reused in different projects—the overhead of AXI might be unnecessary. In these cases, simpler, specialized interfaces often perform better.
The Handshake: Req-Ack Protocols 🤝 #
For low-speed, non-cached data transfers where modules have mutual dependencies, a Req-Ack (Request-Acknowledge) interface is a reliable choice.
In this scheme, the requestor sends a req signal before transmitting data. The data remains stable on the bus while the requestor waits for the responder to process it. Once the responder finishes, it returns an ack signal, signaling the completion of one data transfer.
This interface is ideal for scenarios where performance is secondary to resource efficiency. Because the data is held constant until the ack is received, the design does not require complex buffering. It is a “stop-and-wait” mechanism where both sides are tightly coupled. While it saves on hardware resources, it limits throughput compared to streaming methods.
Streaming Interfaces for High Throughput 🌊 #
When high-speed data movement is the priority, a streaming interface—similar to a FIFO write interface—is often the best fit. A typical private streaming interface uses five primary signals:
data_vld: Indicates the current data is valid.data: The actual data payload.data_sop: Indicates the Start of Packet.data_eop: Indicates the End of Packet.data_index: User-defined metadata (often valid duringsoporeop).data_afull: A backpressure signal notifying the sender to stop.
This setup allows for high decoupling. As long as the receiver does not assert data_afull, the sender can push data continuously. It is simple to implement and offers high performance for internal data pipelines.
AXI-Stream vs. Custom Streaming ⚖️ #
A common question is why engineers would use a private streaming interface instead of the standard AXI-Stream protocol. The two are very similar, but the handling of backpressure differs significantly.
In a private interface, the sender can continue pushing data as long as data_afull is low. In the AXI-Stream protocol, the relationship between vld and ready is strictly defined. The protocol dictates that these signals should not have complex inter-dependencies, which can make internal logic slightly more cumbersome to implement.
Furthermore, in many private designs, even after afull is asserted, the sender might still be able to push 2-3 extra cycles of data. This provides a small buffer that simplifies timing logic. AXI-Stream requires vld and ready to be high simultaneously for a successful transfer, which demands stricter timing alignment.
For internal module design, the goal is to prioritize simplicity, reliability, and high performance without unnecessary dependencies. Use industry standards like AXI for external-facing boundaries, but lean toward streamlined, private protocols for internal communication. For complex real-time hardware interactions, understanding these underlying protocols is essential for maintaining system stability, much like the principles found in VxWorks for real-time operating systems.