P2.6.3 The Burst Rules Checker

HardVerify45 minIcarus · browser samples / server checks8 hidden designsReview the topic

Write the checker that judges every request by its burst alone. Check lengths, WRAP alignment, the bus width, the 4 KB rule and the interface's own size limit.

Hardware context: The address arithmetic of an AXI burst. Check every request against the burst rules visible on the address channels, including Max_Transaction_Bytes.

Lesson P2.6 showed the bench checker naming len, wrap and boundary. Those rules can be checked from the request alone, before a single data beat moves. This checker does exactly that, and one rule more.

Write module burst_checker for a 64-bit interface whose Max_Transaction_Bytes property is 256. For every request taken on AW or AR, add one to errors for each rule it breaks.

Nine scripted managers drive it. One keeps every rule, and its traffic sits right on the edges. It has a burst ending at 0xfff, an unaligned start just below 4 KB, and a 16-beat WRAP and FIXED. It also moves 256 bytes on a 256-byte boundary. Each of the other eight adds one request that breaks one rule.

Signals in the Timeline

SignalWidthRole
aclk1stimulus, the same for every design
awvalid1output of the design under test
awaddr32output of the design under test
awlen8output of the design under test
awsize3output of the design under test
awburst2output of the design under test
arvalid1output of the design under test
araddr32output of the design under test
arlen8output of the design under test
arsize3output of the design under test
arburst2output of the design under test
your errors32output of the design under test
Full specification
The module you write (keep these ports)
module burst_checker #(parameter int BUS_BYTES = 8, parameter int MAX_BYTES = 256) (
  input  logic        aclk,
  input  logic        aresetn,
  input  logic        awvalid,
  input  logic        awready,
  input  logic [31:0] awaddr,
  input  logic [7:0]  awlen,
  input  logic [2:0]  awsize,
  input  logic [1:0]  awburst,    // 0 FIXED, 1 INCR, 2 WRAP
  input  logic        arvalid,
  input  logic        arready,
  input  logic [31:0] araddr,
  input  logic [7:0]  arlen,
  input  logic [2:0]  arsize,
  input  logic [1:0]  arburst,
  output int          errors
);
  // your checker
endmodule
RuleEvery request
size2^AxSIZE bytes must not exceed BUS_BYTES.
WRAPAxLEN + 1 is 2, 4, 8 or 16, and AxADDR is a multiple of 2^AxSIZE.
FIXEDAxLEN + 1 is at most 16.
4 KBAn INCR burst must not cross a 4 KB boundary.
Max_Transaction_Bytes(AxLEN + 1) x 2^AxSIZE is at most MAX_BYTES, and an INCR burst must not cross a MAX_BYTES boundary.

An INCR burst moves the bytes from AxADDR up to its last byte. The last byte is the start aligned to the size, plus (AxLEN + 1) x 2^AxSIZE - 1. A burst may end exactly at a boundary.

Each run has two reset edges and 14 more. Both channels are always ready, so a request is taken at the edge after it is offered.

For each manager you get alarm = yes or no. For the correct one you also get the first cycle where your count rose.

Examples

Example 1

Legal Requests at the Edges
Input
Manager: legal requests at the edges of every rule
Output
alarm = no

A burst ending at 0xfff and an unaligned start at 0xffe are legal. So are 256 bytes from 0x300 and a burst ending at 0x4ff.

Example 2

Across 4 KB
Input
Manager: the legal requests, plus a read across 4 kb
Output
alarm = yes

A read of four 4-byte beats from 0x1ff8 reaches 0x2007.

Example 3

Across the Interface's Own Boundary
Input
Manager: the legal requests, plus across a max_transaction_bytes boundary
Output
alarm = yes

Eight beats from 0xf0 stay inside one 4 KB page but cross 0x100, a 256-byte boundary.

Constraints and Contract

  • Keep the module name, the parameters and the ports. The fixture uses BUS_BYTES = 8 and MAX_BYTES = 256.
  • Use only your ports. errors never decreases.

Hints

Hint 1

Write one function that returns how many rules a request breaks, and call it for AW and for AR.

Hint 2

Compute the last byte from the start aligned to the transfer size. An unaligned first beat moves fewer bytes, never more.

Hint 3

Two boundaries, one test. The first and last byte must share a 4 KB page and a MAX_BYTES block.

What the grader checks: Your checker watches one legal and eight faulty managers. Passing shows it catches these eight broken requests and stays silent on legal requests at the edges. It does not show every illegal request is caught.

9 checks on Icarus · browser samples / server checks. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain public samples only. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 3 steps and the final capstone

Report a problem with this page

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

Legal Requests at the Edges

Input
Manager: legal requests at the edges of every rule
Expected output
alarm = no

A burst ending at 0xfff and an unaligned start at 0xffe are legal. So are 256 bytes from 0x300 and a burst ending at 0x4ff.

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

Icarus · browser samples / server checks