Basys 3 RISC-V computer
The Basys 3 Z-80 computer with the Z-80 replaced by an RV32IM processor written from scratch (rtl/rv32_cpu.v): multi-cycle, 90 MHz, CSRs and traps, interrupts, two hardware triggers and a resumable NMI for the monitor. Passes riscv-tests rv32ui/um/mi. rv32_system.v keeps all the Z-80 machine's peripherals, with I/O port N at FFFFFF00h + N, 80 KB of RAM with BASIC preloaded, and a 32 KB monitor ROM. BASIC, the five games and the monitor (with an RV32 disassembler, assembler, breakpoints and single step) are ported to RISC-V GCC. Python emulator and tests in tools/; full-system simulation in sim/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
5930b958b4
103 files changed
+55677
No files matched your search
@@ -0,0 +1,40 @@
|
||||
/* BASIC: code and constants below A000h (ROM_TOP: the hardware ignores writes
|
||||
there), the program area at A000h, then data. 12000h-12FFFh is left free for
|
||||
machine code; the stack comes down from 13FF0h; 13FF8h-13FFFh hold the clock
|
||||
(include/basys3.h). */
|
||||
OUTPUT_ARCH("riscv")
|
||||
ENTRY(_start)
|
||||
MEMORY
|
||||
{
|
||||
ROM (rx) : ORIGIN = 0x00000, LENGTH = 0xA000
|
||||
RAM (rw) : ORIGIN = 0x0A000, LENGTH = 0x8000
|
||||
}
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
KEEP(*(.text.start))
|
||||
*(.text .text.*)
|
||||
*(.rodata .rodata.* .srodata .srodata.*)
|
||||
. = ALIGN(4);
|
||||
} > ROM
|
||||
.arena (NOLOAD) : { KEEP(*(.arena)) } > RAM
|
||||
.data : ALIGN(4) {
|
||||
__data_start = .;
|
||||
*(.data .data.*)
|
||||
__global_pointer$ = . + 0x800;
|
||||
*(.sdata .sdata.*)
|
||||
. = ALIGN(4);
|
||||
__data_end = .;
|
||||
} > RAM AT > ROM
|
||||
__data_load = LOADADDR(.data);
|
||||
.bss (NOLOAD) : ALIGN(4) {
|
||||
__bss_start = .;
|
||||
*(.sbss .sbss.* .bss .bss.* COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end = .;
|
||||
} > RAM
|
||||
ASSERT(__bss_end <= 0x12000, "BASIC's data runs into the machine-code area")
|
||||
__stack_top = 0x13FF0;
|
||||
__rom_end = __data_load + SIZEOF(.data);
|
||||
/DISCARD/ : { *(.comment) *(.riscv.attributes) }
|
||||
}
|
||||
Reference in new issue
Block a user