Build the clocked controller that lets the same pins select an instruction or scan a data register.
Hardware context: Two TAPs on the ap_soc board scan chain. Identifying devices on an assembled board
A board monitor logs the current TAP state using the exercise codes below. Drive that code after every rising TCK edge.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
row | 12 | input of each check |
Full specification
| State code | Name | TMS 0 leads to | TMS 1 leads to |
|---|---|---|---|
| 0 | Reset | Idle | Reset |
| 1 | Idle | Idle | Select-DR |
| 2 | Select-DR | Capture-DR | Select-IR |
| 3 | Capture-DR | Shift-DR | Exit1-DR |
| 4 | Shift-DR | Shift-DR | Exit1-DR |
| 5 | Exit1-DR | Pause-DR | Update-DR |
| 6 | Pause-DR | Pause-DR | Exit2-DR |
| 7 | Exit2-DR | Shift-DR | Update-DR |
| 8 | Update-DR | Idle | Select-DR |
| 9 | Select-IR | Capture-IR | Reset |
| 10 | Capture-IR | Shift-IR | Exit1-IR |
| 11 | Shift-IR | Shift-IR | Exit1-IR |
| 12 | Exit1-IR | Pause-IR | Update-IR |
| 13 | Pause-IR | Pause-IR | Exit2-IR |
| 14 | Exit2-IR | Shift-IR | Update-IR |
| 15 | Update-IR | Idle | Select-DR |
A falling trst_n resets the controller immediately, even between clocks. Hold Reset while trst_n is low. Releasing reset alone leaves the state unchanged.
Examples
Example 1
Reset Pulse- Input
Assert and release trst_n
- Output
state = 0
The asynchronous input establishes the starting state.
Example 2
Release to Idle- Input
TMS low at the next rise
- Output
state = 1
The first low takes the idle branch.
Example 3
Select a Scan- Input
TMS high from Idle
- Output
state = 2
From Idle a high opens the data branch.
Constraints and Contract
- Use module tap_control. Only a rising TCK edge samples TMS. A pause lasts as many edges as the host requests.
Hints
Hint 1
Give each row a name or code.
Hint 2
Separate the state storage from your transition decisions.
Hint 3
Trace both exits from each pause.
What the grader checks: Both outgoing arcs, asynchronous reset and between-edge stability are exercised from all sixteen states.
104 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