V2.1.2 Read the Pins and the Interrupts

EasyImplement12 minIcarus Verilog · serverReview the topic

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

SignalWidthRole
question8input of each check
Full specification
CodeFunction
1gpio
2uart_tx
3uart_rx
4spi_sclk
5spi_miso
6spi_mosi
7spi_cs_n
8pwm
9capture
10event_in
11none: the pad has no function
padselectfunction
IO01gpio
IO02uart_tx
IO03pwm
IO11gpio
IO12uart_rx
IO13capture
IO21gpio
IO22spi_sclk
IO23pwm
IO31gpio
IO32spi_miso
IO33capture
IO41gpio
IO42spi_mosi
IO43event_in
IO51gpio
IO52spi_cs_n
IO61gpio
IO71gpio
IO81gpio
IO91gpio
IO101gpio
IO111gpio
IO121gpio
IO131gpio
IO141gpio
IO151gpio
IO15alwayswake
iddevicefromclock
1UART0u_uart.irqclk_sys
2GPIOu_gpio.irqclk_sys
3Timer and PWMu_timer.irqclk_sys
4SPIu_spi.irqclk_sys
5DMAu_dma.irqclk_sys
6Watchdog (early warning)u_watchdog.irqclk_aon
7reservedconst
8reservedconst
9ap_pwrctlu_pwrctl.irqclk_aon
10spareconst
11spareconst
12spareconst
13spareconst
14spareconst
15spareconst
16spareconst

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.

EntryYour decision
IO1_SERIALFunction code of IO1 with PINMUX value 2.
IO4_AUXFunction code of IO4 with PINMUX value 3.
GPIO_SOURCEap_plic source of GPIO.
UART_BOTHPINMUX value that gives IO0 UART TX and IO1 UART RX and releases every other pad.
SPI_FOURPINMUX value that gives IO2 to IO5 their SPI functions and releases every other pad.
IO5_AUXFunction code of IO5 with PINMUX value 3.
WAKE_PADNumber of the pad the wake detector watches, whatever PINMUX says.
SYNC_SOURCESHow many sources pass two flip-flops in ap_soc_irq?
PWRCTL_SOURCEap_plic source of ap_pwrctl.
TIED_SOURCESHow many of the 16 sources are tied to 0?
RX_UNROUTEDWhat UART0 receives on its RX input when no pad carries uart_rx.
WIREDEnter 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

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

IO1 SERIAL

Input
Function code of IO1 with PINMUX value 2.
Expected output
matches = 1

pins.csv: IO1,2,uart_rx.

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

Icarus Verilog · server