S8.2.2 Read the IDCODE

MediumImplement22 minIcarus Verilog · serverReview the topic

Turn TDO samples into a board identity while leaving the last good result intact after a broken scan.

Hardware context: Two TAPs on the ap_soc board scan chain. Identifying devices on an assembled board

Build the host-side receiver for a single selected IDCODE register. The scan decoder supplies mutually exclusive capture, shift and update strobes. All three may be low.

Signals in the Timeline

SignalWidthRole
row12input of each check
Full specification

At each rising TCK edge synchronous reset takes priority, clears idcode and valid, and cancels any partial scan.

Capture starts a fresh empty scan. Each shift in that scan contributes one TDO bit, least significant first. Quiet edges preserve the partial word.

Update closes the scan. Publish a word only after exactly 32 shifts and only if its low bit is one. Any other length, including overlong scans, fails.

Pulse valid for one edge on publication. Keep the previous published word until reset or another good update. Ignore shifts and updates outside an open scan.

Examples

Example 1

Clear
Input
Reset
Output
valid = 0, idcode = 0x0

The receiver has no saved identity yet.

Example 2

Board Read
Input
Capture, shift 32 bits of 0x142000b1, then update
Output
valid = 1, idcode = 0x142000b1

The low bit is one and the count is exact.

Example 3

After Publication
Input
One quiet edge
Output
valid = 0, idcode = 0x142000b1

The identity persists while the event pulse ends.

Constraints and Contract

  • Implement id_reader. The receiver accepts any word meeting these two checks. The exercise uses no manufacturer whitelist.

Hints

Hint 1

Separate the saved result from the serial input register.

Hint 2

Consider what an extra clock does to a full counter.

Hint 3

Check the first received bit after the whole scan.

What the grader checks: Checks cover all output bits, pauses, incomplete scans, excess clocks, recapture and retention across failures.

69 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

Clear

Input
Reset
Expected output
valid = 0, idcode = 0x0

The receiver has no saved identity yet.

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

Icarus Verilog · server