Github: http://github.com/ultraembedded/core_soc
A basic SoC with Timer, UART, SPI, GPIO and Interrupt Controller peripherals.
- Multi-channel timer peripheral.
- UART peripheral.
- SPI (master mode) peripheral with 8 chip selects.
- 32 I/O GPIO controller.
- 3 external peripherals (AXI4-Lite interface).
- Interrupt controller (combines peripheral IRQs into single IRQ).
- AXI4-Lite slave interface.
- Top: core_soc
- Clock: clk_i
- Reset: rst_i - Asynchronous, active high
- parameter CLK_FREQ - Clock speed (in Hz)
- parameter BAUDRATE - UART baud rate (e.g. 115200)
- parameter C_SCK_RATIO - SPI clock divider ratio for clk_i -> spi_clk_o
Range | Description |
---|---|
0x0000_0000 - 0x00ff_ffff | Peripheral - IRQ controller |
0x0100_0000 - 0x01ff_ffff | Peripheral - Timer |
0x0200_0000 - 0x02ff_ffff | Peripheral - UART |
0x0300_0000 - 0x03ff_ffff | Peripheral - SPI |
0x0400_0000 - 0x04ff_ffff | Peripheral - GPIO |
0x0500_0000 - 0x05ff_ffff | Peripheral - External 1 |
0x0600_0000 - 0x06ff_ffff | Peripheral - External 2 |
0x0700_0000 - 0x07ff_ffff | Peripheral - External 3 |
Index | Source |
---|---|
0 | Peripheral - Timer |
1 | Peripheral - UART |
2 | Peripheral - SPI |
3 | Peripheral - GPIO |
4 | Peripheral - External 1 |
5 | Peripheral - External 2 |
6 | Peripheral - External 3 |
Offset | Name | Description |
---|---|---|
0x0000_0000 | IRQ_ISR | [RW] Interrupt Status Register |
0x0000_0004 | IRQ_IPR | [R] Interrupt Pending Register |
0x0000_0008 | IRQ_IER | [RW] Interrupt Enable Register |
0x0000_000c | IRQ_IAR | [W] Interrupt Acknowledge Register |
0x0000_0010 | IRQ_SIE | [W] Set Interrupt Enable bits |
0x0000_0014 | IRQ_CIE | [W] Clear Interrupt Enable bits |
0x0000_0018 | IRQ_IVR | [RW] Interrupt Vector Register |
0x0000_001c | IRQ_MER | [RW] Master Enable Register |
0x0100_0008 | TIMER_CTRL0 | [RW] Control |
0x0100_000c | TIMER_CMP0 | [RW] Compare value (interrupt on match) |
0x0100_0010 | TIMER_VAL0 | [RW] Current Value |
0x0100_0014 | TIMER_CTRL1 | [RW] Control |
0x0100_0018 | TIMER_CMP1 | [RW] Compare value (interrupt on match) |
0x0100_001c | TIMER_VAL1 | [RW] Current Value |
0x0200_0000 | ULITE_RX | [R] UART Data Register |
0x0200_0004 | ULITE_TX | [W] UART Data Register |
0x0200_0008 | ULITE_STATUS | [R] UART Status Register |
0x0200_000c | ULITE_CONTROL | [RW] UART Configuration Register |
0x0300_001c | SPI_DGIER | [RW] Device Global Interrupt Enable Register |
0x0300_0020 | SPI_IPISR | [RW] IP Interrupt Status Register |
0x0300_0028 | SPI_IPIER | [RW] IP Interrupt Enable Register |
0x0300_0040 | SPI_SRR | [RW] Software Reset Register |
0x0300_0060 | SPI_CR | [RW] SPI Control Register |
0x0300_0064 | SPI_SR | [R] SPI Status Register |
0x0300_0068 | SPI_DTR | [W] SPI Data Transmit Register |
0x0300_006c | SPI_DRR | [R] SPI Data Receive Register |
0x0300_0070 | SPI_SSR | [RW] SPI Slave Select Register |
0x0400_0000 | GPIO_DIRECTION | [RW] Configuration Register |
0x0400_0004 | GPIO_INPUT | [R] GPIO Input Status |
0x0400_0008 | GPIO_OUTPUT | [RW] GPIO Output Control |
0x0400_000c | GPIO_OUTPUT_SET | [W] GPIO Output Control Set Alias |
0x0400_0010 | GPIO_OUTPUT_CLR | [W] GPIO Output Control Clr Alias |
0x0400_0014 | GPIO_INT_MASK | [RW] GPIO Interrupt Enable Mask |
0x0400_0018 | GPIO_INT_SET | [W] GPIO Interrupt Set |
0x0400_001c | GPIO_INT_CLR | [W] GPIO Interrupt Clear |
0x0400_0020 | GPIO_INT_STATUS | [R] GPIO Interrupt Raw Status |
0x0400_0024 | GPIO_INT_LEVEL | [RW] GPIO Interrupt Level |
0x0400_0028 | GPIO_INT_MODE | [RW] GPIO Interrupt Mode |
Bits | Name | Description |
---|---|---|
7:0 | STATUS | Pending interrupt (unmasked) bitmap. |
Bits | Name | Description |
---|---|---|
7:0 | PENDING | Pending interrupts (masked) bitmap. |
Bits | Name | Description |
---|---|---|
7:0 | ENABLE | Interrupt enable mask. |
Bits | Name | Description |
---|---|---|
7:0 | ACK | Bitmap of interrupts to acknowledge. |
Bits | Name | Description |
---|---|---|
7:0 | SET | Bitmap of interrupts to enable. |
Bits | Name | Description |
---|---|---|
7:0 | CLR | Bitmap of interrupts to disable. |
Bits | Name | Description |
---|---|---|
31:0 | VECTOR | Highest priority active interrupt number. |
Bits | Name | Description |
---|---|---|
0 | ME | Master Enable |
Bits | Name | Description |
---|---|---|
1 | INTERRUPT | Interrupt enable. |
2 | ENABLE | Timer enable. |
Bits | Name | Description |
---|---|---|
31:0 | VALUE | Match value. |
Bits | Name | Description |
---|---|---|
31:0 | CURRENT | Current timer value. |
Bits | Name | Description |
---|---|---|
7:0 | DATA | Date byte |
Bits | Name | Description |
---|---|---|
7:0 | DATA | Date byte |
Bits | Name | Description |
---|---|---|
4 | IE | Interrupt enabled |
3 | TXFULL | Transmit buffer full |
2 | TXEMPTY | Transmit buffer empty |
1 | RXFULL | Receive buffer full |
0 | RXVALID | Receive buffer not empty |
Bits | Name | Description |
---|---|---|
4 | IE | Interrupt enable |
1 | RST_RX | Flush Rx Buffer |
0 | RST_TX | Flush Tx Buffer |
Bits | Name | Description |
---|---|---|
31 | GIE | Global interrupt enable. |
Bits | Name | Description |
---|---|---|
2 | TX_EMPTY | Tx FIFO empty interrupt status. |
Bits | Name | Description |
---|---|---|
2 | TX_EMPTY | Tx FIFO interrupt enable. |
Bits | Name | Description |
---|---|---|
31:0 | RESET | Software FIFO reset. |
Bits | Name | Description |
---|---|---|
0 | LOOP | Loopback enable (MOSI to MISO). |
1 | SPE | SPI Enable. |
2 | MASTER | Master mode (slave mode not currently supported). |
3 | CPOL | Clock polarity. |
4 | CPHA | Clock phase. |
5 | TXFIFO_RST | Tx FIFO reset. |
6 | RXFIFO_RST | Rx FIFO reset. |
7 | MANUAL_SS | Manual chip select mode (auto mode not supported). |
8 | TRANS_INHIBIT | Transfer inhibit. |
9 | LSB_FIRST | Data LSB first (1) or MSB first (0). |
Bits | Name | Description |
---|---|---|
0 | RX_EMPTY | Rx FIFO empty. |
1 | RX_FULL | Rx FIFO full. |
2 | TX_EMPTY | Tx FIFO empty. |
3 | TX_FULL | Tx FIFO full. |
Bits | Name | Description |
---|---|---|
7:0 | DATA | Date byte |
Bits | Name | Description |
---|---|---|
7:0 | DATA | Date byte |
Bits | Name | Description |
---|---|---|
0 | VALUE | Chip select value |
Bits | Name | Description |
---|---|---|
31:0 | OUTPUT | 0 = Input, 1 = Output |
Bits | Name | Description |
---|---|---|
31:0 | VALUE | Raw input status |
Bits | Name | Description |
---|---|---|
31:0 | DATA | GPIO output value |
Bits | Name | Description |
---|---|---|
31:0 | DATA | GPIO output mask - set for high |
Bits | Name | Description |
---|---|---|
31:0 | DATA | GPIO output mask - set for low |
Bits | Name | Description |
---|---|---|
31:0 | ENABLE | GPIO Interrupt Enable Mask |
Bits | Name | Description |
---|---|---|
31:0 | SW_IRQ | Write 1 to assert an interrupt |
Bits | Name | Description |
---|---|---|
31:0 | ACK | Write 1 to clear an interrupt |
Bits | Name | Description |
---|---|---|
31:0 | RAW | Set if interrupt active (regardless of INT_MASK) |
Bits | Name | Description |
---|---|---|
31:0 | ACTIVE_HIGH | GPIO Interrupt Level - 1 = active high / rising edge, 0 = active low / falling edge |
Bits | Name | Description |
---|---|---|
31:0 | EDGE | GPIO Interrupt Mode - 1 = edge triggered, 0 = level |