Professional Documents
Culture Documents
Assignment-1
Assignment-1
Objective
● Understanding the AXI stream interface protocol
● Learning the implementation insights of AXIS interfaces
using Verilog/System Verilog
Assignment - 1
● Implement an 8-bit register with AXI stream interface on
both inputs and outputs
● Use only the DATA, VALID, READY, and LAST signals in
all the interfaces
● Verify its functionality using testbench in simulation.
Introduction to the module and its functionality
Handshake signaling
This section gives details of the handshake signaling and defines the
relationship of the TVALID and TREADY signals. The TVALID and
TREADY handshake determines when information is passed across the
interface. A two-way flow control mechanism enables both the
Transmitter and Receiver to control the rate at which the data and
control information is transmitted across the interface. For a transfer to
occur, both TVALID and TREADY must be asserted. Either TVALID
or TREADY can be asserted first, or both can be asserted in the same
ACLK cycle. A Transmitter is not permitted to wait until TREADY is
asserted before asserting TVALID. Once TVALID is asserted, it must
remain asserted until the handshake occurs. A Receiver is permitted to
wait for TVALID to be asserted before asserting TREADY. It is
permitted that a Receiver asserts and deasserts TREADY without
TVALID being asserted. The following sections give examples of the
handshake sequence.
1. Handshake with TVALID asserted before TREADY
In Figure 1, the Transmitter presents the data and control
information and asserts TVALID as HIGH. The valid data bytes
and control information from the Transmitter must remain
unchanged once TVALID has been asserted by the Transmitter.
The Receiver can accept the data and control information once
TREADY is HIGH. The transfer takes place once the Receiver
asserts TREADY HIGH. Figure 1 shows the transfer occurs at T3.
Figure 1:
Handshake with
TVALID asserted
before TREADY
Figure 2:
Handshake with
TREADY
asserted before
TVALID
3. Handshake with TVALID and TREADY asserted simultaneously
In Figure 3, the Transmitter asserts TVALID HIGH and the
Receiver asserts TREADY HIGH in the same ACLK cycle. In this
case, the transfer takes place in the same cycle, as shown in T2 of
Figure 3.
Figure 3:
Handshake with
TVALID and
TREADY asserted
simultaneously
The TLAST when deasserted, indicates that another transfer can follow.
This means it is acceptable to delay the current transfer to upsize,
downsize, or merge. When asserted, TLAST can be used by a
destination to indicate a packet boundary and it indicates an efficient
point to make an arbitration change on a shared link.
I/O Details:
Inputs
● [7:0] data
● valid
● ready
● last
● clk
● Reset
Outputs
● [7:0] out
● [3:0] frame_count
Implementation Approach
Functional Microarchitecture:
The module acts as an 8-bit register that captures input data (data) when
both the ready and valid signals are asserted. It holds the captured data
(out) until the next valid input arrives. Additionally, it keeps track of the
number of frames received (frame_count) based on the last signal.
FSMs (Finite State Machines):
The module does not explicitly use FSMs. However, it implicitly defines
two states:
State 1: Waiting for valid input (ready and valid not asserted)
State 2: Capturing and holding input data (ready and valid asserted)
Algorithms Chosen:
The algorithm chosen is straightforward:
On every positive clock edge, if the reset signal is asserted, the register
is cleared (out becomes 8'h00).
If ready and valid are both asserted, the incoming data is captured into
the out register.
The last signal indicates the end of a frame. When the last is asserted,
the frame_count is incremented by one.
Interface Choice:
The module uses a synchronous interface with the following signals:
data: Input data bus (8 bits) valid: Input data valid signal
ready: Output data ready signal last: Indicates the end of a frame
clk: Clock signal reset: Reset signal
out: Output data bus (8 bits) frame_count: Output frame count
(4 bits)
Pipeline Architecture:
The module does not employ a pipeline architecture. It operates on a
single clock cycle and processes input data when it becomes valid.
Test by Developer:
The test approach was a simple Test bench with data being assigned
randomly and control signals, or simply input signals are assigned in
different possible combinations.
Test Report:
Overall Test Statistics
Total number of test cases executed: 6
Total number of passed test cases: 6
Total number of failed test cases: 0
Test case - 1:
Reset is
inserted
Test case - 2:
Ready and
valid are
asserrted
Test case - 3: Ready is deasserted and valid is asserted
Test case - 4: Ready is asserted and valid is deasserted
Test case - 5: Last is asserted
Test case - 6:
Both ready
and valid are
deasserted
Performance Details
Schematic:
https://github.com/Yasshwanhya/FPGA-project/blob/main/ima.pdf
Deliverables
Source code link:
https://github.com/Yasshwanhya/FPGA-
project/blob/main/mod2_assignment1
Testbench Link:
https://github.com/Yasshwanhya/FPGA-
project/blob/main/mod2_assignment1_tb
References