URL
https://opencores.org/ocsvn/potato/potato/trunk
Subversion Repositories potato
Compare Revisions
- This comparison shows the changes necessary to convert path
/potato/trunk/benchmarks
- from Rev 63 to Rev 65
- ↔ Reverse comparison
Rev 63 → Rev 65
/sha256/main.c
73,7 → 73,7
uart_puts(IO_ADDRESS(UART_BASE), "The Potato Processor SHA256 Benchmark\n\r\n\r"); |
|
// Enable interrupts: |
potato_enable_irq(TIMER_IRQ); |
potato_enable_irq(IRQ_TIMER); |
potato_enable_interrupts(); |
|
struct sha256_context context; |
/sha256/uart.c
17,8 → 17,8
void uart_putc(volatile uint32_t * base, char c) |
{ |
// Wait until there is room in the transmit buffer: |
while(base[UART_STATUS >> 2] & (1 << 3)); |
base[UART_TX >> 2] = c & 0x000000ff; |
while(base[UART_STATUS >> 2] & (1 << UART_STATUS_TXBUF_FULL)); |
base[UART_TX >> 2] = c & 0xff; |
} |
|
void uart_puth(volatile uint32_t * base, uint32_t n) |
/platform.h
24,8 → 24,10
#define SEG7_BASE 0x00006000 |
|
// IRQs: |
#define EXTERNAL_IRQ 0 |
#define TIMER_IRQ 5 |
#define IRQ_EXTERNAL 0 |
#define IRQ_UART_RTS 1 |
#define IRQ_UART_RECV 2 |
#define IRQ_TIMER 5 |
|
// GPIO register offsets: |
#define GPIO_INPUT 0 |
37,6 → 39,12
#define UART_RX 4 |
#define UART_STATUS 8 |
|
// UART status register bits: |
#define UART_STATUS_RXBUF_EMPTY 0 |
#define UART_STATUS_TXBUF_EMPTY 1 |
#define UART_STATUS_RXBUF_FULL 2 |
#define UART_STATUS_TXBUF_FULL 3 |
|
// Timer register offsets: |
#define TIMER_CTRL 0 |
#define TIMER_COMPARE 4 |
/potato.h
5,6 → 5,12
#ifndef POTATO_H |
#define POTATO_H |
|
// Number of IRQs supported: |
#define POTATO_NUM_IRQS 8 |
|
// Implementation-specific CSRs: |
#define CSR_PP_CACHECTRL 0x790 |
|
// Exception cause values: |
#define CAUSE_INSTR_MISALIGN 0x00 |
#define CAUSE_INSTR_FETCH 0x01 |
25,6 → 31,9
#define STATUS_IE 0 // Enable Interrupts |
#define STATUS_IE1 3 // Previous value of Enable Interrupts |
|
// Cache control register bit indices: |
#define CSR_PP_CACHECTRL_ICACHE_EN 0 |
|
#define potato_enable_interrupts() asm volatile("csrsi mstatus, 1 << %[ie_bit]\n" \ |
:: [ie_bit] "i" (STATUS_IE)) |
#define potato_disable_interrupts() asm volatile("csrci mstatus, 1 << %[ie_bit] | 1 << %[ie1_bit]\n" \ |
/start.S
58,6 → 58,11
|
2: |
|
.hidden enable_caches |
enable_caches: |
csrsi CSR_PP_CACHECTRL, 1 << CSR_PP_CACHECTRL_ICACHE_EN |
fence.i |
|
.hidden call_main |
call_main: |
la sp, __stack_top |