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
| Signal | Width | Role |
|---|---|---|
port_clk | 1 | stimulus, the same for every design |
port_rst_n | 1 | stimulus, the same for every design |
port_sel | 1 | stimulus, the same for every design |
port_access_phase | 1 | stimulus, the same for every design |
port_ready | 1 | stimulus, the same for every design |
port_wr | 1 | stimulus, the same for every design |
port_offset | 4 | stimulus, the same for every design |
port_data | 2 | stimulus, the same for every design |
port_pulse | 1 | stimulus, the same for every design |
port_armed | 1 | stimulus, the same for every design |
port_pending | 1 | stimulus, 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