URL
https://opencores.org/ocsvn/neorv32/neorv32/trunk
Subversion Repositories neorv32
Compare Revisions
- This comparison shows the changes necessary to convert path
/neorv32/trunk/sw/example
- from Rev 33 to Rev 34
- ↔ Reverse comparison
Rev 33 → Rev 34
/blink_led/makefile
59,6 → 59,9
# User flags for additional configuration (will be added to compiler flags) |
USER_FLAGS ?= |
|
# Serial port for executable upload via bootloer |
COM_PORT ?= /dev/ttyUSB0 |
|
# Relative or absolute path to the NEORV32 home folder |
NEORV32_HOME ?= ../../.. |
# ***************************************************************************** |
253,6 → 256,13
|
|
# ----------------------------------------------------------------------------- |
# Upload executable via serial port to bootloader |
# ----------------------------------------------------------------------------- |
upload: $(APP_EXE) |
@sh $(NEORV32_EXG_PATH)/uart_upload.sh $(COM_PORT) $(APP_EXE) |
|
|
# ----------------------------------------------------------------------------- |
# Show configuration |
# ----------------------------------------------------------------------------- |
info: |
315,6 → 325,7
@echo " clean - clean up project" |
@echo " clean_all - clean up project, core libraries and image generator" |
@echo " bootloader - compile, generate and install VHDL BOOTROM boot image (for bootloader only!)" |
@echo " upload - upload <neorv32_exe.bin> executable via serial port <COM_PORT> to bootloader" |
|
|
# ----------------------------------------------------------------------------- |
/coremark/makefile
59,6 → 59,9
# User flags for additional configuration (will be added to compiler flags) |
USER_FLAGS ?= |
|
# Serial port for executable upload via bootloer |
COM_PORT ?= /dev/ttyUSB0 |
|
# Relative or absolute path to the NEORV32 home folder |
NEORV32_HOME ?= ../../.. |
# ***************************************************************************** |
253,6 → 256,13
|
|
# ----------------------------------------------------------------------------- |
# Upload executable via serial port to bootloader |
# ----------------------------------------------------------------------------- |
upload: $(APP_EXE) |
@sh $(NEORV32_EXG_PATH)/uart_upload.sh $(COM_PORT) $(APP_EXE) |
|
|
# ----------------------------------------------------------------------------- |
# Show configuration |
# ----------------------------------------------------------------------------- |
info: |
315,6 → 325,7
@echo " clean - clean up project" |
@echo " clean_all - clean up project, core libraries and image generator" |
@echo " bootloader - compile, generate and install VHDL BOOTROM boot image (for bootloader only!)" |
@echo " upload - upload <neorv32_exe.bin> executable via serial port <COM_PORT> to bootloader" |
|
|
# ----------------------------------------------------------------------------- |
/cpu_test/main.c
49,10 → 49,6
/**@{*/ |
/** UART BAUD rate */ |
#define BAUD_RATE 19200 |
//** Set 1 for detailed exception debug information */ |
#define DETAILED_EXCEPTION_DEBUG 0 |
//** Set 1 to run memory tests */ |
#define PROBING_MEM_TEST 0 |
//** Set 1 to run external memory test */ |
#define EXT_MEM_TEST 1 |
//** Reachable unaligned address */ |
114,19 → 110,8
neorv32_cpu_set_minstret(0); |
neorv32_cpu_set_mcycle(0); |
|
// check if UART unit is implemented at all |
if (neorv32_uart_available() == 0) { |
return 0; |
} |
|
// check if MTIME unit is implemented at all |
if (neorv32_mtime_available() == 0) { |
return 0; |
} |
|
// init UART at default baud rate, no rx interrupt, no tx interrupt |
neorv32_uart_setup(BAUD_RATE, 0, 0); |
|
|
neorv32_mtime_set_time(0); |
// set CMP of machine system timer MTIME to max to prevent an IRQ |
134,8 → 119,9
neorv32_mtime_set_timecmp(mtime_cmp_max); |
|
// intro |
neorv32_uart_printf("\n\n--- CPU TEST ---\n"); |
neorv32_uart_printf("build: "__DATE__" "__TIME__"\n\n"); |
neorv32_uart_printf("\n\n--- PROCESSOR/CPU TEST ---\n"); |
neorv32_uart_printf("build: "__DATE__" "__TIME__"\n"); |
neorv32_uart_printf("This test suite is intended to verify the default NEORV32 processor setup using the default testbench.\n\n"); |
|
// show project credits |
neorv32_rte_print_credits(); |
146,13 → 132,9
// show full HW config report |
neorv32_rte_print_hw_config(); |
|
// intro2 |
neorv32_uart_printf("\n\nStarting tests...\n\n"); |
|
// configure RTE |
neorv32_rte_setup(); // this will install a full-detailed debug handler for all traps |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
int install_err = 0; |
// here we are overriding the default debug handlers |
install_err += neorv32_rte_exception_install(RTE_TRAP_I_MISALIGNED, global_trap_handler); |
176,12 → 158,11
neorv32_uart_printf("RTE install error (%i)!\n", install_err); |
return 0; |
} |
#endif |
|
// enable interrupt sources |
install_err = neorv32_cpu_irq_enable(CPU_MIE_MSIE); // activate software interrupt |
install_err += neorv32_cpu_irq_enable(CPU_MIE_MTIE); // activate timer interrupt |
install_err += neorv32_cpu_irq_enable(CPU_MIE_MEIE); // activate external interrupt |
install_err = neorv32_cpu_irq_enable(CPU_MIE_MSIE); // activate software interrupt |
install_err += neorv32_cpu_irq_enable(CPU_MIE_MTIE); // activate timer interrupt |
install_err += neorv32_cpu_irq_enable(CPU_MIE_MEIE); // activate external interrupt |
install_err += neorv32_cpu_irq_enable(CPU_MIE_FIRQ0E);// activate fast interrupt channel 0 |
install_err += neorv32_cpu_irq_enable(CPU_MIE_FIRQ1E);// activate fast interrupt channel 1 |
install_err += neorv32_cpu_irq_enable(CPU_MIE_FIRQ2E);// activate fast interrupt channel 2 |
192,7 → 173,10
return 0; |
} |
|
// intro2 |
neorv32_uart_printf("\n\nStarting tests...\n\n"); |
|
|
// enable global interrupts |
neorv32_cpu_eint(); |
|
203,33 → 187,35
// Instruction memory test |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("IMEM TEST: "); |
#if (PROBING_MEM_TEST == 1) |
cnt_test++; |
neorv32_uart_printf("[%i] Processor-internal IMEM test: ", cnt_test); |
|
register uint32_t dmem_probe_addr = SYSINFO_ISPACE_BASE; |
uint32_t dmem_probe_cnt = 0; |
if ((UART_CT & (1 << UART_CT_SIM_MODE)) == 0) { // check if this is a simulation |
cnt_test++; |
|
while(1) { |
asm volatile ("lb zero, 0(%[input_j])" : : [input_j] "r" (dmem_probe_addr)); |
if (exception_handler_answer == TRAP_CODE_L_ACCESS) { |
break; |
register uint32_t dmem_probe_addr = SYSINFO_ISPACE_BASE; |
uint32_t dmem_probe_cnt = 0; |
|
while(1) { |
asm volatile ("lb zero, 0(%[input_j])" : : [input_j] "r" (dmem_probe_addr)); |
if (exception_handler_answer == TRAP_CODE_L_ACCESS) { |
break; |
} |
dmem_probe_addr++; |
dmem_probe_cnt++; |
} |
dmem_probe_addr++; |
dmem_probe_cnt++; |
|
neorv32_uart_printf("%u bytes (should be %u bytes) ", dmem_probe_cnt, SYSINFO_IMEM_SIZE); |
neorv32_uart_printf("@ 0x%x ", SYSINFO_ISPACE_BASE); |
if (dmem_probe_cnt == SYSINFO_IMEM_SIZE) { |
test_ok(); |
} |
else { |
test_fail(); |
} |
} |
|
neorv32_uart_printf("%u bytes (should be %u bytes) ", dmem_probe_cnt, SYSINFO_IMEM_SIZE); |
neorv32_uart_printf("@ 0x%x ", SYSINFO_ISPACE_BASE); |
if (dmem_probe_cnt == SYSINFO_IMEM_SIZE) { |
test_ok(); |
} |
else { |
test_fail(); |
neorv32_uart_printf("skipped (disabled for simulation)\n"); |
} |
#else |
neorv32_uart_printf("skipped (disabled)\n"); |
#endif |
|
|
// ---------------------------------------------------------- |
236,40 → 222,178
// Data memory test |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("DMEM TEST: "); |
#if (PROBING_MEM_TEST == 1) |
cnt_test++; |
neorv32_uart_printf("[%i] Processor-internal DMEM test: ", cnt_test); |
|
register uint32_t imem_probe_addr =SYSINFO_DSPACE_BASE; |
uint32_t imem_probe_cnt = 0; |
if ((UART_CT & (1 << UART_CT_SIM_MODE)) == 0) { // check if this is a simulation |
cnt_test++; |
|
while(1) { |
asm volatile ("lb zero, 0(%[input_j])" : : [input_j] "r" (imem_probe_addr)); |
if (exception_handler_answer == TRAP_CODE_L_ACCESS) { |
break; |
register uint32_t imem_probe_addr = SYSINFO_DSPACE_BASE; |
uint32_t imem_probe_cnt = 0; |
|
while(1) { |
asm volatile ("lb zero, 0(%[input_j])" : : [input_j] "r" (imem_probe_addr)); |
if (exception_handler_answer == TRAP_CODE_L_ACCESS) { |
break; |
} |
imem_probe_addr++; |
imem_probe_cnt++; |
} |
imem_probe_addr++; |
imem_probe_cnt++; |
|
neorv32_uart_printf("%u bytes (should be %u bytes) ", imem_probe_cnt, SYSINFO_DMEM_SIZE); |
neorv32_uart_printf("@ 0x%x ", SYSINFO_DSPACE_BASE); |
if (imem_probe_cnt == SYSINFO_DMEM_SIZE) { |
test_ok(); |
} |
else { |
test_fail(); |
} |
} |
|
neorv32_uart_printf("%u bytes (should be %u bytes) ", imem_probe_cnt, SYSINFO_DMEM_SIZE); |
neorv32_uart_printf("@ 0x%x ", SYSINFO_DSPACE_BASE); |
if (imem_probe_cnt == SYSINFO_DMEM_SIZE) { |
test_ok(); |
else { |
neorv32_uart_printf("skipped (disabled for simulation)\n"); |
} |
|
|
// ---------------------------------------------------------- |
// List all accessible CSRs |
// ---------------------------------------------------------- |
neorv32_uart_printf("[%i] List all accessible CSRs: ", cnt_test); |
|
if ((UART_CT & (1 << UART_CT_SIM_MODE)) == 0) { // check if this is a simulation |
|
cnt_test++; |
i = 0; |
|
neorv32_uart_printf("\n"); |
|
uint32_t csr_addr_cnt = 0; |
|
// create test program in RAM |
static const uint32_t csr_access_test_program[2] __attribute__((aligned(8))) = { |
0x00006073, // csrrsi, 0x000, 0 |
0x00008067 // ret (32-bit) |
}; |
|
// base address of program |
tmp_a = (uint32_t)&csr_access_test_program; |
uint32_t *csr_pnt = (uint32_t*)tmp_a; |
|
// iterate through full 12-bit CSR address space |
for (csr_addr_cnt=0x000; csr_addr_cnt<=0xfff; csr_addr_cnt++) { |
exception_handler_answer = 0xFFFFFFFF; |
|
// construct and store new CSR access instruction |
// 0x00006073 = csrrsi, 0x000, 0 |
*csr_pnt = 0x00006073 | (csr_addr_cnt << 20); // insert current CSR address into most significant 12 bits |
|
// sync instruction stream |
asm volatile("fence.i"); |
|
// execute test program |
asm volatile ("jalr ra, %[input_i]" : : [input_i] "r" (tmp_a)); |
|
// check for access exception |
if (exception_handler_answer == 0xFFFFFFFF) { // no exception -> access ok -> CSR exists |
neorv32_uart_printf(" + 0x%x\n", csr_addr_cnt); |
i++; |
} |
} |
if (i != 0) { // at least one CSR was accessible |
test_ok(); |
} |
else { |
test_fail(); |
} |
} |
else { |
test_fail(); |
neorv32_uart_printf("skipped (disabled for simulation)\n"); |
} |
#else |
neorv32_uart_printf("skipped (disabled)\n"); |
#endif |
|
|
// ---------------------------------------------------------- |
// CFU0 test (default HW) |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("[%i] Default CFU0 access test: ", cnt_test); |
|
// cfu0 implemented? |
if (neorv32_cfu0_available()) { |
cnt_test++; |
|
// write test data |
CFU0_REG_0 = 0x01234567; |
CFU0_REG_1 = 0x76543210; |
CFU0_REG_2 = 0xABCDABCD; |
CFU0_REG_3 = 0xFFAAFFAA; |
|
if ((CFU0_REG_0 == 0x01234567) && (CFU0_REG_1 == 0x76543210) && |
(CFU0_REG_2 == 0xABCDABCD) && (CFU0_REG_3 == 0xFFAAFFAA) && // correct read-back |
(exception_handler_answer == 0xFFFFFFFF)) { // no exception |
test_ok(); |
} |
else { |
test_fail(); |
} |
} |
else { |
neorv32_uart_printf("skipped (not implemented)\n"); |
} |
|
|
// ---------------------------------------------------------- |
// CFU1 test (default HW) |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("[%i] Default CFU1 access test: ", cnt_test); |
|
// cfu0 implemented? |
if (neorv32_cfu1_available()) { |
cnt_test++; |
|
// write test data |
CFU1_REG_0 = 0x22334455; |
CFU1_REG_1 = 0x44782931; |
CFU1_REG_2 = 0xDDAABBFF; |
CFU1_REG_3 = 0xA0B0D0C0; |
|
if ((CFU1_REG_0 == 0x22334455) && (CFU1_REG_1 == 0x44782931) && |
(CFU1_REG_2 == 0xDDAABBFF) && (CFU1_REG_3 == 0xA0B0D0C0) && // correct read-back |
(exception_handler_answer == 0xFFFFFFFF)) { // no exception |
test_ok(); |
} |
else { |
test_fail(); |
} |
} |
else { |
neorv32_uart_printf("skipped (not implemented)\n"); |
} |
|
|
// ---------------------------------------------------------- |
// Bus timeout latency estimation |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("[%i] Estimate bus time-out latency: ", cnt_test); |
|
// start timing |
tmp_a = neorv32_cpu_csr_read(CSR_CYCLE); |
|
// this will timeout |
MMR_UNREACHABLE = 0; |
|
// wait for timeout |
while (exception_handler_answer == 0xFFFFFFFF); |
|
tmp_a = neorv32_cpu_csr_read(CSR_CYCLE) - tmp_a; |
tmp_a = tmp_a / 4; // divide by average CPI |
neorv32_uart_printf("~%u cycles\n", tmp_a); |
|
|
// ---------------------------------------------------------- |
// External memory interface test |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXT_MEM TEST: "); |
neorv32_uart_printf("[%i] External memory access test: ", cnt_test); |
#if (EXT_MEM_TEST == 1) |
cnt_test++; |
|
289,7 → 413,6
tmp_a = (uint32_t)EXT_MEM_BASE; // call the dummy sub program |
asm volatile ("jalr ra, %[input_i]" : : [input_i] "r" (tmp_a)); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == 0xFFFFFFFF) { // make sure there was no exception |
if (neorv32_cpu_csr_read(CSR_MSCRATCH) == 15) { // make sure the program was executed in the right way |
test_ok(); |
301,7 → 424,6
else { |
test_fail(); |
} |
#endif |
} |
#else |
neorv32_uart_printf("skipped (disabled)\n"); |
311,7 → 433,7
// ---------------------------------------------------------- |
// Test time (must be == MTIME.TIME) |
// ---------------------------------------------------------- |
neorv32_uart_printf("TIME: "); |
neorv32_uart_printf("[%i] Time (MTIME.time vs CSR.time) sync: ", cnt_test); |
cnt_test++; |
|
cpu_systime.uint64 = neorv32_cpu_get_systime(); |
332,7 → 454,7
// Test fence instructions - make sure CPU does not crash here and throws no exception |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("FENCE: "); |
neorv32_uart_printf("[%i] FENCE instruction test: ", cnt_test); |
cnt_test++; |
asm volatile ("fence"); |
|
349,7 → 471,7
// a more complex test is provided by the RISC-V compliance test |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("FENCE.I: "); |
neorv32_uart_printf("[%i] FENCE.I instruction test: ", cnt_test); |
asm volatile ("fence.i"); |
|
if (exception_handler_answer == TRAP_CODE_I_ILLEGAL) { |
372,13 → 494,12
// Illegal CSR access (CSR not implemented) |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("ILLEGAL CSR: "); |
neorv32_uart_printf("[%i] Illegal CSR (0xfff) access test: ", cnt_test); |
|
cnt_test++; |
|
neorv32_cpu_csr_read(0xfff); // CSR 0xfff not implemented |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_I_ILLEGAL) { |
test_ok(); |
} |
385,7 → 506,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
392,13 → 512,12
// Write-access to read-only CSR |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("Rd-only CSR: "); |
neorv32_uart_printf("[%i] Read-only CSR (time) write access test: ", cnt_test); |
|
cnt_test++; |
|
neorv32_cpu_csr_write(CSR_TIME, 0); // time CSR is read-only |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_I_ILLEGAL) { |
test_ok(); |
} |
405,7 → 524,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
412,7 → 530,7
// No "real" CSR write access (because rs1 = r0) |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("NotWrite CSR: "); |
neorv32_uart_printf("[%i] Read-only CSR (time) no-write (rs1=0) access test: ", cnt_test); |
|
cnt_test++; |
|
420,7 → 538,6
// -> should cause no exception |
asm volatile("csrrs zero, time, zero"); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == 0xFFFFFFFF) { |
test_ok(); |
} |
427,7 → 544,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
434,7 → 550,7
// Unaligned instruction address |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXC I_ALIGN: "); |
neorv32_uart_printf("[%i] I_ALIGN (instruction alignment) exception test: ", cnt_test); |
|
// skip if C-mode is implemented |
if ((neorv32_cpu_csr_read(CSR_MISA) & (1<<CPU_MISA_C_EXT)) == 0) { |
444,7 → 560,6
// call unaligned address |
((void (*)(void))ADDR_UNALIGNED)(); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_I_MISALIGNED) { |
neorv32_uart_printf("ok\n"); |
cnt_ok++; |
453,7 → 568,6
neorv32_uart_printf("fail\n"); |
cnt_fail++; |
} |
#endif |
} |
else { |
neorv32_uart_printf("skipped (not possible when C extension is enabled)\n"); |
464,13 → 578,12
// Instruction access fault |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXC I_ACC: "); |
neorv32_uart_printf("[%i] I_ACC (instruction bus access) exception test: ", cnt_test); |
cnt_test++; |
|
// call unreachable aligned address |
((void (*)(void))ADDR_UNREACHABLE)(); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_I_ACCESS) { |
test_ok(); |
} |
477,7 → 590,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
484,13 → 596,12
// Illegal instruction |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXC I_ILLEG: "); |
neorv32_uart_printf("[%i] I_ILLEG (illegal instruction) exception test: ", cnt_test); |
|
cnt_test++; |
|
asm volatile ("csrrw zero, 0xfff, zero"); // = 0xfff01073 : CSR 0xfff not implemented -> illegal instruction |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
// make sure this has cause an illegal exception |
if (exception_handler_answer == TRAP_CODE_I_ILLEGAL) { |
// make sure this is really the instruction that caused the exception |
505,7 → 616,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
512,7 → 622,7
// Illegal compressed instruction |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXC CI_ILLEG: "); |
neorv32_uart_printf("[%i] CI_ILLEG (illegal compressed instruction) exception test: ", cnt_test); |
|
// skip if C-mode is not implemented |
if ((neorv32_cpu_csr_read(CSR_MISA) & (1<<CPU_MISA_C_EXT)) != 0) { |
528,7 → 638,6
tmp_a = (uint32_t)&dummy_sub_program_ci; // call the dummy sub program |
asm volatile ("jalr ra, %[input_i]" : : [input_i] "r" (tmp_a)); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_I_ILLEGAL) { |
test_ok(); |
} |
535,7 → 644,6
else { |
test_fail(); |
} |
#endif |
} |
else { |
neorv32_uart_printf("skipped (not possible when C-EXT disabled)\n"); |
546,12 → 654,11
// Breakpoint instruction |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXC BREAK: "); |
neorv32_uart_printf("[%i] BREAK (break instruction) exception test: ", cnt_test); |
cnt_test++; |
|
asm volatile("EBREAK"); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_BREAKPOINT) { |
test_ok(); |
} |
558,7 → 665,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
565,13 → 671,12
// Unaligned load address |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXC L_ALIGN: "); |
neorv32_uart_printf("[%i] L_ALIGN (load address alignment) exception test: ", cnt_test); |
cnt_test++; |
|
// load from unaligned address |
asm volatile ("lw zero, %[input_i](zero)" : : [input_i] "i" (ADDR_UNALIGNED)); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_L_MISALIGNED) { |
test_ok(); |
} |
578,7 → 683,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
585,13 → 689,12
// Load access fault |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXC L_ACC: "); |
neorv32_uart_printf("[%i] L_ACC (load bus access) exception test: ", cnt_test); |
cnt_test++; |
|
// load from unreachable aligned address |
dummy_dst = MMR_UNREACHABLE; |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_L_ACCESS) { |
test_ok(); |
} |
598,7 → 701,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
605,13 → 707,12
// Unaligned store address |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXC S_ALIGN: "); |
neorv32_uart_printf("[%i] S_ALIGN (store address alignment) exception test: ", cnt_test); |
cnt_test++; |
|
// store to unaligned address |
asm volatile ("sw zero, %[input_i](zero)" : : [input_i] "i" (ADDR_UNALIGNED)); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_S_MISALIGNED) { |
test_ok(); |
} |
618,7 → 719,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
625,13 → 725,12
// Store access fault |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXC S_ACC: "); |
neorv32_uart_printf("[%i] S_ACC (store bus access) exception test: ", cnt_test); |
cnt_test++; |
|
// store to unreachable aligned address |
MMR_UNREACHABLE = 0; |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_S_ACCESS) { |
test_ok(); |
} |
638,7 → 737,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
645,12 → 743,11
// Environment call |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("EXC ENVCALL: "); |
neorv32_uart_printf("[%i] ENVCALL (ecall instruction) exception test: ", cnt_test); |
cnt_test++; |
|
asm volatile("ECALL"); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_MENV_CALL) { |
test_ok(); |
} |
657,7 → 754,6
else { |
test_fail(); |
} |
#endif |
|
|
// ---------------------------------------------------------- |
664,7 → 760,7
// Machine timer interrupt (MTIME) |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("IRQ MTI: "); |
neorv32_uart_printf("[%i] MTI (machine timer) interrupt test: ", cnt_test); |
|
if (neorv32_mtime_available()) { |
cnt_test++; |
677,8 → 773,9
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_MTI) { |
test_ok(); |
} |
685,7 → 782,6
else { |
test_fail(); |
} |
#endif |
|
// no more mtime interrupts |
neorv32_mtime_set_timecmp(-1); |
699,7 → 795,7
// Fast interrupt channel 0 (WDT) |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("FIRQ0 (WDT): "); |
neorv32_uart_printf("[%i] FIRQ0 (fast IRQ0) interrupt test (via WDT): ", cnt_test); |
|
if (neorv32_wdt_available()) { |
cnt_test++; |
714,8 → 810,9
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_FIRQ_0) { |
test_ok(); |
} |
722,7 → 819,7
else { |
test_fail(); |
} |
#endif |
|
// no more WDT interrupts |
neorv32_wdt_disable(); |
} |
735,18 → 832,53
// Fast interrupt channel 1 (GPIO) |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("FIRQ1 (GPIO): "); |
neorv32_uart_printf("[%i] FIRQ1 (fast IRQ1) interrupt test (via GPIO): ", cnt_test); |
|
// no test available yet |
if (neorv32_gpio_available()) { |
cnt_test++; |
|
neorv32_uart_printf("skipped (no test available)\n"); |
// clear output port |
neorv32_gpio_port_set(0); |
|
// configure GPIO.in(31) for pin-change IRQ |
neorv32_gpio_pin_change_config(0x80000000); |
|
// trigger pin-change IRQ by setting GPIO.out(31) |
// the testbench connects GPIO.out => GPIO.in |
neorv32_gpio_pin_set(31); |
|
// wait some time for the IRQ to arrive the CPU |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
|
if (exception_handler_answer == TRAP_CODE_FIRQ_1) { |
test_ok(); |
} |
else { |
test_fail(); |
} |
|
// disable GPIO pin-change IRQ |
neorv32_gpio_pin_change_config(0); |
|
// clear output port |
neorv32_gpio_port_set(0); |
} |
else { |
neorv32_uart_printf("skipped (GPIO not implemented)\n"); |
} |
|
|
|
// ---------------------------------------------------------- |
// Fast interrupt channel 2 (UART) |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("FIRQ2 (UART): "); |
neorv32_uart_printf("[%i] FIRQ2 (fast IRQ2) interrupt test (via UART): ", cnt_test); |
|
if (neorv32_uart_available()) { |
cnt_test++; |
774,6 → 906,8
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
|
// wait for UART to finish transmitting |
while(neorv32_uart_tx_busy()); |
781,7 → 915,6
// re-enable UART sim_mode if it was enabled and disable UART TX done IRQ |
UART_CT = uart_ct_backup; |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_FIRQ_2) { |
test_ok(); |
} |
788,7 → 921,7
else { |
test_fail(); |
} |
#endif |
|
} |
else { |
neorv32_uart_printf("skipped (UART not implemented)\n"); |
799,7 → 932,7
// Fast interrupt channel 3 (SPI) |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("FIRQ3 (SPI): "); |
neorv32_uart_printf("[%i] FIRQ3 (fast IRQ3) interrupt test (via SPI): ", cnt_test); |
|
if (neorv32_spi_available()) { |
cnt_test++; |
816,8 → 949,9
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_FIRQ_3) { |
test_ok(); |
} |
824,7 → 958,7
else { |
test_fail(); |
} |
#endif |
|
// disable SPI |
neorv32_spi_disable(); |
} |
837,7 → 971,7
// Fast interrupt channel 3 (TWI) |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("FIRQ3 (TWI): "); |
neorv32_uart_printf("[%i] FIRQ3 (fast IRQ3) interrupt test (via TWI): ", cnt_test); |
|
if (neorv32_twi_available()) { |
cnt_test++; |
854,8 → 988,9
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
asm volatile("nop"); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_FIRQ_3) { |
test_ok(); |
} |
862,7 → 997,7
else { |
test_fail(); |
} |
#endif |
|
// disable TWI |
neorv32_twi_disable(); |
} |
875,18 → 1010,17
// Test WFI ("sleep") instructions, wakeup via MTIME |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("WFI (MTIME): "); |
neorv32_uart_printf("[%i] WFI (wait for interrupt / sleep instruction) test (wake-up via MTIME): ", cnt_test); |
|
if (neorv32_mtime_available()) { |
cnt_test++; |
|
// program timer to wake up |
// program wake-up timer |
neorv32_mtime_set_timecmp(neorv32_mtime_get_time() + 1000); |
|
// put CPU into sleep mode |
asm volatile ("wfi"); |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer != TRAP_CODE_MTI) { |
test_fail(); |
} |
893,7 → 1027,7
else { |
test_ok(); |
} |
#endif |
|
// no more mtime interrupts |
neorv32_mtime_set_timecmp(-1); |
} |
906,7 → 1040,7
// Test invalid CSR access in user mode |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("USR INV_CSR: "); |
neorv32_uart_printf("[%i] Invalid CSR access (mstatus) from user mode test: ", cnt_test); |
|
// skip if U-mode is not implemented |
if (neorv32_cpu_csr_read(CSR_MISA) & (1<<CPU_MISA_U_EXT)) { |
920,7 → 1054,6
neorv32_cpu_csr_read(CSR_MSTATUS); |
} |
|
#if (DETAILED_EXCEPTION_DEBUG==0) |
if (exception_handler_answer == TRAP_CODE_I_ILLEGAL) { |
test_ok(); |
} |
927,7 → 1060,7
else { |
test_fail(); |
} |
#endif |
|
} |
else { |
neorv32_uart_printf("skipped (not possible when U-EXT disabled)\n"); |
938,7 → 1071,7
// Test RTE debug handler |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("RTE DB TEST: "); |
neorv32_uart_printf("[%i] RTE (runtime environment) debug trap handler test: ", cnt_test); |
|
cnt_test++; |
|
965,96 → 1098,29
// Test physical memory protection |
// ---------------------------------------------------------- |
exception_handler_answer = 0xFFFFFFFF; |
neorv32_uart_printf("\nPhysical memory protection: "); |
neorv32_uart_printf("[%i] Physical memory protection (PMP): ", cnt_test); |
|
// check if PMP is implemented |
neorv32_cpu_csr_read(0x3a0); |
if (exception_handler_answer == TRAP_CODE_I_ILLEGAL) { |
neorv32_uart_printf("test skipped (PMP not implemented)\n"); |
} |
else { |
neorv32_uart_printf("implemented\n"); |
if (neorv32_cpu_csr_read(CSR_MZEXT) & (1<<CPU_MZEXT_PMP)) { |
|
// find out number of regions |
for (i=0; i<16; i++) { |
exception_handler_answer = 0xFFFFFFFF; |
switch (i) { // try to access pmpaddr regs |
case 0: neorv32_cpu_csr_read(CSR_PMPADDR0); break; |
case 1: neorv32_cpu_csr_read(CSR_PMPADDR1); break; |
case 2: neorv32_cpu_csr_read(CSR_PMPADDR2); break; |
case 3: neorv32_cpu_csr_read(CSR_PMPADDR3); break; |
case 4: neorv32_cpu_csr_read(CSR_PMPADDR4); break; |
case 5: neorv32_cpu_csr_read(CSR_PMPADDR5); break; |
case 6: neorv32_cpu_csr_read(CSR_PMPADDR6); break; |
case 7: neorv32_cpu_csr_read(CSR_PMPADDR7); break; |
default: break; |
} |
if (exception_handler_answer == TRAP_CODE_I_ILLEGAL) { |
break; |
} |
} |
neorv32_uart_printf("Max regions: %u\n", i); |
// Test access to protected region |
// --------------------------------------------- |
neorv32_uart_printf("Creating protected page (NAPOT, 64kB) @ 0xFFFFA000, [!x, !w, r]... "); |
cnt_test++; |
|
neorv32_cpu_csr_write(CSR_PMPADDR0, 0xffffdfff); // 64k area @ 0xFFFFA000 |
neorv32_cpu_csr_write(CSR_PMPCFG0, 0b00011001); // NAPOT, read permission, NO write and NO execute permissions |
|
// check granulartiy |
neorv32_cpu_csr_write(CSR_PMPCFG0, 0); |
neorv32_cpu_csr_write(CSR_PMPADDR0, 0xffffffff); |
uint32_t pmp_test_g = neorv32_cpu_csr_read(0x3b0); |
|
// find least-significat set bit |
for (i=31; i!=0; i--) { |
if (((pmp_test_g >> i) & 1) == 0) { |
break; |
} |
if ((neorv32_cpu_csr_read(CSR_PMPADDR0) == 0xffffdfff) && (neorv32_cpu_csr_read(CSR_PMPCFG0) == 0b00011001)) { |
test_ok(); |
} |
|
neorv32_uart_printf("Min granularity: "); |
if (i < 29) { |
neorv32_uart_printf("%u bytes per region (0x%x)\n", (uint32_t)(1 << (i+1+2)), pmp_test_g); |
} |
else { |
neorv32_uart_printf("2^%u bytes per region\n", i+1+2); |
test_fail(); |
} |
|
|
// test available modes |
neorv32_uart_printf("Mode TOR: "); |
neorv32_cpu_csr_write(CSR_PMPCFG0, 0x08); |
if ((neorv32_cpu_csr_read(CSR_PMPCFG0) & 0xFF) == 0x08) { |
neorv32_uart_printf("available\n"); |
} |
else { |
neorv32_uart_printf("not implemented\n"); |
} |
|
neorv32_uart_printf("Mode NA4: "); |
neorv32_cpu_csr_write(CSR_PMPCFG0, 0x10); |
if ((neorv32_cpu_csr_read(CSR_PMPCFG0) & 0xFF) == 0x10) { |
neorv32_uart_printf("available\n"); |
} |
else { |
neorv32_uart_printf("not implemented\n"); |
} |
|
neorv32_uart_printf("Mode NAPOT: "); |
neorv32_cpu_csr_write(CSR_PMPCFG0, 0x18); |
if ((neorv32_cpu_csr_read(CSR_PMPCFG0) & 0xFF) == 0x18) { |
neorv32_uart_printf("available\n"); |
} |
else { |
neorv32_uart_printf("not implemented\n"); |
} |
|
|
// Test access to protected region |
// --------------------------------------------- |
neorv32_uart_printf("Creating protected page (NAPOT, 64kB) @ 0xFFFFA000, [!x, !w, r]...\n"); |
neorv32_cpu_csr_write(CSR_PMPADDR0, 0xffffdfff); // 64k area @ 0xFFFFA000 |
neorv32_cpu_csr_write(CSR_PMPCFG0, 0b00011001); // NAPOT, read permission, NO write and NO execute permissions |
|
|
// ------ LOAD: should work ------ |
neorv32_uart_printf("U-mode [!X,!W,R] load test: "); |
neorv32_uart_printf("[%i] PMP: U-mode [!X,!W,R] load test: ", cnt_test); |
cnt_test++; |
exception_handler_answer = 0xFFFFFFFF; |
|
1063,7 → 1129,7
{ |
asm volatile ("lw zero, 0xFFFFFF90(zero)"); // MTIME load access, should work |
} |
#if (DETAILED_EXCEPTION_DEBUG==0) |
|
if (exception_handler_answer == 0xFFFFFFFF) { |
// switch back to machine mode (if not allready) |
asm volatile ("ecall"); |
1076,11 → 1142,10
|
test_fail(); |
} |
#endif |
|
|
// ------ STORE: should fail ------ |
neorv32_uart_printf("U-mode [!X,!W,R] store test: "); |
neorv32_uart_printf("[%i] PMP: U-mode [!X,!W,R] store test: ", cnt_test); |
cnt_test++; |
exception_handler_answer = 0xFFFFFFFF; |
|
1089,7 → 1154,7
{ |
asm volatile ("sw zero, 0xFFFFFF90(zero)"); // MTIME store access, should fail |
} |
#if (DETAILED_EXCEPTION_DEBUG==0) |
|
if (exception_handler_answer == TRAP_CODE_S_ACCESS) { |
// switch back to machine mode (if not allready) |
asm volatile ("ecall"); |
1102,11 → 1167,10
|
test_fail(); |
} |
#endif |
|
|
// ------ Lock test ------ |
neorv32_uart_printf("Locking pmpcfg0 [mode=off]: "); |
neorv32_uart_printf("[%i] PMP: Locking pmpcfg0 [mode=off]: ", cnt_test); |
cnt_test++; |
exception_handler_answer = 0xFFFFFFFF; |
|
1124,30 → 1188,25
} |
|
} |
else { |
neorv32_uart_printf("not implemented\n"); |
} |
|
|
// ---------------------------------------------------------- |
// Final test reports |
// ---------------------------------------------------------- |
union { |
uint64_t uint64; |
uint32_t uint32[sizeof(uint64_t)/2]; |
} exe_instr, exe_cycles; |
neorv32_uart_printf("\n\nExecuted instructions: %u\n", (uint32_t)neorv32_cpu_csr_read(CSR_INSTRET)); |
neorv32_uart_printf( "Required clock cycles: %u\n", (uint32_t)neorv32_cpu_csr_read(CSR_CYCLE)); |
|
exe_cycles.uint64 = neorv32_cpu_get_cycle(); |
exe_instr.uint64 = neorv32_cpu_get_instret(); |
neorv32_uart_printf("\nTest results:\nOK: %i/%i\nFAILED: %i/%i\n\n", cnt_ok, cnt_test, cnt_fail, cnt_test); |
|
neorv32_uart_printf("\n\nExecuted instructions: %u\n", exe_instr.uint32[0]); |
neorv32_uart_printf( "Required clock cycles: %u\n", exe_cycles.uint32[0]); |
|
neorv32_uart_printf("\nTests: %i\nOK: %i\nFAIL: %i\n\n", cnt_test, cnt_ok, cnt_fail); |
|
// final result |
if (cnt_fail == 0) { |
neorv32_uart_printf("TEST OK!\n"); |
neorv32_uart_printf("%c[1mTEST OK!%c[0m\n", 27, 27); |
} |
else { |
neorv32_uart_printf("TEST FAILED!\n"); |
neorv32_uart_printf("%c[1mTEST FAILED!%c[0m\n", 27, 27); |
} |
|
return 0; |
1168,21 → 1227,20
|
|
/**********************************************************************//** |
* Test results helper function: Shows "ok" and increments global cnt_ok |
* Test results helper function: Shows "[ok]" and increments global cnt_ok |
**************************************************************************/ |
void test_ok(void) { |
|
neorv32_uart_printf("ok\n"); |
neorv32_uart_printf("%c[1m[ok]%c[0m\n", 27, 27); |
cnt_ok++; |
} |
|
|
/**********************************************************************//** |
* Test results helper function: Shows "fail" and increments global cnt_fail |
* Test results helper function: Shows "[FAILED]" and increments global cnt_fail |
**************************************************************************/ |
void test_fail(void) { |
|
neorv32_uart_printf("fail\n"); |
neorv32_uart_printf("%c[1m[FAILED]%c[0m\n", 27, 27); |
cnt_fail++; |
} |
|
/cpu_test/makefile
59,6 → 59,9
# User flags for additional configuration (will be added to compiler flags) |
USER_FLAGS ?= |
|
# Serial port for executable upload via bootloer |
COM_PORT ?= /dev/ttyUSB0 |
|
# Relative or absolute path to the NEORV32 home folder |
NEORV32_HOME ?= ../../.. |
# ***************************************************************************** |
253,6 → 256,13
|
|
# ----------------------------------------------------------------------------- |
# Upload executable via serial port to bootloader |
# ----------------------------------------------------------------------------- |
upload: $(APP_EXE) |
@sh $(NEORV32_EXG_PATH)/uart_upload.sh $(COM_PORT) $(APP_EXE) |
|
|
# ----------------------------------------------------------------------------- |
# Show configuration |
# ----------------------------------------------------------------------------- |
info: |
315,6 → 325,7
@echo " clean - clean up project" |
@echo " clean_all - clean up project, core libraries and image generator" |
@echo " bootloader - compile, generate and install VHDL BOOTROM boot image (for bootloader only!)" |
@echo " upload - upload <neorv32_exe.bin> executable via serial port <COM_PORT> to bootloader" |
|
|
# ----------------------------------------------------------------------------- |
/demo_freeRTOS/makefile
59,6 → 59,9
# User flags for additional configuration (will be added to compiler flags) |
USER_FLAGS ?= |
|
# Serial port for executable upload via bootloer |
COM_PORT ?= /dev/ttyUSB0 |
|
# Relative or absolute path to the NEORV32 home folder |
NEORV32_HOME ?= ../../.. |
# ***************************************************************************** |
285,6 → 288,13
|
|
# ----------------------------------------------------------------------------- |
# Upload executable via serial port to bootloader |
# ----------------------------------------------------------------------------- |
upload: $(APP_EXE) |
@sh $(NEORV32_EXG_PATH)/uart_upload.sh $(COM_PORT) $(APP_EXE) |
|
|
# ----------------------------------------------------------------------------- |
# Show configuration |
# ----------------------------------------------------------------------------- |
info: |
347,6 → 357,7
@echo " clean - clean up project" |
@echo " clean_all - clean up project, core libraries and image generator" |
@echo " bootloader - compile, generate and install VHDL BOOTROM boot image (for bootloader only!)" |
@echo " upload - upload <neorv32_exe.bin> executable via serial port <COM_PORT> to bootloader" |
|
|
# ----------------------------------------------------------------------------- |
/demo_pwm/main.c
49,7 → 49,7
/** UART BAUD rate */ |
#define BAUD_RATE 19200 |
/** Maximum PWM output intensity (0..255) */ |
#define PWM_MAX 200 |
#define PWM_MAX 128 |
/**@}*/ |
|
|
56,7 → 56,7
/**********************************************************************//** |
* This program generates a simple dimming sequence for PWM channel 0,1,2. |
* |
* @note This program requires the PWM to be synthesized (the UART is optional). |
* @note This program requires the PWM controller to be synthesized (the UART is optional). |
* |
* @return Irrelevant. |
**************************************************************************/ |
121,7 → 121,7
neorv32_pwm_set(ch, pwm); |
} |
|
neorv32_cpu_delay_ms(5); // wait ~5ms |
neorv32_cpu_delay_ms(10); // wait ~10ms |
} |
|
return 0; |
/demo_pwm/makefile
59,6 → 59,9
# User flags for additional configuration (will be added to compiler flags) |
USER_FLAGS ?= |
|
# Serial port for executable upload via bootloer |
COM_PORT ?= /dev/ttyUSB0 |
|
# Relative or absolute path to the NEORV32 home folder |
NEORV32_HOME ?= ../../.. |
# ***************************************************************************** |
253,6 → 256,13
|
|
# ----------------------------------------------------------------------------- |
# Upload executable via serial port to bootloader |
# ----------------------------------------------------------------------------- |
upload: $(APP_EXE) |
@sh $(NEORV32_EXG_PATH)/uart_upload.sh $(COM_PORT) $(APP_EXE) |
|
|
# ----------------------------------------------------------------------------- |
# Show configuration |
# ----------------------------------------------------------------------------- |
info: |
315,6 → 325,7
@echo " clean - clean up project" |
@echo " clean_all - clean up project, core libraries and image generator" |
@echo " bootloader - compile, generate and install VHDL BOOTROM boot image (for bootloader only!)" |
@echo " upload - upload <neorv32_exe.bin> executable via serial port <COM_PORT> to bootloader" |
|
|
# ----------------------------------------------------------------------------- |
/demo_trng/makefile
59,6 → 59,9
# User flags for additional configuration (will be added to compiler flags) |
USER_FLAGS ?= |
|
# Serial port for executable upload via bootloer |
COM_PORT ?= /dev/ttyUSB0 |
|
# Relative or absolute path to the NEORV32 home folder |
NEORV32_HOME ?= ../../.. |
# ***************************************************************************** |
253,6 → 256,13
|
|
# ----------------------------------------------------------------------------- |
# Upload executable via serial port to bootloader |
# ----------------------------------------------------------------------------- |
upload: $(APP_EXE) |
@sh $(NEORV32_EXG_PATH)/uart_upload.sh $(COM_PORT) $(APP_EXE) |
|
|
# ----------------------------------------------------------------------------- |
# Show configuration |
# ----------------------------------------------------------------------------- |
info: |
315,6 → 325,7
@echo " clean - clean up project" |
@echo " clean_all - clean up project, core libraries and image generator" |
@echo " bootloader - compile, generate and install VHDL BOOTROM boot image (for bootloader only!)" |
@echo " upload - upload <neorv32_exe.bin> executable via serial port <COM_PORT> to bootloader" |
|
|
# ----------------------------------------------------------------------------- |
/demo_twi/makefile
59,6 → 59,9
# User flags for additional configuration (will be added to compiler flags) |
USER_FLAGS ?= |
|
# Serial port for executable upload via bootloer |
COM_PORT ?= /dev/ttyUSB0 |
|
# Relative or absolute path to the NEORV32 home folder |
NEORV32_HOME ?= ../../.. |
# ***************************************************************************** |
253,6 → 256,13
|
|
# ----------------------------------------------------------------------------- |
# Upload executable via serial port to bootloader |
# ----------------------------------------------------------------------------- |
upload: $(APP_EXE) |
@sh $(NEORV32_EXG_PATH)/uart_upload.sh $(COM_PORT) $(APP_EXE) |
|
|
# ----------------------------------------------------------------------------- |
# Show configuration |
# ----------------------------------------------------------------------------- |
info: |
315,6 → 325,7
@echo " clean - clean up project" |
@echo " clean_all - clean up project, core libraries and image generator" |
@echo " bootloader - compile, generate and install VHDL BOOTROM boot image (for bootloader only!)" |
@echo " upload - upload <neorv32_exe.bin> executable via serial port <COM_PORT> to bootloader" |
|
|
# ----------------------------------------------------------------------------- |
/demo_wdt/makefile
59,6 → 59,9
# User flags for additional configuration (will be added to compiler flags) |
USER_FLAGS ?= |
|
# Serial port for executable upload via bootloer |
COM_PORT ?= /dev/ttyUSB0 |
|
# Relative or absolute path to the NEORV32 home folder |
NEORV32_HOME ?= ../../.. |
# ***************************************************************************** |
253,6 → 256,13
|
|
# ----------------------------------------------------------------------------- |
# Upload executable via serial port to bootloader |
# ----------------------------------------------------------------------------- |
upload: $(APP_EXE) |
@sh $(NEORV32_EXG_PATH)/uart_upload.sh $(COM_PORT) $(APP_EXE) |
|
|
# ----------------------------------------------------------------------------- |
# Show configuration |
# ----------------------------------------------------------------------------- |
info: |
315,6 → 325,7
@echo " clean - clean up project" |
@echo " clean_all - clean up project, core libraries and image generator" |
@echo " bootloader - compile, generate and install VHDL BOOTROM boot image (for bootloader only!)" |
@echo " upload - upload <neorv32_exe.bin> executable via serial port <COM_PORT> to bootloader" |
|
|
# ----------------------------------------------------------------------------- |
/game_of_life/makefile
59,6 → 59,9
# User flags for additional configuration (will be added to compiler flags) |
USER_FLAGS ?= |
|
# Serial port for executable upload via bootloer |
COM_PORT ?= /dev/ttyUSB0 |
|
# Relative or absolute path to the NEORV32 home folder |
NEORV32_HOME ?= ../../.. |
# ***************************************************************************** |
253,6 → 256,13
|
|
# ----------------------------------------------------------------------------- |
# Upload executable via serial port to bootloader |
# ----------------------------------------------------------------------------- |
upload: $(APP_EXE) |
@sh $(NEORV32_EXG_PATH)/uart_upload.sh $(COM_PORT) $(APP_EXE) |
|
|
# ----------------------------------------------------------------------------- |
# Show configuration |
# ----------------------------------------------------------------------------- |
info: |
315,6 → 325,7
@echo " clean - clean up project" |
@echo " clean_all - clean up project, core libraries and image generator" |
@echo " bootloader - compile, generate and install VHDL BOOTROM boot image (for bootloader only!)" |
@echo " upload - upload <neorv32_exe.bin> executable via serial port <COM_PORT> to bootloader" |
|
|
# ----------------------------------------------------------------------------- |