Read pins.csv and irq.csv of ap_soc v1.5. Find the function on a pad, the PINMUX value for a set-up, and the interrupt sources a test can use.
Hardware context: The hand-off package of ap_soc v1.5: map.json, regs/*.json, connect.csv, pins.csv, irq.csv. Reviewing a chip's data files against its specification.
Work from the rows below, copied from tools/soc/ap_soc/pins.csv and irq.csv. PINMUX gives each pad IOn two bits at bits 2n + 1 to 2n; 0 releases the pad. Function codes are in the first table.
This worksheet uses named constants. The first three entries show how to record your decisions.
Replace each unresolved value of 4294967295 with your result.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Code | Function |
|---|---|
| 1 | gpio |
| 2 | uart_tx |
| 3 | uart_rx |
| 4 | spi_sclk |
| 5 | spi_miso |
| 6 | spi_mosi |
| 7 | spi_cs_n |
| 8 | pwm |
| 9 | capture |
| 10 | event_in |
| 11 | none: the pad has no function |
| pad | select | function |
|---|---|---|
| IO0 | 1 | gpio |
| IO0 | 2 | uart_tx |
| IO0 | 3 | pwm |
| IO1 | 1 | gpio |
| IO1 | 2 | uart_rx |
| IO1 | 3 | capture |
| IO2 | 1 | gpio |
| IO2 | 2 | spi_sclk |
| IO2 | 3 | pwm |
| IO3 | 1 | gpio |
| IO3 | 2 | spi_miso |
| IO3 | 3 | capture |
| IO4 | 1 | gpio |
| IO4 | 2 | spi_mosi |
| IO4 | 3 | event_in |
| IO5 | 1 | gpio |
| IO5 | 2 | spi_cs_n |
| IO6 | 1 | gpio |
| IO7 | 1 | gpio |
| IO8 | 1 | gpio |
| IO9 | 1 | gpio |
| IO10 | 1 | gpio |
| IO11 | 1 | gpio |
| IO12 | 1 | gpio |
| IO13 | 1 | gpio |
| IO14 | 1 | gpio |
| IO15 | 1 | gpio |
| IO15 | always | wake |
| id | device | from | clock |
|---|---|---|---|
| 1 | UART0 | u_uart.irq | clk_sys |
| 2 | GPIO | u_gpio.irq | clk_sys |
| 3 | Timer and PWM | u_timer.irq | clk_sys |
| 4 | SPI | u_spi.irq | clk_sys |
| 5 | DMA | u_dma.irq | clk_sys |
| 6 | Watchdog (early warning) | u_watchdog.irq | clk_aon |
| 7 | reserved | const | |
| 8 | reserved | const | |
| 9 | ap_pwrctl | u_pwrctl.irq | clk_aon |
| 10 | spare | const | |
| 11 | spare | const | |
| 12 | spare | const | |
| 13 | spare | const | |
| 14 | spare | const | |
| 15 | spare | const | |
| 16 | spare | const |
In ap_soc_irq, sources raised on clk_aon pass two flip-flops into clk_sys. An input function that no pad carries reads 0, except UART RX, which reads 1.
| Entry | Your decision |
|---|---|
| IO1_SERIAL | Function code of IO1 with PINMUX value 2. |
| IO4_AUX | Function code of IO4 with PINMUX value 3. |
| GPIO_SOURCE | ap_plic source of GPIO. |
| UART_BOTH | PINMUX value that gives IO0 UART TX and IO1 UART RX and releases every other pad. |
| SPI_FOUR | PINMUX value that gives IO2 to IO5 their SPI functions and releases every other pad. |
| IO5_AUX | Function code of IO5 with PINMUX value 3. |
| WAKE_PAD | Number of the pad the wake detector watches, whatever PINMUX says. |
| SYNC_SOURCES | How many sources pass two flip-flops in ap_soc_irq? |
| PWRCTL_SOURCE | ap_plic source of ap_pwrctl. |
| TIED_SOURCES | How many of the 16 sources are tied to 0? |
| RX_UNROUTED | What UART0 receives on its RX input when no pad carries uart_rx. |
| WIRED | Enter 1 if ap_plic source S comes from a device, 0 if it is tied to 0. |
Examples
Example 1
IO1 SERIAL- Input
Function code of IO1 with PINMUX value 2.
- Output
matches = 1
pins.csv: IO1,2,uart_rx.
Example 2
IO4 AUX- Input
Function code of IO4 with PINMUX value 3.
- Output
matches = 1
pins.csv: IO4,3,event_in.
Example 3
GPIO SOURCE- Input
ap_plic source of GPIO.
- Output
matches = 1
irq.csv: 2,GPIO.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For WIRED, enter a constant expression using S. Only this entry changes with the parameter. The supported integer range is 1 through 16, inclusive.
Hints
Hint 1
Pad n's field starts at bit 2n.
Hint 2
A pad has a function for a value only if pins.csv has that row.
Hint 3
A source raised on clk_aon crosses into clk_sys through two flip-flops.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
16 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 2 problems on this path