This repository hosts the code I wrote when playing around with FPGAs. Specifically, the Verilog code I wrote describes a "System on Chip" for the DE0-CV based on the picoRV32 softcore.
- The
src/
folder has the Verilog code.- The
hdl/
subfolder has the code describing the SoC. - The
test/
subfolder contains a very simple testbench (if you can call it that)
- The
- The
mem/
folder has initialization files for some of the Block RAMs used by the SoC- The
program_ram/
subfolder has RISC-V code to be loaded and run into the primary BRAM. - The
char_rom/
subfolder describes a character set used by the VGA subsystem.
- The
- The
ip/
folder would contain all the IP blocks used. Their files have been ignored, so check theip/.gitignore
file for descriptions of the components.
This mapping is implicitly defined in src/hdl/soc.v
in the code instantiating
an arbiter
module.
- Main Memory:
0x0000_0000 - 0x0000_ffff
- Readable, Writeable, Executable
- Initialized from
mem/program_ram/program.mem
- Starts execution at address zero
- Video Memory:
0x0001_0000 - 0x0001_ffff
- Writeable
- Initialized to zeros
- Contains a text buffer of length
3200
starting at0x0001_0000
- CAN ONLY BE USED WITH
SB
. USINGSH
ANDSW
WILL FAIL.
- Keys MMIO:
0xffff_fff8 - 0xffff_fffb
- Readable
- Describes the switches and buttons pressed as a 32-bit vector
- Bits
31-28
are~KEY[3]-~KEY[0]
. Note that1
means pressed. - Bits
9-0
areSW[9]-SW[0]
. - All other bits are zero.
- Bits
- Seven Segment MMIO:
0xffff_fffc - 0xffff_ffff
- Writeable
- Bits
23-0
of the word at these locations is shown on the seven segment display.