S8.10.1 Fill a Trace Buffer by Hand

EasyImplement12 minIcarus Verilog · serverReview the topic

Follow five trace bytes from two sources through one link, find the stalls and the flush acknowledge, and work out what the buffer still holds.

Hardware context: Trace link of ap_soc: a core source and a timer source, a funnel and a circular buffer of four places. Reading a trace capture from an on-chip buffer during bring-up

This is the trace link of lesson S8.10 with other bytes. Two trace sources share one link through a funnel. A byte moves on a clock edge where valid and ready are both 1. The funnel serves source 1 until it has no byte left, then source 2. The bytes end in a circular buffer of four places, where the newest byte replaces the oldest.

This worksheet uses named constants. The first three entries show how to record your decisions.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
ItemValue
Source 1 (the core source, ID 1)Three bytes wait: a start packet, then two more packets.
Source 2 (the timer source, ID 2)Two bytes wait.
Ready, at edges 0 to 81, 1, 0, 0, 1, 1, 1, 1, 1
Flush request1 from edge 3 on. It goes back to 0 one edge after the acknowledge is seen at 1.
Flush acknowledge1 on the edge after the last waiting byte has moved.

Valid is 1 as long as either source has a byte left. Edges are counted from 0. Enter an edge as its number: 4 for edge 4.

EntryYour decision
FIRST_MOVEThe edge on which the first byte moves.
SECOND_MOVEThe edge on which the second byte moves.
FIRST_STALLThe first edge on which a byte waits.
THIRD_MOVEThe edge on which the third byte moves.
STALLSOn how many edges did a byte wait?
ID_AT_5The ID of the source whose byte moves at edge 5.
LAST_MOVEThe edge on which the last byte moves.
MOVESHow many bytes moved in all?
ACK_EDGEThe edge on which the flush acknowledge is seen at 1.
OLDEST_EDGEThe edge on which the oldest byte still in the buffer moved.
START_KEPTIs the start packet of source 1 still in the buffer? 1 for yes, 2 for no.
FROM_SOURCE_1How many of the four bytes in the buffer came from source 1?
LOST_NSuppose the buffer had N places in place of 4. How many of the five bytes would be lost?

Examples

Example 1

FIRST MOVE
Input
The edge on which the first byte moves.
Output
matches = 1

Valid and ready are both 1 at edge 0.

Example 2

SECOND MOVE
Input
The edge on which the second byte moves.
Output
matches = 1

Ready is still 1 at edge 1.

Example 3

FIRST STALL
Input
The first edge on which a byte waits.
Output
matches = 1

Ready is 0 at edge 2. The third byte of source 1 stays on the link.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For LOST_N, enter a constant expression using N. Only this entry changes with the parameter. The supported integer range is 1 through 5, inclusive.

Hints

Hint 1

Go through the edges. A byte moves where valid and ready are both 1. During a stall the same byte stays.

Hint 2

Source 1 is served until it is empty. The ID on the link then changes to 2.

Hint 3

The buffer keeps the newest four bytes. The acknowledge comes one edge after the last move.

What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.

13 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 1 problem on this path

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

FIRST MOVE

Input
The edge on which the first byte moves.
Expected output
matches = 1

Valid and ready are both 1 at edge 0.

Run samples executes all 3 public checks. Check all tests runs 13 checks on the server.

Icarus Verilog · server