Build a six-slot register bank whose command, status and configuration fields have different owners.
Hardware context: Timer event register. Peripheral register interfaces
A bus adapter has already decoded the device and produced a one-edge completion flag. Implement the register bank behind it. Each local word number selects a byte-wide readback view.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
sample | 10 | input of each check |
Full specification
| Slot | Access | Contract |
|---|---|---|
| 0 | RW | Configuration byte, reset 0x12. |
| 1 | RO | Live pin_value in bit zero. |
| 2 | WO | Writing bit zero high raises fire for the following cycle. Reads zero. |
| 3 | W1C | FAULT in bit zero. raised sets it. Writing one clears it, even with raised high. |
| 4 | RC | EDGE in bit zero. raised sets it. A completed read clears it unless raised is high. |
| 5 | Write once | First completed write stores the whole tag byte and locks it, including a write of zero. |
| 6, 7 | Reserved | Read zero and ignore writes. |
Unlisted bits read zero. Every scalar flag and the tag reset to zero. reset_n is synchronous, active low, and dominates all updates.
Examples
Example 1
Reset at a Reserved Slot- Input
slot=6, data=8'h00, write=0, done=0, event=0, pin=0, reset_n=0
- Output
read_before_edge = 0x0, fire_after_edge = 0
The reserved view is zero before reset, and reset suppresses the command.
Example 2
Read Configuration- Input
slot=0, data=8'h00, write=0, done=1, event=0, pin=0, reset_n=1
- Output
read_before_edge = 0x12, fire_after_edge = 0
Slot zero returns the reset byte.
Example 3
Ring Once- Input
slot=2, data=8'h01, write=1, done=1, event=0, pin=0, reset_n=1
- Output
read_before_edge = 0x0, fire_after_edge = 1
The command reads zero and fires after acceptance.
Constraints and Contract
- Drive rd combinationally for slot, including while idle or writing. At the rising edge a requester captures the old rd. Only done qualifies a software access. wr selects write. Hardware events need no bus access.
Hints
Hint 1
Separate readback from updates.
Hint 2
A lock needs to represent a written zero.
Hint 3
Decide collision priority for each flag independently.
What the grader checks: Clocked checks compare pre-edge read data and post-edge fire across completed, idle, reserved and simultaneous operations.
696 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 3 problems on this path