V12.7.2 Gate-Level Questions

MediumImplement22 minIcarus Verilog · serverReview the topic

Read a recorded RTL-against-netlist run, count what the netlist made unknown, and decide which unknowns are real.

Hardware context: The boot ROM of ap_soc v1.5 as RTL and as a generic gate netlist on Icarus, zero delay. Counting and classifying gate-level unknowns.

A second recording of the boot ROM (tools/fixtures/socv-v12-gate-waves.json; Yosys 0.70+290, Icarus 12). It has 7 rows, one stimulus, as RTL and as a generic NAND netlist. In one row the select is unknown while the address names another word.

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

Replace each unresolved value of 65535 with your result.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
CodeVerdict on a gate-level unknown
1X-pessimism: the gates invented it
2A real unknown the RTL hid
3A real bug in both views
4No problem: nobody takes the value

The read-data register is a mux: keep the old word or load the new one. With an unknown select, the AND-OR form of the mux gives X for a bit where the two words differ. It also gives X for a bit that is 1 in both. A bit that is 0 in both stays 0.

EntryYour decision
AGREEIn how many of the recorded rows do the two views give the same hrdata?
X_BITSHow many bits are unknown in the netlist in the row where they part?
REALThe held word 0x5555_5553 and a new word 0xAAAA_AAAC, select unknown.
PESSIMISTThe held word and the new word are both 0x5555_5553, select unknown.
RESET_ROWhrdata unknown in both views right after reset, before any read.
NO_RESETA control flop with no reset makes a counter unknown in both views after reset.
X_FOR_EQUALHeld word and new word are both W, select unknown. How many bits does the netlist show as X?

Examples

Example 1

AGREE
Input
In how many of the recorded rows do the two views give the same hrdata?
Output
matches = 1

6 of 7.

Example 2

X BITS
Input
How many bits are unknown in the netlist in the row where they part?
Output
matches = 1

The held word and the new word differ in every bit.

Example 3

REAL
Input
The held word 0x5555_5553 and a new word 0xAAAA_AAAC, select unknown.
Output
matches = 1

Replaying the select at 0 and at 1 gives different words.

Constraints and Contract

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

Hints

Hint 1

Compare the two hrdata columns row by row.

Hint 2

Ask what each binary value of the unknown input would give.

Hint 3

Same answer both ways: pessimism. Different answers: a real unknown.

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

AGREE

Input
In how many of the recorded rows do the two views give the same hrdata?
Expected output
matches = 1

6 of 7.

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

Icarus Verilog · server