V6.3.3 The Pad That Would Not Drive

MediumDebug20 minap_soc v1.5 · recorded bus-manager run on a bring-up buildReview the topic

A bring-up table makes pad IO6 a GPIO output and drives it high, then low, then high. Its last check fails at the pads. Find the first transfer whose value was already wrong, and say why the chip gave it.

This chip is a build under bring-up, not the chip of the other problems. The table below ran on the bus-manager seat. It gives pads 6 and 7 to GPIO, makes pad 6 an output and drives it. On the board, a wire joins pad IO6 to pad IO7. So GPIO IN should show pad 6's level on bits 6 and 7. The fourth row only logs GPIO IN: its mask is 0. The bench counts rows from 0, so its message calls the last row row 8.

WhoOperationAddressDataMaskExpectDelayRepeat
corew1000401000005000ffffffff0000000001
corew1000100800000040ffffffff0000000001
corew1000100000000040ffffffff0000000001
corer1000100400000000000000000000000041
corew1000100800000000ffffffff0000000001
corer1000100400000000000000c00000000041
tbgpio_expect0000000000000000000000c00000000021
corew1000100800000040ffffffff0000000001
tbgpio_expect0000000000000000000000c0000000c021

The run ended with a bench error at the last row: row 8: IO pads = 00000002, expected 000000c0 (mask 000000c0). With the seat nothing retires and nothing boots, so there is no retire trace. The table Seat Transfers holds the seat's transfers instead, read from the bench's sample window of its data port. Each row has the cycle of its address phase and the data of its data phase.

Name the first transfer whose value is not what the good chip would give. Give its cycle, whether its address or its data was wrong, its address and its name in the register list. Then choose the cause.

Full specification

GPIO: DIR at 0x1000_1000 (bit n: pad n is an output) and OUT at 0x1000_1008. IN at 0x1000_1004 holds the level of each pad, through two synchronizer flip-flops. PINMUX at 0x1000_4010 gives each pad two bits; value 1 is GPIO.

Pad IO1 is the UART line from the board, idle high, so GPIO IN bit 1 reads 1. TB_STATUS at 0x1000_4020 is the bench's own word.

Diagnose the Failing Run

Recorded Console and Result

BENCH 38: row 8: IO pads = 00000002, expected 000000c0 (mask 000000c0)
verdict=fail
reason=checker
status=bad00001
cycles=47
bench_errors=1
mismatches=0

Seat Transfers

CycleOperationAddress (hex)Data (hex)
7store1000402000000002
10store1000401000005000
13store1000100800000040
16store1000100000000040
22load1000100400000002
25store1000100800000000
31load1000100400000002
35store1000100800000040
39store10004020bad00001
Step 1 · The first bad cycle and signal
Step 2 · The cause

Given Files

Use the register map to identify the transfer in the recording.

The sequence table · bench manual

One row a line: who op address data mask expect delay repeat. Two words, four hex numbers, two decimal numbers. delay: cycles to wait before the row. repeat: how often the row runs. A line that starts with # is a comment. With +core=bfm the table is the test: the bench writes TB_STATUS = 2 before the first row and the pass or fail word after the last. With +core=cpu a table holds the bench's side of a firmware test.

whoopMeaning
corew wh wbWrite a word, a half, a byte of data at address; the answer must be OKAY
corer rh rbRead; (value & mask) must equal (expect & mask)
corewe reWrite or read that must answer ERROR
corewq rqAs w and r, with the next row's address phase on this row's data phase (back to back)
corepollRead until the masked value is the expected one; data = the most reads (0: 1,000)
coreirqThe interrupt pins now (bit 0 software, 1 timer, 2 external) against mask and expect
corewait_irqWait until a pin of mask is high; data = the most cycles
coreidleEnd a back-to-back run
dmacopyOne job from address to data of mask bytes; STATUS must be expect (2 DONE, 4 FAULT)
jtagidcodeTAP reset, read IDCODE, compare
jtaghalt resume stepDebug control (a halt waits for the core)
jtagrr rwRead or write the register numbered address (0x1000 + n, a CSR, 0x7b0, 0x7b1)
jtagstreamStart background word reads at address A, count D, maximum random gap M, expected word E
tbwait_releaseWait for the system bus and core resets to release. Seat tables also hold each row at dispatch during reset.
tbwatchdogSet the seat stall limit to data system clocks (zero disables it). A stalled request reports its row, address and direction.
tbgapsMaximum random gap D before each seat row, in system cycles (0 disables gaps)
jtagmr mwRead or write a word of memory through the debug manager
jtagarm status"Halt at reset" = data; {halted, error, busy} against mask and expect
jtagcmdCommand number address (0 to 7, facts 27.10) with the word data; its reply against mask and expect
tbuart_sendSend the byte data to the chip
tbuart_expectThe next byte from the chip must be expect; address = the most bit times to wait
tbgpio_set gpio_pulsePad address to level data; a pulse of data cycles of CLK
tbgpio_expectThe sixteen pads against mask and expect
tbreset supplyThe reset pin, or the supply, for data cycles of CLK
tbwait_eventWait until the test writes address to TB_EVENT
tbargDeposit data in TB_ARG
tbwait_statusWait until (TB_STATUS & mask) equals (expect & mask)
tbpoke peekBack-door write of mask bytes (0: 4) of data; back-door read against mask, expect
tbwaitOnly the delay
syma symbol nameBack-door write of data to that C variable, with the symbol's size

core and dma rows need +core=bfm. soc-rows.mjs turns a list of core and tb rows into both forms: a table for the seat, or a table in SRAM for an interpreter in ROM, with a hand-shake wherever the list goes from one side to the other.

GPIO · register manual
OffsetRegisterBitsFieldAccessResetHeld byMeaning
0x000DIR15:0valuerw0x0000regs1 turns the output driver of that pin on. One bit for each pin.
0x004IN15:0valueroblockThe pin levels, after two sampling flip-flops. One bit for each pin.
0x008OUT15:0valuerw0x0000regsThe saved output value. One bit for each pin.
0x00CSET15:0valuew1sacts on OUT.valueA 1 sets that bit of OUT. One bit for each pin.
0x010CLR15:0valuew1cacts on OUT.valueA 1 clears that bit of OUT. One bit for each pin.
0x014TGL15:0valuew1tacts on OUT.valueA 1 inverts that bit of OUT. One bit for each pin.
0x018IRQ_ENABLE15:0valuerw0x0000regsA 1 lets that pin's status bit raise interrupt source 2. One bit for each pin.
0x01CLEVEL_MODE15:0valuerw0x0000regs1: the pin is a level cause. 0: an edge cause. One bit for each pin.
0x020ACTIVE_HIGH15:0valuerw0xFFFFregs1: a high level, or a rising edge, is the event. One bit for each pin.
0x024STATUS15:0valuew1cblockRaw status. A written 1 clears the saved edge flag of that pin. One bit for each pin.
0x028MASKED_STATUS15:0valueroblockSTATUS AND IRQ_ENABLE. One bit for each pin.
ap_sysctl · register manual
OffsetRegisterBitsFieldAccessResetHeld byMeaning
0x000CHIP_ID31:0valuero0x2A5310C5constThe chip's identity: the IDCODE of the TAP. Fixed number.
0x004RESET_CAUSE0power_onroblockSticky record of reset sources since power-on. Power-on reset.
0x004RESET_CAUSE1pinroblockReset pin.
0x004RESET_CAUSE2watchdogroblockWatchdog.
0x004RESET_CAUSE3softwareroblockSoftware request.
0x004RESET_CAUSE4debugroblockDebug request.
0x008SOFT_RESET0timerwonot storedReset requests from software. 1 arms one restart of the timer.
0x008SOFT_RESET1chipwonot stored1 requests the software reset (new in v1.5).
0x00CSTRAPS0bootroblockStraps as sampled at power-up (new in v1.5). 0: start in the boot ROM. 1: start in SRAM.
0x010PINMUX31:0selectrw0x00000000regsTwo bits for each of sixteen pads: 0 released, 1 GPIO, 2 serial, 3 auxiliary. Pad n uses bits 2n+1 and 2n.
0x014CLK_GATE0uart0rw0x1regs1 lets that block's clock run (new in v1.5). UART0.
0x014CLK_GATE1gpiorw0x1regsGPIO.
0x014CLK_GATE2timerrw0x1regsTimer and PWM.
0x014CLK_GATE3spirw0x1regsSPI.
0x014CLK_GATE4dmarw0x1regsDMA.
0x018LOCK0pinmuxw1s0x0regsWrite-once locks. Only a reset clears one (new in v1.5). 1: PINMUX ignores writes.
0x018LOCK1clk_gatew1s0x0regs1: CLK_GATE ignores writes.
0x018LOCK2debugw1s0x0regs1: the debug lock is closed.
0x020TB_STATUS31:0valuerw0x00000000regs (power-on reset only)Scratch word 0. The firmware kit reports progress, pass and fail here. Plain storage.
0x024TB_PUTC31:0valuerw0x00000000regs (power-on reset only)Scratch word 1. The firmware kit writes one character here. Plain storage.
0x028TB_EVENT31:0valuerw0x00000000regs (power-on reset only)Scratch word 2. The firmware kit writes an event number here. Plain storage.
0x02CTB_ARG31:0valuerw0x00000000regs (power-on reset only)Scratch word 3. A bench leaves a word for the firmware here. Plain storage.