Home

Awesome

Basic Peripheral SoC

Github: http://github.com/ultraembedded/core_soc

A basic SoC with Timer, UART, SPI, GPIO and Interrupt Controller peripherals.

Features

Configuration

Memory Map

RangeDescription
0x0000_0000 - 0x00ff_ffffPeripheral - IRQ controller
0x0100_0000 - 0x01ff_ffffPeripheral - Timer
0x0200_0000 - 0x02ff_ffffPeripheral - UART
0x0300_0000 - 0x03ff_ffffPeripheral - SPI
0x0400_0000 - 0x04ff_ffffPeripheral - GPIO
0x0500_0000 - 0x05ff_ffffPeripheral - External 1
0x0600_0000 - 0x06ff_ffffPeripheral - External 2
0x0700_0000 - 0x07ff_ffffPeripheral - External 3

Interrupt Sources

IndexSource
0Peripheral - Timer
1Peripheral - UART
2Peripheral - SPI
3Peripheral - GPIO
4Peripheral - External 1
5Peripheral - External 2
6Peripheral - External 3

Peripheral Register Map

OffsetNameDescription
0x0000_0000IRQ_ISR[RW] Interrupt Status Register
0x0000_0004IRQ_IPR[R] Interrupt Pending Register
0x0000_0008IRQ_IER[RW] Interrupt Enable Register
0x0000_000cIRQ_IAR[W] Interrupt Acknowledge Register
0x0000_0010IRQ_SIE[W] Set Interrupt Enable bits
0x0000_0014IRQ_CIE[W] Clear Interrupt Enable bits
0x0000_0018IRQ_IVR[RW] Interrupt Vector Register
0x0000_001cIRQ_MER[RW] Master Enable Register
0x0100_0008TIMER_CTRL0[RW] Control
0x0100_000cTIMER_CMP0[RW] Compare value (interrupt on match)
0x0100_0010TIMER_VAL0[RW] Current Value
0x0100_0014TIMER_CTRL1[RW] Control
0x0100_0018TIMER_CMP1[RW] Compare value (interrupt on match)
0x0100_001cTIMER_VAL1[RW] Current Value
0x0200_0000ULITE_RX[R] UART Data Register
0x0200_0004ULITE_TX[W] UART Data Register
0x0200_0008ULITE_STATUS[R] UART Status Register
0x0200_000cULITE_CONTROL[RW] UART Configuration Register
0x0300_001cSPI_DGIER[RW] Device Global Interrupt Enable Register
0x0300_0020SPI_IPISR[RW] IP Interrupt Status Register
0x0300_0028SPI_IPIER[RW] IP Interrupt Enable Register
0x0300_0040SPI_SRR[RW] Software Reset Register
0x0300_0060SPI_CR[RW] SPI Control Register
0x0300_0064SPI_SR[R] SPI Status Register
0x0300_0068SPI_DTR[W] SPI Data Transmit Register
0x0300_006cSPI_DRR[R] SPI Data Receive Register
0x0300_0070SPI_SSR[RW] SPI Slave Select Register
0x0400_0000GPIO_DIRECTION[RW] Configuration Register
0x0400_0004GPIO_INPUT[R] GPIO Input Status
0x0400_0008GPIO_OUTPUT[RW] GPIO Output Control
0x0400_000cGPIO_OUTPUT_SET[W] GPIO Output Control Set Alias
0x0400_0010GPIO_OUTPUT_CLR[W] GPIO Output Control Clr Alias
0x0400_0014GPIO_INT_MASK[RW] GPIO Interrupt Enable Mask
0x0400_0018GPIO_INT_SET[W] GPIO Interrupt Set
0x0400_001cGPIO_INT_CLR[W] GPIO Interrupt Clear
0x0400_0020GPIO_INT_STATUS[R] GPIO Interrupt Raw Status
0x0400_0024GPIO_INT_LEVEL[RW] GPIO Interrupt Level
0x0400_0028GPIO_INT_MODE[RW] GPIO Interrupt Mode

Peripheral Register Fields

IRQ Register: IRQ_ISR
BitsNameDescription
7:0STATUSPending interrupt (unmasked) bitmap.
IRQ Register: IRQ_IPR
BitsNameDescription
7:0PENDINGPending interrupts (masked) bitmap.
IRQ Register: IRQ_IER
BitsNameDescription
7:0ENABLEInterrupt enable mask.
IRQ Register: IRQ_IAR
BitsNameDescription
7:0ACKBitmap of interrupts to acknowledge.
IRQ Register: IRQ_SIE
BitsNameDescription
7:0SETBitmap of interrupts to enable.
IRQ Register: IRQ_CIE
BitsNameDescription
7:0CLRBitmap of interrupts to disable.
IRQ Register: IRQ_IVR
BitsNameDescription
31:0VECTORHighest priority active interrupt number.
IRQ Register: IRQ_MER
BitsNameDescription
0MEMaster Enable
Timer Register: TIMER_CTRLx
BitsNameDescription
1INTERRUPTInterrupt enable.
2ENABLETimer enable.
Timer Register: TIMER_CMPx
BitsNameDescription
31:0VALUEMatch value.
Timer Register: TIMER_VALx
BitsNameDescription
31:0CURRENTCurrent timer value.
UART Register: ULITE_RX
BitsNameDescription
7:0DATADate byte
UART Register: ULITE_TX
BitsNameDescription
7:0DATADate byte
UART Register: ULITE_STATUS
BitsNameDescription
4IEInterrupt enabled
3TXFULLTransmit buffer full
2TXEMPTYTransmit buffer empty
1RXFULLReceive buffer full
0RXVALIDReceive buffer not empty
UART Register: ULITE_CONTROL
BitsNameDescription
4IEInterrupt enable
1RST_RXFlush Rx Buffer
0RST_TXFlush Tx Buffer
SPI Register: SPI_DGIER
BitsNameDescription
31GIEGlobal interrupt enable.
SPI Register: SPI_IPISR
BitsNameDescription
2TX_EMPTYTx FIFO empty interrupt status.
SPI Register: SPI_IPIER
BitsNameDescription
2TX_EMPTYTx FIFO interrupt enable.
SPI Register: SPI_SRR
BitsNameDescription
31:0RESETSoftware FIFO reset.
SPI Register: SPI_CR
BitsNameDescription
0LOOPLoopback enable (MOSI to MISO).
1SPESPI Enable.
2MASTERMaster mode (slave mode not currently supported).
3CPOLClock polarity.
4CPHAClock phase.
5TXFIFO_RSTTx FIFO reset.
6RXFIFO_RSTRx FIFO reset.
7MANUAL_SSManual chip select mode (auto mode not supported).
8TRANS_INHIBITTransfer inhibit.
9LSB_FIRSTData LSB first (1) or MSB first (0).
SPI Register: SPI_SR
BitsNameDescription
0RX_EMPTYRx FIFO empty.
1RX_FULLRx FIFO full.
2TX_EMPTYTx FIFO empty.
3TX_FULLTx FIFO full.
SPI Register: SPI_DTR
BitsNameDescription
7:0DATADate byte
SPI Register: SPI_DRR
BitsNameDescription
7:0DATADate byte
SPI Register: SPI_SSR
BitsNameDescription
0VALUEChip select value
GPIO Register: GPIO_DIRECTION
BitsNameDescription
31:0OUTPUT0 = Input, 1 = Output
GPIO Register: GPIO_INPUT
BitsNameDescription
31:0VALUERaw input status
GPIO Register: GPIO_OUTPUT
BitsNameDescription
31:0DATAGPIO output value
GPIO Register: GPIO_OUTPUT_SET
BitsNameDescription
31:0DATAGPIO output mask - set for high
GPIO Register: GPIO_OUTPUT_CLR
BitsNameDescription
31:0DATAGPIO output mask - set for low
GPIO Register: GPIO_INT_MASK
BitsNameDescription
31:0ENABLEGPIO Interrupt Enable Mask
GPIO Register: GPIO_INT_SET
BitsNameDescription
31:0SW_IRQWrite 1 to assert an interrupt
GPIO Register: GPIO_INT_CLR
BitsNameDescription
31:0ACKWrite 1 to clear an interrupt
GPIO Register: GPIO_INT_STATUS
BitsNameDescription
31:0RAWSet if interrupt active (regardless of INT_MASK)
GPIO Register: GPIO_INT_LEVEL
BitsNameDescription
31:0ACTIVE_HIGHGPIO Interrupt Level - 1 = active high / rising edge, 0 = active low / falling edge
GPIO Register: GPIO_INT_MODE
BitsNameDescription
31:0EDGEGPIO Interrupt Mode - 1 = edge triggered, 0 = level