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 58 to Rev 61
- ↔ Reverse comparison
Rev 58 → Rev 61
/sha256/main.c
9,6 → 9,7
#include "potato.h" |
|
#include "gpio.h" |
#include "seg7.h" |
#include "sha256.h" |
#include "timer.h" |
#include "uart.h" |
29,6 → 30,7
uart_puts(IO_ADDRESS(UART_BASE), "Hashes per second: "); |
uart_puth(IO_ADDRESS(UART_BASE), hashes_per_second); |
uart_puts(IO_ADDRESS(UART_BASE), "\n\r"); |
seg7_set_value(IO_ADDRESS(SEG7_BASE), hashes_per_second); |
|
if(led_status == 0) |
{ |
60,6 → 62,10
gpio_set_direction(IO_ADDRESS(GPIO1_BASE), 0x0000); // Switches |
gpio_set_direction(IO_ADDRESS(GPIO2_BASE), 0xffff); // LEDs |
|
// Configure the 7-segment displays: |
seg7_set_enabled_displays(IO_ADDRESS(SEG7_BASE), 0xff); |
seg7_set_value(IO_ADDRESS(SEG7_BASE), 0); |
|
// Set up the timer: |
timer_set(IO_ADDRESS(TIMER_BASE), SYSTEM_CLK_FREQ); |
|
/sha256/seg7.c
0,0 → 1,18
// The Potato Processor Benchmark Applications |
// (c) Kristian Klomsten Skordal 2015 <kristian.skordal@wafflemail.net> |
// Report bugs and issues on <http://opencores.org/project,potato,bugtracker> |
|
#include "seg7.h" |
#include "platform.h" |
|
void seg7_set_enabled_displays(volatile uint32_t * base, uint8_t mask) |
{ |
base[SEG7_ENABLE >> 2] = (uint32_t) mask; |
} |
|
void seg7_set_value(volatile uint32_t * base, uint32_t value) |
{ |
base[SEG7_VALUE >> 2] = value; |
} |
|
|
/sha256/seg7.h
0,0 → 1,16
// The Potato Processor Benchmark Applications |
// (c) Kristian Klomsten Skordal 2015 <kristian.skordal@wafflemail.net> |
// Report bugs and issues on <http://opencores.org/project,potato,bugtracker> |
|
#ifndef SEG7_H |
#define SEG7_H |
|
#include <stdint.h> |
|
// Sets which 7-segment displays are enabled: |
void seg7_set_enabled_displays(volatile uint32_t * base, uint8_t mask); |
// Sets the value to be displayed on the displays: |
void seg7_set_value(volatile uint32_t * base, uint32_t value); |
|
#endif |
|
/sha256/Makefile
12,10 → 12,11
HEXDUMP ?= hexdump |
|
TARGET_CFLAGS += -m32 -march=RV32I -Wall -Os -fomit-frame-pointer \ |
-ffreestanding -fno-builtin -I.. -std=gnu99 |
-ffreestanding -fno-builtin -I.. -std=gnu99 \ |
-Wall -Werror=implicit-function-declaration |
TARGET_LDFLAGS += -m elf32lriscv -T../benchmark.ld |
|
OBJECTS := gpio.o main.o sha256.o start.o timer.o uart.o utilities.o |
OBJECTS := gpio.o main.o seg7.o sha256.o start.o timer.o uart.o utilities.o |
|
all: sha256.coe |
|
42,9 → 43,12
gpio.o: gpio.c gpio.h ../platform.h |
$(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $< |
|
main.o: main.c gpio.h timer.h sha256.h ../platform.h ../potato.h |
main.o: main.c gpio.h timer.h seg7.h sha256.h ../platform.h ../potato.h |
$(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $< |
|
seg7.o: seg7.c seg7.h ../platform.h |
$(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $< |
|
sha256.o: sha256.c sha256.h |
$(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $< |
|
/platform.h
21,6 → 21,7
#define GPIO2_BASE 0x00004800 |
#define UART_BASE 0x00005000 |
#define TIMER_BASE 0x00005800 |
#define SEG7_BASE 0x00006000 |
|
// IRQs: |
#define EXTERNAL_IRQ 0 |
45,5 → 46,9
#define TIMER_CTRL_RUN 0 |
#define TIMER_CTRL_CLEAR 1 |
|
// 7-Segment register offsets: |
#define SEG7_ENABLE 0 |
#define SEG7_VALUE 4 |
|
#endif |
|