S6.8.1 One Field of Each Type

MediumImplement30 minIcarus Verilog · serverReview the topic

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

SignalWidthRole
sample10input of each check
Full specification
SlotAccessContract
0RWConfiguration byte, reset 0x12.
1ROLive pin_value in bit zero.
2WOWriting bit zero high raises fire for the following cycle. Reads zero.
3W1CFAULT in bit zero. raised sets it. Writing one clears it, even with raised high.
4RCEDGE in bit zero. raised sets it. A completed read clears it unless raised is high.
5Write onceFirst completed write stores the whole tag byte and locks it, including a write of zero.
6, 7ReservedRead 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

Report a problem with this page

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

Reset at a Reserved Slot

Input
slot=6, data=8'h00, write=0, done=0, event=0, pin=0, reset_n=0
Expected output
read_before_edge = 0x0, fire_after_edge = 0

The reserved view is zero before reset, and reset suppresses the command.

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

Icarus Verilog · server