Raise each interrupt source of ap_soc alone, from the bus-manager seat. Prove it reaches ap_plic as its own ID and no other. Hidden faulty chips cross the wires.
Hardware context: The interrupt map of ap_soc v1.5 (irq.csv, ap_plic) and the DMA's request inputs. Every source to its own ID from the seat.
irq.csv says which wire drives each of ap_plic's sixteen inputs. A crossed wire still raises an interrupt, just with the wrong number. So a test that only waits for "an interrupt" passes it.
Write a sequence table for the bus-manager seat that raises sources 1, 2, 3, 4, 5 and 9, one at a time. For each: give it priority 1 and enable it at ap_plic, make its block ask, and read the pending word. The word must hold that source's bit and nothing else. Then claim, which must return the source's number. Clear the request at the block, complete the source, and check the pending word is empty again.
The good chip must pass. Each hidden faulty chip has one input of ap_plic wired to the wrong request; your table must fail on each.
Full specification
| ID | Source | How the seat makes it ask | How to clear it |
|---|---|---|---|
| 1 | UART0 receive | PINMUX select 2 on IO1, DIV 8, IRQ_ENABLE bit 1; the board sends a byte (tb uart_send) | Read RXDATA |
| 2 | GPIO | IRQ_ENABLE bit 8; the board pulses IO8 (tb gpio_pulse 8 3) | Write 1 to STATUS bit 8 |
| 3 | Timer and PWM | DIV_TOP 1, COMPARE 0, IRQ_ENABLE 1, RUN 1: a match comes within a few cycles | RUN 0, then IRQ_CLEAR 1 |
| 4 | SPI | IRQ_ENABLE 1; write a command to DATA; DONE rises when the frame ends | Write 1 to STATUS bit 1 |
| 5 | DMA | IRQ_ENABLE 1; a dma copy row runs a job to DONE | Write 1 to STATUS bit 1 |
| 9 | ap_pwrctl | IRQ_ENABLE bit 2; REQUEST 1 (sleep), wait for STATE 3, REQUEST 2 (software wake), wait for STATE 0 | Write 7 to WAKE_CAUSE |
| 6 | Watchdog | Not raised here: its warning needs thousands of always-on cycles | |
| 7, 8, 10 to 16 | Tied to 0 by irq.csv | Never; their bits must stay 0 in every pending read |
| ap_plic register | Address | Use |
|---|---|---|
| Priority of source n | 0x0C00_0000 + 4n | Non-zero lets it through |
| PENDING | 0x0C00_1000 | Bit n: source n is waiting |
| ENABLE | 0x0C00_2000 | Bit n: source n may be claimed |
| CLAIM | 0x0C20_0004 | A read claims the highest pending source; writing its number completes it |
Sources 6 and 9 come from the always-on clock through two flip-flops. Their bit reaches PENDING a few cycles after the block asks. Poll for the bit first, then check the whole word.
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). A core poll row reads until the masked value matches, at most data reads. tb gpio_expect compares the sixteen pads with mask and expect. 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.
| who | op | Meaning |
|---|---|---|
core | w wh wb | Write a word, a half, a byte of data at address; the answer must be OKAY |
core | r rh rb | Read; (value & mask) must equal (expect & mask) |
core | we re | Write or read that must answer ERROR |
core | wq rq | As w and r, with the next row's address phase on this row's data phase (back to back) |
core | poll | Read until the masked value is the expected one; data = the most reads (0: 1,000) |
core | irq | The interrupt pins now (bit 0 software, 1 timer, 2 external) against mask and expect |
core | wait_irq | Wait until a pin of mask is high; data = the most cycles |
core | idle | End a back-to-back run |
dma | copy | One job from address to data of mask bytes; STATUS must be expect (2 DONE, 4 FAULT) |
jtag | idcode | TAP reset, read IDCODE, compare |
jtag | halt resume step | Debug control (a halt waits for the core) |
jtag | rr rw | Read or write the register numbered address (0x1000 + n, a CSR, 0x7b0, 0x7b1) |
jtag | stream | Start background word reads at address A, count D, maximum random gap M, expected word E |
tb | wait_release | Wait for the system bus and core resets to release. Seat tables also hold each row at dispatch during reset. |
tb | watchdog | Set the seat stall limit to data system clocks (zero disables it). A stalled request reports its row, address and direction. |
tb | gaps | Maximum random gap D before each seat row, in system cycles (0 disables gaps) |
jtag | mr mw | Read or write a word of memory through the debug manager |
jtag | arm status | "Halt at reset" = data; {halted, error, busy} against mask and expect |
jtag | cmd | Command number address (0 to 7, facts 27.10) with the word data; its reply against mask and expect |
tb | uart_send | Send the byte data to the chip |
tb | uart_expect | The next byte from the chip must be expect; address = the most bit times to wait |
tb | gpio_set gpio_pulse | Pad address to level data; a pulse of data cycles of CLK |
tb | gpio_expect | The sixteen pads against mask and expect |
tb | reset supply | The reset pin, or the supply, for data cycles of CLK |
tb | wait_event | Wait until the test writes address to TB_EVENT |
tb | arg | Deposit data in TB_ARG |
tb | wait_status | Wait until (TB_STATUS & mask) equals (expect & mask) |
tb | poke peek | Back-door write of mask bytes (0: 4) of data; back-door read against mask, expect |
tb | wait | Only the delay |
sym | a symbol name | Back-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.
## The sequence table
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.
| who | op | Meaning |
| --- | --- | --- |
| `core` | `w` `wh` `wb` | Write a word, a half, a byte of `data` at `address`; the answer must be OKAY |
| `core` | `r` `rh` `rb` | Read; `(value & mask)` must equal `(expect & mask)` |
| `core` | `we` `re` | Write or read that must answer ERROR |
| `core` | `wq` `rq` | As `w` and `r`, with the next row's address phase on this row's data phase (back to back) |
| `core` | `poll` | Read until the masked value is the expected one; `data` = the most reads (0: 1,000) |
| `core` | `irq` | The interrupt pins now (bit 0 software, 1 timer, 2 external) against `mask` and `expect` |
| `core` | `wait_irq` | Wait until a pin of `mask` is high; `data` = the most cycles |
| `core` | `idle` | End a back-to-back run |
| `dma` | `copy` | One job from `address` to `data` of `mask` bytes; STATUS must be `expect` (2 DONE, 4 FAULT) |
| `jtag` | `idcode` | TAP reset, read IDCODE, compare |
| `jtag` | `halt` `resume` `step` | Debug control (a halt waits for the core) |
| `jtag` | `rr` `rw` | Read or write the register numbered `address` (`0x1000 + n`, a CSR, `0x7b0`, `0x7b1`) |
| `jtag` | `stream` | Start background word reads at address A, count D, maximum random gap M, expected word E |
| `tb` | `wait_release` | Wait for the system bus and core resets to release. Seat tables also hold each row at dispatch during reset. |
| `tb` | `watchdog` | Set the seat stall limit to `data` system clocks (zero disables it). A stalled request reports its row, address and direction. |
| `tb` | `gaps` | Maximum random gap D before each seat row, in system cycles (0 disables gaps) |
| `jtag` | `mr` `mw` | Read or write a word of memory through the debug manager |
| `jtag` | `arm` `status` | "Halt at reset" = `data`; `{halted, error, busy}` against `mask` and `expect` |
| `jtag` | `cmd` | Command number `address` (0 to 7, facts 27.10) with the word `data`; its reply against `mask` and `expect` |
| `tb` | `uart_send` | Send the byte `data` to the chip |
| `tb` | `uart_expect` | The next byte from the chip must be `expect`; `address` = the most bit times to wait |
| `tb` | `gpio_set` `gpio_pulse` | Pad `address` to level `data`; a pulse of `data` cycles of CLK |
| `tb` | `gpio_expect` | The sixteen pads against `mask` and `expect` |
| `tb` | `reset` `supply` | The reset pin, or the supply, for `data` cycles of CLK |
| `tb` | `wait_event` | Wait until the test writes `address` to TB_EVENT |
| `tb` | `arg` | Deposit `data` in TB_ARG |
| `tb` | `wait_status` | Wait until `(TB_STATUS & mask)` equals `(expect & mask)` |
| `tb` | `poke` `peek` | Back-door write of `mask` bytes (0: 4) of `data`; back-door read against `mask`, `expect` |
| `tb` | `wait` | Only the delay |
| `sym` | a symbol name | Back-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_plic · register manual
| Offset | Register | Bits | Field | Access | Reset | Held by | Meaning |
|---|---|---|---|---|---|---|---|
0x004 + 4 × (n − 1), n = 1 to 16 | PRIORITY | 2:0 | level | rw | 0x0 | block | Priority of source n, 0 to 7. 0 never competes. Priority. |
0x001000 | PENDING | 16:1 | sources | ro | block | Pending bits; bit number = source ID. One bit for each source. | |
0x002000 | ENABLE | 16:1 | sources | rw | 0x0000 | block | Enable bits; bit number = source ID. One bit for each source. |
0x200000 | THRESHOLD | 2:0 | level | rw | 0x0 | block | The core sees a request only above this priority. Threshold. |
0x200004 | CLAIM | 4:0 | id | rw | 0x00 | block | Read: claim, returns the winner's ID and clears its pending bit. Write: complete, names the ID that is done. Source ID. |
## ap_plic (base 0x0C00_0000, clk_sys, PD_MAIN) | Offset | Register | Bits | Field | Access | Reset | Held by | Meaning | | --- | --- | --- | --- | --- | --- | --- | --- | | `0x004` + 4 × (n − 1), n = 1 to 16 | PRIORITY | 2:0 | level | rw | `0x0` | block | Priority of source n, 0 to 7. 0 never competes. Priority. | | `0x001000` | PENDING | 16:1 | sources | ro | | block | Pending bits; bit number = source ID. One bit for each source. | | `0x002000` | ENABLE | 16:1 | sources | rw | `0x0000` | block | Enable bits; bit number = source ID. One bit for each source. | | `0x200000` | THRESHOLD | 2:0 | level | rw | `0x0` | block | The core sees a request only above this priority. Threshold. | | `0x200004` | CLAIM | 4:0 | id | rw | `0x00` | block | Read: claim, returns the winner's ID and clears its pending bit. Write: complete, names the ID that is done. Source ID. |
UART0 · register manual
| Offset | Register | Bits | Field | Access | Reset | Held by | Meaning |
|---|---|---|---|---|---|---|---|
0x000 | TXDATA | 7:0 | data | wo | not stored | The low byte is the next byte to send. Byte to send. | |
0x004 | STATUS | 0 | room | ro | block | Transmit room and receive queue state. The transmitter can take a byte. | |
0x004 | STATUS | 1 | rx_ready | ro | block | At least one received byte waits. | |
0x004 | STATUS | 2 | rx_full | ro | block | The receive queue is full. | |
0x008 | IRQ_ENABLE | 0 | room | rw | 0x0 | regs | Which status bits raise interrupt source 1. ROOM raises the request. |
0x008 | IRQ_ENABLE | 1 | rx_ready | rw | 0x0 | regs | RX_READY raises the request (new in v1.5). |
0x00C | RXDATA | 7:0 | data | ro | block | The oldest received byte. The read removes it from the queue. Received byte. | |
0x010 | DIV | 15:0 | cycles | rw | 0x0010 | regs | Bit time in clk_sys cycles (new in v1.5). clk_sys cycles a bit. |
## UART0 (base 0x1000_0000, interrupt source 1, clk_sys, PD_MAIN) | Offset | Register | Bits | Field | Access | Reset | Held by | Meaning | | --- | --- | --- | --- | --- | --- | --- | --- | | `0x000` | TXDATA | 7:0 | data | wo | | not stored | The low byte is the next byte to send. Byte to send. | | `0x004` | STATUS | 0 | room | ro | | block | Transmit room and receive queue state. The transmitter can take a byte. | | `0x004` | STATUS | 1 | rx_ready | ro | | block | At least one received byte waits. | | `0x004` | STATUS | 2 | rx_full | ro | | block | The receive queue is full. | | `0x008` | IRQ_ENABLE | 0 | room | rw | `0x0` | regs | Which status bits raise interrupt source 1. ROOM raises the request. | | `0x008` | IRQ_ENABLE | 1 | rx_ready | rw | `0x0` | regs | RX_READY raises the request (new in v1.5). | | `0x00C` | RXDATA | 7:0 | data | ro | | block | The oldest received byte. The read removes it from the queue. Received byte. | | `0x010` | DIV | 15:0 | cycles | rw | `0x0010` | regs | Bit time in clk_sys cycles (new in v1.5). clk_sys cycles a bit. |
GPIO · register manual
| Offset | Register | Bits | Field | Access | Reset | Held by | Meaning |
|---|---|---|---|---|---|---|---|
0x000 | DIR | 15:0 | value | rw | 0x0000 | regs | 1 turns the output driver of that pin on. One bit for each pin. |
0x004 | IN | 15:0 | value | ro | block | The pin levels, after two sampling flip-flops. One bit for each pin. | |
0x008 | OUT | 15:0 | value | rw | 0x0000 | regs | The saved output value. One bit for each pin. |
0x00C | SET | 15:0 | value | w1s | acts on OUT.value | A 1 sets that bit of OUT. One bit for each pin. | |
0x010 | CLR | 15:0 | value | w1c | acts on OUT.value | A 1 clears that bit of OUT. One bit for each pin. | |
0x014 | TGL | 15:0 | value | w1t | acts on OUT.value | A 1 inverts that bit of OUT. One bit for each pin. | |
0x018 | IRQ_ENABLE | 15:0 | value | rw | 0x0000 | regs | A 1 lets that pin's status bit raise interrupt source 2. One bit for each pin. |
0x01C | LEVEL_MODE | 15:0 | value | rw | 0x0000 | regs | 1: the pin is a level cause. 0: an edge cause. One bit for each pin. |
0x020 | ACTIVE_HIGH | 15:0 | value | rw | 0xFFFF | regs | 1: a high level, or a rising edge, is the event. One bit for each pin. |
0x024 | STATUS | 15:0 | value | w1c | block | Raw status. A written 1 clears the saved edge flag of that pin. One bit for each pin. | |
0x028 | MASKED_STATUS | 15:0 | value | ro | block | STATUS AND IRQ_ENABLE. One bit for each pin. |
## GPIO (base 0x1000_1000, interrupt source 2, clk_sys, PD_MAIN) | Offset | Register | Bits | Field | Access | Reset | Held by | Meaning | | --- | --- | --- | --- | --- | --- | --- | --- | | `0x000` | DIR | 15:0 | value | rw | `0x0000` | regs | 1 turns the output driver of that pin on. One bit for each pin. | | `0x004` | IN | 15:0 | value | ro | | block | The pin levels, after two sampling flip-flops. One bit for each pin. | | `0x008` | OUT | 15:0 | value | rw | `0x0000` | regs | The saved output value. One bit for each pin. | | `0x00C` | SET | 15:0 | value | w1s | | acts on OUT.value | A 1 sets that bit of OUT. One bit for each pin. | | `0x010` | CLR | 15:0 | value | w1c | | acts on OUT.value | A 1 clears that bit of OUT. One bit for each pin. | | `0x014` | TGL | 15:0 | value | w1t | | acts on OUT.value | A 1 inverts that bit of OUT. One bit for each pin. | | `0x018` | IRQ_ENABLE | 15:0 | value | rw | `0x0000` | regs | A 1 lets that pin's status bit raise interrupt source 2. One bit for each pin. | | `0x01C` | LEVEL_MODE | 15:0 | value | rw | `0x0000` | regs | 1: the pin is a level cause. 0: an edge cause. One bit for each pin. | | `0x020` | ACTIVE_HIGH | 15:0 | value | rw | `0xFFFF` | regs | 1: a high level, or a rising edge, is the event. One bit for each pin. | | `0x024` | STATUS | 15:0 | value | w1c | | block | Raw status. A written 1 clears the saved edge flag of that pin. One bit for each pin. | | `0x028` | MASKED_STATUS | 15:0 | value | ro | | block | STATUS AND IRQ_ENABLE. One bit for each pin. |
Timer and PWM · register manual
| Offset | Register | Bits | Field | Access | Reset | Held by | Meaning |
|---|---|---|---|---|---|---|---|
0x000 | RUN | 0 | run | rw | 0x0 | regs | Starts and stops the counter. 1: the counter runs. |
0x004 | DUTY | 2:0 | slots | rw | 0x0 | regs | How many of the four slots drive the PWM pin high. 0 to 4. |
0x008 | CAPTURED | 1:0 | slot | ro | block | The slot number saved when the capture input fired. Slot number. | |
0x00C | DIV_TOP | 7:0 | top | rw | 0x00 | regs | Prescaler: the last count before the slot number steps. A write restarts the prescaler. Last prescaler count. |
0x010 | COMPARE | 1:0 | slot | rw | 0x0 | regs | The slot number that raises match. Slot number. |
0x014 | IRQ_CLEAR | 0 | match | wo | not stored | Writing 1 to bit 0 clears the stored match flag. 1 clears the flag. | |
0x018 | IRQ_ENABLE | 0 | match | rw | 0x0 | regs | Lets the stored match flag raise interrupt source 3. 1 enables the request. |
0x020 | EVENT | 0 | enable | rw | 0x0 | regs | Six teaching fields (S6.8). Plain read and write. |
0x020 | EVENT | 1 | online | ro | block | A level from the hardware. | |
0x020 | EVENT | 2 | kick | wo | not stored | A written 1 makes one pulse. | |
0x020 | EVENT | 3 | pending | w1c | block | Set by an event; a written 1 clears it. | |
0x020 | EVENT | 4 | seen | rc | block | Set by an event; a read clears it. | |
0x020 | EVENT | 5 | route | rw | 0x0 | block | Takes the first write only. |
0x024 | EVENT_COUNT_LOW | 31:0 | value | ro | block | Low 32 bits of the 64-bit event counter. Count, low word. | |
0x028 | EVENT_COUNT_HIGH | 31:0 | value | ro | block | High 32 bits of the event counter. Count, high word. |
## Timer and PWM (base 0x1000_2000, interrupt source 3, clk_sys, PD_PER) | Offset | Register | Bits | Field | Access | Reset | Held by | Meaning | | --- | --- | --- | --- | --- | --- | --- | --- | | `0x000` | RUN | 0 | run | rw | `0x0` | regs | Starts and stops the counter. 1: the counter runs. | | `0x004` | DUTY | 2:0 | slots | rw | `0x0` | regs | How many of the four slots drive the PWM pin high. 0 to 4. | | `0x008` | CAPTURED | 1:0 | slot | ro | | block | The slot number saved when the capture input fired. Slot number. | | `0x00C` | DIV_TOP | 7:0 | top | rw | `0x00` | regs | Prescaler: the last count before the slot number steps. A write restarts the prescaler. Last prescaler count. | | `0x010` | COMPARE | 1:0 | slot | rw | `0x0` | regs | The slot number that raises match. Slot number. | | `0x014` | IRQ_CLEAR | 0 | match | wo | | not stored | Writing 1 to bit 0 clears the stored match flag. 1 clears the flag. | | `0x018` | IRQ_ENABLE | 0 | match | rw | `0x0` | regs | Lets the stored match flag raise interrupt source 3. 1 enables the request. | | `0x020` | EVENT | 0 | enable | rw | `0x0` | regs | Six teaching fields (S6.8). Plain read and write. | | `0x020` | EVENT | 1 | online | ro | | block | A level from the hardware. | | `0x020` | EVENT | 2 | kick | wo | | not stored | A written 1 makes one pulse. | | `0x020` | EVENT | 3 | pending | w1c | | block | Set by an event; a written 1 clears it. | | `0x020` | EVENT | 4 | seen | rc | | block | Set by an event; a read clears it. | | `0x020` | EVENT | 5 | route | rw | `0x0` | block | Takes the first write only. | | `0x024` | EVENT_COUNT_LOW | 31:0 | value | ro | | block | Low 32 bits of the 64-bit event counter. Count, low word. | | `0x028` | EVENT_COUNT_HIGH | 31:0 | value | ro | | block | High 32 bits of the event counter. Count, high word. |
SPI · register manual
| Offset | Register | Bits | Field | Access | Reset | Held by | Meaning |
|---|---|---|---|---|---|---|---|
0x000 | DATA | 7:0 | command | wo | not stored | Write: a command byte; the write starts a frame of 32 serial clocks. Read: the last 24 bits received. Command byte. | |
0x000 | DATA | 23:0 | received | ro | block | Last 24 bits received. | |
0x004 | STATUS | 0 | busy | ro | block | Frame state. A frame is running, and chip select is low. | |
0x004 | STATUS | 1 | done | w1c | block | A frame has ended (new in v1.5). | |
0x008 | IRQ_ENABLE | 0 | done | rw | 0x0 | regs | Lets DONE raise interrupt source 4 (new in v1.5). 1 enables the request. |
## SPI (base 0x1000_5000, interrupt source 4, clk_sys, PD_PER) | Offset | Register | Bits | Field | Access | Reset | Held by | Meaning | | --- | --- | --- | --- | --- | --- | --- | --- | | `0x000` | DATA | 7:0 | command | wo | | not stored | Write: a command byte; the write starts a frame of 32 serial clocks. Read: the last 24 bits received. Command byte. | | `0x000` | DATA | 23:0 | received | ro | | block | Last 24 bits received. | | `0x004` | STATUS | 0 | busy | ro | | block | Frame state. A frame is running, and chip select is low. | | `0x004` | STATUS | 1 | done | w1c | | block | A frame has ended (new in v1.5). | | `0x008` | IRQ_ENABLE | 0 | done | rw | `0x0` | regs | Lets DONE raise interrupt source 4 (new in v1.5). 1 enables the request. |
DMA · register manual
| Offset | Register | Bits | Field | Access | Reset | Held by | Meaning |
|---|---|---|---|---|---|---|---|
0x000 | SRC | 31:0 | address | rw | 0x00000000 | regs | The address of the first byte to read. Byte address. |
0x004 | DST | 31:0 | address | rw | 0x00000000 | regs | The address of the first byte to write. Byte address. |
0x008 | LEN | 31:0 | bytes | rw | 0x00000000 | regs | The number of bytes. Byte count. |
0x00C | START | 0 | start | wo | not stored | Bit 0 = 1 starts the job. Software writes it last. 1 starts the job. | |
0x014 | STATUS | 0 | busy | ro | block | Job state (new in v1.5). A job is running. | |
0x014 | STATUS | 1 | done | w1c | block | The last write of a job has finished. | |
0x014 | STATUS | 2 | fault | w1c | block | A bus error stopped the job. | |
0x018 | IRQ_ENABLE | 0 | done | rw | 0x0 | regs | Which status bits raise interrupt source 5 (new in v1.5). DONE raises the request. |
0x018 | IRQ_ENABLE | 1 | fault | rw | 0x0 | regs | FAULT raises the request. |
## DMA (base 0x1000_6000, interrupt source 5, clk_sys, PD_MAIN) | Offset | Register | Bits | Field | Access | Reset | Held by | Meaning | | --- | --- | --- | --- | --- | --- | --- | --- | | `0x000` | SRC | 31:0 | address | rw | `0x00000000` | regs | The address of the first byte to read. Byte address. | | `0x004` | DST | 31:0 | address | rw | `0x00000000` | regs | The address of the first byte to write. Byte address. | | `0x008` | LEN | 31:0 | bytes | rw | `0x00000000` | regs | The number of bytes. Byte count. | | `0x00C` | START | 0 | start | wo | | not stored | Bit 0 = 1 starts the job. Software writes it last. 1 starts the job. | | `0x014` | STATUS | 0 | busy | ro | | block | Job state (new in v1.5). A job is running. | | `0x014` | STATUS | 1 | done | w1c | | block | The last write of a job has finished. | | `0x014` | STATUS | 2 | fault | w1c | | block | A bus error stopped the job. | | `0x018` | IRQ_ENABLE | 0 | done | rw | `0x0` | regs | Which status bits raise interrupt source 5 (new in v1.5). DONE raises the request. | | `0x018` | IRQ_ENABLE | 1 | fault | rw | `0x0` | regs | FAULT raises the request. |
ap_pwrctl · register manual
| Offset | Register | Bits | Field | Access | Reset | Held by | Meaning |
|---|---|---|---|---|---|---|---|
0x000 | REQUEST | 0 | sleep | wo | not stored | Starts a power sequence of PD_PER. 1 starts the switch-off. | |
0x000 | REQUEST | 1 | wake | wo | not stored | 1 starts the switch-on. | |
0x004 | STATUS | 2:0 | state | ro | block | Where the sequencer is, and the levels it drives. 0 on, 1 isolate, 2 save, 3 off, 4 switch on, 5 restore. | |
0x004 | STATUS | 4 | isolate | ro | block | Isolation enable. | |
0x004 | STATUS | 5 | save | ro | block | Retention save level. | |
0x004 | STATUS | 6 | power_on | ro | block | Power switch closed. | |
0x008 | WAKE_ENABLE | 0 | pad | rw | 0x0 | regs | Which events may wake PD_PER. The wake detector. |
0x008 | WAKE_ENABLE | 1 | watchdog | rw | 0x0 | regs | The watchdog's early warning. |
0x00C | WAKE_CAUSE | 0 | pad | w1c | block | Why the last wake happened. A written 1 clears a bit. The wake detector. | |
0x00C | WAKE_CAUSE | 1 | watchdog | w1c | block | The watchdog's early warning. | |
0x00C | WAKE_CAUSE | 2 | software | w1c | block | REQUEST bit 1. | |
0x010 | IRQ_ENABLE | 2:0 | cause | rw | 0x0 | regs | Which wake causes raise interrupt source 9. Numbered as WAKE_CAUSE. |
## ap_pwrctl (base 0x1000_8000, interrupt source 9, clk_aon, PD_AON) | Offset | Register | Bits | Field | Access | Reset | Held by | Meaning | | --- | --- | --- | --- | --- | --- | --- | --- | | `0x000` | REQUEST | 0 | sleep | wo | | not stored | Starts a power sequence of PD_PER. 1 starts the switch-off. | | `0x000` | REQUEST | 1 | wake | wo | | not stored | 1 starts the switch-on. | | `0x004` | STATUS | 2:0 | state | ro | | block | Where the sequencer is, and the levels it drives. 0 on, 1 isolate, 2 save, 3 off, 4 switch on, 5 restore. | | `0x004` | STATUS | 4 | isolate | ro | | block | Isolation enable. | | `0x004` | STATUS | 5 | save | ro | | block | Retention save level. | | `0x004` | STATUS | 6 | power_on | ro | | block | Power switch closed. | | `0x008` | WAKE_ENABLE | 0 | pad | rw | `0x0` | regs | Which events may wake PD_PER. The wake detector. | | `0x008` | WAKE_ENABLE | 1 | watchdog | rw | `0x0` | regs | The watchdog's early warning. | | `0x00C` | WAKE_CAUSE | 0 | pad | w1c | | block | Why the last wake happened. A written 1 clears a bit. The wake detector. | | `0x00C` | WAKE_CAUSE | 1 | watchdog | w1c | | block | The watchdog's early warning. | | `0x00C` | WAKE_CAUSE | 2 | software | w1c | | block | REQUEST bit 1. | | `0x010` | IRQ_ENABLE | 2:0 | cause | rw | `0x0` | regs | Which wake causes raise interrupt source 9. Numbered as WAKE_CAUSE. |
Examples
Example 1
The Good Chip- Input
your table
- Output
pass
Each source sets exactly its own bit, and each claim returns its own number.
Example 2
A Hidden Faulty Chip- Input
your table on a faulty chip
- Output
fail: a row did not get its expected answer
One input of ap_plic follows the wrong request. Either a bit is missing or an extra one rises.
Example 3
What Does Not Count- Input
a table that raises two sources
- Output
refused
A crossed wire on a source you never raised passes.
Constraints and Contract
- At most 120 rows.
- The good chip must pass. Each hidden faulty chip must fail one of your rows.
Hints
Hint 1
A crossed wire can make one source raise two bits at once. Which mask sees that?
Hint 2
A claim takes the source; it stays taken until you write its number back.
Hint 3
Source 9 starts in the always-on domain. Give its bit time to arrive before you check the word.
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. Own-bit reads are refused even when every source is raised. ap_plic keeps a bit pending until it is claimed. So a crossed request can leave a stale bit, and a later own-bit read takes it for its own. Sources 6 to 8 and 10 to 16 are not raised.
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 2 problems on this path