S7.1.2 Fill the Skeleton

MediumImplement22 minIcarus Verilog · serverReview the topic

Connect an event latch to a bus command. Software must be able to arm the detector while a pulse is arriving.

Hardware context: ap_soc pulse counter. Peripheral integration

Connect an event latch to a bus command. Software must be able to arm the detector while a pulse is arriving.

Signals in the Timeline

SignalWidthRole
port_clk1stimulus, the same for every design
port_rst_n1stimulus, the same for every design
port_sel1stimulus, the same for every design
port_access_phase1stimulus, the same for every design
port_ready1stimulus, the same for every design
port_wr1stimulus, the same for every design
port_offset4stimulus, the same for every design
port_data2stimulus, the same for every design
port_pulse1stimulus, the same for every design
port_armed1stimulus, the same for every design
port_pending1stimulus, the same for every design
Full specification

This local fixture accepts a command at byte offset 8 on a selected, ready write in the access phase. No other address or bus phase changes the control fields.

At completion load armed from data bit 0. A one in bit 1 requests a pending clear. A pulse sampled while previously armed sets pending, including during unrelated bus traffic.

A new event wins over a simultaneous clear. Both fields retain their values between updates and reset to zero.

Examples

Example 1

Reset with Traffic
Input
rst_n=1'h0, sel=1'h1, access_phase=1'h1, ready=1'h1, wr=1'h1, offset=4'h8, data=2'h3, pulse=1'h1
Output
armed = 0x0, pending = 0x0

Reset clears both fields.

Example 2

Arm During a Pulse
Input
rst_n=1'h1, sel=1'h1, access_phase=1'h1, ready=1'h1, wr=1'h1, offset=4'h8, data=2'h1, pulse=1'h1
Output
armed = 0x1, pending = 0x0

The detector was disarmed before this edge.

Example 3

Pulse Between Writes
Input
rst_n=1'h1, sel=1'h0, access_phase=1'h0, ready=1'h1, wr=1'h0, offset=4'h0, data=2'h0, pulse=1'h1
Output
armed = 0x1, pending = 0x1

The armed detector now remembers the event.

Constraints and Contract

  • Sample on each rising edge. Synchronous active-low reset wins over all other inputs. Binary inputs only.

Hints

Hint 1

Mark the one edge that accepts a command.

Hint 2

Write down the arm state before the pulse.

Hint 3

Try clearing a pending event as another arrives.

What the grader checks: All offsets and qualifiers are swept. Each data bit, event collision and reset is exercised.

225 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 2 problems 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

Reset with Traffic

Input
rst_n=1'h0, sel=1'h1, access_phase=1'h1, ready=1'h1, wr=1'h1, offset=4'h8, data=2'h3, pulse=1'h1
Expected output
armed = 0x0, pending = 0x0

Reset clears both fields.

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

Icarus Verilog · server