V6.3.2 Every Bit, Every Address, Every Gap

HardVerify45 minap_soc v1.5 · bus seat · serverReview the topic

Bit-bash the plain registers of the whole chip, prove that no register answers at two addresses, and make every hole answer ERROR. The table must pass on ap_soc and fail on every faulty chip of a hidden set.

Hardware context: The memory map of ap_soc v1.5: register fields, neighbouring addresses and holes. Bit bash, aliases and holes over the whole chip.

Write a table for the bus-manager seat over the whole of ap_soc. Prove three things. Every bit of every plain read-and-write field can be set on its own and reads back in its own place. Within every block, registers given different values all read back their own value. And every hole of the map answers ERROR: an empty offset in every APB page, and the holes between regions.

Leave PINMUX, CLK_GATE and the mailbox registers out: they move pads, stop clocks or speak to the bench. Put every register you touch back to its reset value.

Your table must pass on the good chip and fail on each chip of a hidden set. Which faults the set holds, the page does not say.

Full specification
RegisterAddressFieldBitsAccessResetMoves by itselfA readA write
MSIP0x0200_0000msip0rw0x0noOKAYOKAY
MTIMECMP_LOW0x0200_4000value31:0rw0xffffffffnoOKAYOKAY
MTIMECMP_HIGH0x0200_4004value31:0rw0xffffffffnoOKAYOKAY
MTIME_LOW0x0200_bff8value31:0rw0x0yesOKAYOKAY
MTIME_HIGH0x0200_bffcvalue31:0rw0x0yesOKAYOKAY
PRIORITY[1]0x0c00_0004level2:0rw0x0noOKAYOKAY
PRIORITY[2]0x0c00_0008level2:0rw0x0noOKAYOKAY
PRIORITY[3]0x0c00_000clevel2:0rw0x0noOKAYOKAY
PRIORITY[4]0x0c00_0010level2:0rw0x0noOKAYOKAY
PRIORITY[5]0x0c00_0014level2:0rw0x0noOKAYOKAY
PRIORITY[6]0x0c00_0018level2:0rw0x0noOKAYOKAY
PRIORITY[7]0x0c00_001clevel2:0rw0x0noOKAYOKAY
PRIORITY[8]0x0c00_0020level2:0rw0x0noOKAYOKAY
PRIORITY[9]0x0c00_0024level2:0rw0x0noOKAYOKAY
PRIORITY[10]0x0c00_0028level2:0rw0x0noOKAYOKAY
PRIORITY[11]0x0c00_002clevel2:0rw0x0noOKAYOKAY
PRIORITY[12]0x0c00_0030level2:0rw0x0noOKAYOKAY
PRIORITY[13]0x0c00_0034level2:0rw0x0noOKAYOKAY
PRIORITY[14]0x0c00_0038level2:0rw0x0noOKAYOKAY
PRIORITY[15]0x0c00_003clevel2:0rw0x0noOKAYOKAY
PRIORITY[16]0x0c00_0040level2:0rw0x0noOKAYOKAY
PENDING0x0c00_1000sources16:1ro—yesOKAYERROR
ENABLE0x0c00_2000sources16:1rw0x0noOKAYOKAY
THRESHOLD0x0c20_0000level2:0rw0x0noOKAYOKAY
CLAIM0x0c20_0004id4:0rw0x0yesOKAYOKAY
TXDATA0x1000_0000data7:0wo—noERROROKAY
STATUS0x1000_0004room0ro—yesOKAYERROR
STATUS0x1000_0004rx_ready1ro—yesOKAYERROR
STATUS0x1000_0004rx_full2ro—yesOKAYERROR
IRQ_ENABLE0x1000_0008room0rw0x0noOKAYOKAY
IRQ_ENABLE0x1000_0008rx_ready1rw0x0noOKAYOKAY
RXDATA0x1000_000cdata7:0ro—yesOKAYERROR
DIV0x1000_0010cycles15:0rw0x10noOKAYOKAY
DIR0x1000_1000value15:0rw0x0noOKAYOKAY
IN0x1000_1004value15:0ro—yesOKAYERROR
OUT0x1000_1008value15:0rw0x0noOKAYOKAY
SET0x1000_100cvalue15:0w1s—noERROROKAY
CLR0x1000_1010value15:0w1c—noERROROKAY
TGL0x1000_1014value15:0w1t—noERROROKAY
IRQ_ENABLE0x1000_1018value15:0rw0x0noOKAYOKAY
LEVEL_MODE0x1000_101cvalue15:0rw0x0noOKAYOKAY
ACTIVE_HIGH0x1000_1020value15:0rw0xffffnoOKAYOKAY
STATUS0x1000_1024value15:0w1c—yesOKAYOKAY
MASKED_STATUS0x1000_1028value15:0ro—yesOKAYERROR
RUN0x1000_2000run0rw0x0noOKAYOKAY
DUTY0x1000_2004slots2:0rw0x0noOKAYOKAY
CAPTURED0x1000_2008slot1:0ro—yesOKAYERROR
DIV_TOP0x1000_200ctop7:0rw0x0noOKAYOKAY
COMPARE0x1000_2010slot1:0rw0x0noOKAYOKAY
IRQ_CLEAR0x1000_2014match0wo—noERROROKAY
IRQ_ENABLE0x1000_2018match0rw0x0noOKAYOKAY
EVENT0x1000_2020enable0rw0x0noOKAYOKAY
EVENT0x1000_2020online1ro—yesOKAYOKAY
EVENT0x1000_2020kick2wo—noOKAYOKAY
EVENT0x1000_2020pending3w1c—yesOKAYOKAY
EVENT0x1000_2020seen4rc—yesOKAYOKAY
EVENT0x1000_2020route5rw0x0yesOKAYOKAY
EVENT_COUNT_LOW0x1000_2024value31:0ro—yesOKAYERROR
EVENT_COUNT_HIGH0x1000_2028value31:0ro—yesOKAYERROR
CHIP_ID0x1000_4000value31:0ro0x2a5310c5noOKAYERROR
RESET_CAUSE0x1000_4004power_on0ro—yesOKAYERROR
RESET_CAUSE0x1000_4004pin1ro—yesOKAYERROR
RESET_CAUSE0x1000_4004watchdog2ro—yesOKAYERROR
RESET_CAUSE0x1000_4004software3ro—yesOKAYERROR
RESET_CAUSE0x1000_4004debug4ro—yesOKAYERROR
SOFT_RESET0x1000_4008timer0wo—noERROROKAY
SOFT_RESET0x1000_4008chip1wo—noERROROKAY
STRAPS0x1000_400cboot0ro—yesOKAYERROR
PINMUX0x1000_4010select31:0rw0x0noOKAYOKAY
CLK_GATE0x1000_4014uart00rw0x1noOKAYOKAY
CLK_GATE0x1000_4014gpio1rw0x1noOKAYOKAY
CLK_GATE0x1000_4014timer2rw0x1noOKAYOKAY
CLK_GATE0x1000_4014spi3rw0x1noOKAYOKAY
CLK_GATE0x1000_4014dma4rw0x1noOKAYOKAY
LOCK0x1000_4018pinmux0w1s0x0noOKAYOKAY
LOCK0x1000_4018clk_gate1w1s0x0noOKAYOKAY
LOCK0x1000_4018debug2w1s0x0noOKAYOKAY
TB_STATUS0x1000_4020value31:0rw0x0noOKAYOKAY
TB_PUTC0x1000_4024value31:0rw0x0noOKAYOKAY
TB_EVENT0x1000_4028value31:0rw0x0noOKAYOKAY
TB_ARG0x1000_402cvalue31:0rw0x0noOKAYOKAY
DATA0x1000_5000command7:0wo—noOKAYOKAY
DATA0x1000_5000received23:0ro—yesOKAYOKAY
STATUS0x1000_5004busy0ro—yesOKAYOKAY
STATUS0x1000_5004done1w1c—yesOKAYOKAY
IRQ_ENABLE0x1000_5008done0rw0x0noOKAYOKAY
SRC0x1000_6000address31:0rw0x0noOKAYOKAY
DST0x1000_6004address31:0rw0x0noOKAYOKAY
LEN0x1000_6008bytes31:0rw0x0noOKAYOKAY
START0x1000_600cstart0wo—noERROROKAY
STATUS0x1000_6014busy0ro—yesOKAYOKAY
STATUS0x1000_6014done1w1c—yesOKAYOKAY
STATUS0x1000_6014fault2w1c—yesOKAYOKAY
IRQ_ENABLE0x1000_6018done0rw0x0noOKAYOKAY
IRQ_ENABLE0x1000_6018fault1rw0x0noOKAYOKAY
REQUEST0x1000_8000sleep0wo—noERROROKAY
REQUEST0x1000_8000wake1wo—noERROROKAY
STATUS0x1000_8004state2:0ro—yesOKAYERROR
STATUS0x1000_8004isolate4ro—yesOKAYERROR
STATUS0x1000_8004save5ro—yesOKAYERROR
STATUS0x1000_8004power_on6ro—yesOKAYERROR
WAKE_ENABLE0x1000_8008pad0rw0x0noOKAYOKAY
WAKE_ENABLE0x1000_8008watchdog1rw0x0noOKAYOKAY
WAKE_CAUSE0x1000_800cpad0w1c—yesOKAYOKAY
WAKE_CAUSE0x1000_800cwatchdog1w1c—yesOKAYOKAY
WAKE_CAUSE0x1000_800csoftware2w1c—yesOKAYOKAY
IRQ_ENABLE0x1000_8010cause2:0rw0x0noOKAYOKAY
HoleAddress
The APB page nobody owns0x1000_7000
Reserved APB pages0x1000_9000 to 0x1000_FFFF
No region at all0x4000_0000
Just past SRAM0x8001_0000
ap_plic priority of source 00x0C00_0000
ap_clint: an offset with no register0x0200_0008
Each APB pagebase + 0xFFC

Rows: who op address data mask expect delay repeat (two words, four hex numbers, two decimal numbers). A core r row checks (value & mask) == (expect & mask). Rows core re and core we must answer ERROR. A core poll row reads until the masked value matches, at most data reads. The bench manual lists every row.

Given Files

Read-only files supplied by the bench.

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.

ap_clint · register manual
OffsetRegisterBitsFieldAccessResetHeld byMeaning
0x000000MSIP0msiprw0x0blockMachine software interrupt request of hart 0. 1 raises the request.
0x004000MTIMECMP_LOW31:0valuerw0xFFFFFFFFblockLow word of mtimecmp. Compare value, low word.
0x004004MTIMECMP_HIGH31:0valuerw0xFFFFFFFFblockHigh word of mtimecmp. Compare value, high word.
0x00BFF8MTIME_LOW31:0valuerw0x00000000blockLow word of mtime. Time, low word.
0x00BFFCMTIME_HIGH31:0valuerw0x00000000blockHigh word of mtime. Time, high word.
ap_plic · register manual
OffsetRegisterBitsFieldAccessResetHeld byMeaning
0x004 + 4 × (n − 1), n = 1 to 16PRIORITY2:0levelrw0x0blockPriority of source n, 0 to 7. 0 never competes. Priority.
0x001000PENDING16:1sourcesroblockPending bits; bit number = source ID. One bit for each source.
0x002000ENABLE16:1sourcesrw0x0000blockEnable bits; bit number = source ID. One bit for each source.
0x200000THRESHOLD2:0levelrw0x0blockThe core sees a request only above this priority. Threshold.
0x200004CLAIM4:0idrw0x00blockRead: claim, returns the winner's ID and clears its pending bit. Write: complete, names the ID that is done. Source ID.
ap_pwrctl · register manual
OffsetRegisterBitsFieldAccessResetHeld byMeaning
0x000REQUEST0sleepwonot storedStarts a power sequence of PD_PER. 1 starts the switch-off.
0x000REQUEST1wakewonot stored1 starts the switch-on.
0x004STATUS2:0stateroblockWhere the sequencer is, and the levels it drives. 0 on, 1 isolate, 2 save, 3 off, 4 switch on, 5 restore.
0x004STATUS4isolateroblockIsolation enable.
0x004STATUS5saveroblockRetention save level.
0x004STATUS6power_onroblockPower switch closed.
0x008WAKE_ENABLE0padrw0x0regsWhich events may wake PD_PER. The wake detector.
0x008WAKE_ENABLE1watchdogrw0x0regsThe watchdog's early warning.
0x00CWAKE_CAUSE0padw1cblockWhy the last wake happened. A written 1 clears a bit. The wake detector.
0x00CWAKE_CAUSE1watchdogw1cblockThe watchdog's early warning.
0x00CWAKE_CAUSE2softwarew1cblockREQUEST bit 1.
0x010IRQ_ENABLE2:0causerw0x0regsWhich wake causes raise interrupt source 9. Numbered as WAKE_CAUSE.
DMA · register manual
OffsetRegisterBitsFieldAccessResetHeld byMeaning
0x000SRC31:0addressrw0x00000000regsThe address of the first byte to read. Byte address.
0x004DST31:0addressrw0x00000000regsThe address of the first byte to write. Byte address.
0x008LEN31:0bytesrw0x00000000regsThe number of bytes. Byte count.
0x00CSTART0startwonot storedBit 0 = 1 starts the job. Software writes it last. 1 starts the job.
0x014STATUS0busyroblockJob state (new in v1.5). A job is running.
0x014STATUS1donew1cblockThe last write of a job has finished.
0x014STATUS2faultw1cblockA bus error stopped the job.
0x018IRQ_ENABLE0donerw0x0regsWhich status bits raise interrupt source 5 (new in v1.5). DONE raises the request.
0x018IRQ_ENABLE1faultrw0x0regsFAULT raises the request.

Examples

Example 1

The Good Chip
Input
your table
Output
pass

Every bit in its place, every register at its own address, every hole an ERROR.

Example 2

A Hidden Faulty Chip
Input
your table on a faulty chip
Output
fail

One fault in the scope; one row must see it.

Example 3

Reach
Input
a table that skips a block
Output
refused if the block held a fault

A check cannot see where it does not go.

Constraints and Contract

  • At most 1,024 rows.
  • The good chip must pass. Each hidden faulty chip must fail one of your rows.

Hints

Hint 1

A walking one tests a bit in its own place; a pattern tests many at once.

Hint 2

Some blocks sit behind a slower bridge with its own return path.

Hint 3

Read-back values must differ between neighbours, or an alias passes.

What the grader checks: Your table runs on the pre-built ap_soc v1.5 bench with +core=bfm, on the good chip and on several hidden faulty chips. The good chip must pass with no bench error. The grader cannot see which rows caught a faulty chip.

1 checks on ap_soc v1.5 · bus seat · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your text only; the chip, the bench and the hidden checks stay on the server. 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 Sequence tableSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

The Good Chip

Input
your table
Expected output
pass

Every bit in its place, every register at its own address, every hole an ERROR.

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

ap_soc v1.5 · bus seat · server