B2.3.2 Choose the Source of Truth

MediumImplement22 minIcarus Verilog · serverReview the topic

For each check, pick where its expected value should come from. Choose a constant, a reference model, a rule, or a model with a scoreboard.

Hardware context: A FIFO checked through a scoreboard, and checks that choose their source of truth. Choosing between constants, a model, rules and a scoreboard.

Pick the cheapest source that can see the bug the check is for. Enter the code.

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

Replace each unresolved value of 255 with your result.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
CodeSource of truth
1Constant: an answer written by hand
2Reference model compared at once, in the same cycle
3Rule: a fact that must always hold, checked where it applies
4Reference model with a scoreboard: expected answers wait until the real ones arrive
EntryYour decision
RESET_VALUEAfter reset, the status register reads 0x01.
ADDER_ALLA combinational 8-bit adder is right for random inputs, compared in the same cycle.
ONE_HOTThe state register of a controller always has exactly one bit set.
FIFO_ORDERBytes leave a FIFO in the order they entered, some cycles later.
NO_OVERFLOWA FIFO never accepts a write while it is full.
PIPE_MULTA multiplier answers three cycles after each input, one input per cycle.
VERSION_REGThe version register reads the value in the specification.
ACK_SOONEvery request gets an acknowledge within 4 cycles.
NEEDSA divider takes a new input every cycle. It gives each answer LATENCY cycles after its input; 0 means in the same cycle. Enter 2 if a model compared at once is enough, 4 if expected answers must wait in a scoreboard.

Examples

Example 1

RESET VALUE
Input
After reset, the status register reads 0x01.
Output
matches = 1

One known value, written in the specification.

Example 2

ADDER ALL
Input
A combinational 8-bit adder is right for random inputs, compared in the same cycle.
Output
matches = 1

A model computes any sum; the answer is ready at once.

Example 3

ONE HOT
Input
The state register of a controller always has exactly one bit set.
Output
matches = 1

A fact that must hold every cycle, whatever the inputs.

Constraints and Contract

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

Hints

Hint 1

A constant is clear and cheap.

Hint 2

A reference model.

Hint 3

A rule. Answers later, or several in flight? A scoreboard.

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

13 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 VALUE

Input
After reset, the status register reads 0x01.
Expected output
matches = 1

One known value, written in the specification.

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

Icarus Verilog · server