P2.14.1 The Response Point

HardImplementIcarus · browser samples / server checksReview the topic

Build the write buffer that answers Bufferable writes itself and makes Non-bufferable ones wait for the endpoint, without ever reordering an answer.

Hardware context: The attribute path of an interconnect: write buffers, firewalls, decoders and the stages between. Implement a write buffer that is a response point for Bufferable writes only.

Lesson P2.14 showed an early write response and the read held behind it. This is the block that gives early responses: a write buffer between a manager and a slow endpoint. AWCACHE[0] decides when it may speak for the endpoint.

Write module resp_point. It takes single-beat writes, holds up to four, and sends every one to the endpoint in order. A Bufferable write gets its answer from the buffer: OKAY, without waiting for the endpoint. A Non-bufferable write gets its answer only after the endpoint has answered it, and with the endpoint's response.

Two more rules make it a correct response point. The answers go back in the order the writes were taken. The endpoint's answers for Bufferable writes are absorbed, errors included, because the manager has already been told OKAY.

The endpoint takes one write at a time and answers six edges later. The fixture checks every answer and every write the endpoint receives.

Signals in the Timeline

SignalWidthRole
n_wr4input of each check
Full specification
The module you write (keep these ports)
module resp_point (
  input  logic        clk,
  input  logic        rst_n,        // active low, asynchronous assert
  // single-beat writes from the manager
  input  logic        up_valid,
  output logic        up_ready,
  input  logic [3:0]  up_id,
  input  logic [31:0] up_addr,
  input  logic [31:0] up_data,
  input  logic [3:0]  up_cache,     // AWCACHE; bit 0 is Bufferable
  output logic        up_bvalid,
  input  logic        up_bready,
  output logic [3:0]  up_bid,
  output logic [1:0]  up_bresp,
  // the same writes, in order, to the endpoint
  output logic        dn_valid,
  input  logic        dn_ready,
  output logic [3:0]  dn_id,
  output logic [31:0] dn_addr,
  output logic [31:0] dn_data,
  input  logic        dn_bvalid,    // the endpoint answers its writes in the order it took them
  output logic        dn_bready,
  input  logic [1:0]  dn_bresp
);
  // your write buffer
endmodule
WriteAnswer to the manager
Bufferable (up_cache[0] = 1)OKAY with its ID, from the buffer. up_bvalid rises within two edges of the write being taken or of the previous answer being taken, whichever is later.
Non-bufferableThe endpoint's response, with its ID, only after the endpoint has answered that write.
Every writeAnswered once, in the order the writes were taken. Sent to the endpoint once, unchanged, in the same order.

The result is {answers[7:0], wrong[7:0], early[7:0], late[7:0], sent_down[7:0], wrong_down[7:0], hold[7:0]}. early counts Non-bufferable writes answered before the endpoint. late counts Bufferable writes not offered within two edges of becoming the oldest unanswered write. wrong counts answers out of order or with the wrong response.

Examples

Example 1

Bufferable Writes
Input
ID 1 Bufferable, ID 2 Bufferable, ID 3 Bufferable
manager offers on 16'hffff, takes responses on 16'hffff; the endpoint answers six edges after each write
Output
answers = 3, wrong = 0, early = 0, late = 0, sent_down = 3, wrong_down = 0, hold = 0

All three are answered OKAY by the buffer while the endpoint is still working on the first. The endpoint's three answers arrive later and are absorbed.

Example 2

The Specification's Trick
Input
ID 4 Bufferable, ID 4 Bufferable, ID 4 Bufferable, ID 4 Non-bufferable
manager offers on 16'hffff, takes responses on 16'hffff; the endpoint answers six edges after each write
Output
answers = 4, wrong = 0, early = 0, late = 0, sent_down = 4, wrong_down = 0, hold = 0

Three Bufferable writes and then a Non-bufferable one. When the last write is answered, the endpoint has answered it, so all four writes have arrived.

Example 3

Errors
Input
ID 1 Non-bufferable (endpoint: SLVERR), ID 2 Bufferable (endpoint: SLVERR), ID 3 Non-bufferable, ID 4 Bufferable (endpoint: SLVERR)
manager offers on 16'hffff, takes responses on 16'hffff; the endpoint answers six edges after each write
Output
answers = 4, wrong = 0, early = 0, late = 0, sent_down = 4, wrong_down = 0, hold = 0

SLVERR on the first write reaches the manager, because it is Non-bufferable. SLVERR on the second and fourth is lost: the buffer already said OKAY.

Constraints and Contract

  • Keep the module name and the ports. Hold at most four writes that the endpoint or the manager has not finished with.
  • The fixture drives its inputs after each edge and samples your outputs just before the next one.
  • Do not reach outside your ports.

Hints

Hint 1

Keep one ring of entries and four counters: taken, sent to the endpoint, answered by the endpoint, answered to the manager.

Hint 2

The oldest unanswered write may be answered when it is Bufferable, or when the endpoint has already answered it.

Hint 3

An entry is free only when both the endpoint and the manager are done with it. A Bufferable entry can be answered upstream long before the endpoint answers it.

What the grader checks: Your buffer runs twelve sequences of up to twelve writes against a slow endpoint, with stalls and error responses. Every answer, every endpoint write and the timing of each answer against the endpoint are checked. Passing shows the response-point rules hold on these sequences.

12 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 4 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

Bufferable Writes

Input
ID 1 Bufferable, ID 2 Bufferable, ID 3 Bufferable
manager offers on 16'hffff, takes responses on 16'hffff; the endpoint answers six edges after each write
Expected output
answers = 3, wrong = 0, early = 0, late = 0, sent_down = 3, wrong_down = 0, hold = 0

All three are answered OKAY by the buffer while the endpoint is still working on the first. The endpoint's three answers arrive later and are absorbed.

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

Icarus · browser samples / server checks