S6.8.3 Read the Register Description

EasyImplement12 minIcarus Verilog · serverReview the topic

Predict what a service tool can learn from a mixed status word and what its read will consume.

Hardware context: Timer event register. Peripheral register interfaces

Read this exercise description for an eight-bit recorder. Each question starts from reset unless it gives another starting value.

This worksheet uses named constants. The first three entries show how to record your decisions.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
BitsFieldRule
7:6ReservedRead zero, ignore writes
5ARMRW, reset one
4BUSYRO, live input
3BELLWO, writing one rings once, reads zero
2FAULTW1C, reset zero, hardware set wins
1EDGERC, reset zero, hardware set wins
0BANKFirst write locks the written bit until reset, reads stored value, reset zero

Writes cover the whole byte. Reading EDGE returns its old value and clears it. BUSY is low unless specified.

EntryYour decision
POWER_UPWhat byte does the first read return?
BUSY_MASKWhat value does BUSY add when high?
BELL_READHow much does BELL contribute on readback?
EDGE_PAIREDGE alone rises after reset. What byte does the second consecutive read return?
FAULT_ACKFAULT is set. Write 0x24. What byte reads back?
RACEHardware sets FAULT on that same 0x24 write. What byte reads back?
BANK_PAIRWrite 0x20, then 0x21. What does BANK read?
REARMWrite 0x21 and reset. What byte reads back?
BOTHFAULT and EDGE both rise after reset. What byte does the first read return?
RESERVEDWrite 0xc0. What byte reads back?
OBSERVEDAfter reset, bit 0 of FLAGS requests a hardware FAULT set and bit 1 requests an EDGE set. After those events, what byte does the first read return?

Examples

Example 1

POWER UP
Input
What byte does the first read return?
Output
matches = 1

Only ARM starts high. Its bit contributes 32.

Example 2

BUSY MASK
Input
What value does BUSY add when high?
Output
matches = 1

Bit four contributes sixteen.

Example 3

BELL READ
Input
How much does BELL contribute on readback?
Output
matches = 1

The bell emits a pulse and reads zero.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For OBSERVED, enter a constant expression using FLAGS. Only this entry changes with the parameter. The supported integer range is 0 through 3, inclusive.

Hints

Hint 1

Mark storage, live pins and pulses.

Hint 2

Return the pre-read value before applying a read side effect.

Hint 3

Apply the priority written for this device.

What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.

11 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

POWER UP

Input
What byte does the first read return?
Expected output
matches = 1

Only ARM starts high. Its bit contributes 32.

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

Icarus Verilog · server