Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
03e420e
got a good idea of how to interface with SDRAM now
isaac-ahlgren Aug 17, 2024
1d28a18
made a ton of changes for the quartus synthesizer, still needs more work
isaac-ahlgren Aug 24, 2024
faab0a1
updated to more align with synthesizing
isaac-ahlgren Aug 26, 2024
51d776e
checkpoint
isaac-ahlgren Sep 3, 2024
f996f58
checkpoint
isaac-ahlgren Sep 3, 2024
f4601aa
small changed
isaac-ahlgren Sep 8, 2024
b9a36e9
finished refactoring
isaac-ahlgren Sep 9, 2024
c89d734
started working on peripheral system registers to be able to blink a …
isaac-ahlgren Sep 9, 2024
100a3f8
checkpoint, still need to test and fix errors
isaac-ahlgren Sep 9, 2024
61e260d
added a new test file and am currently trying to fix all errors for s…
isaac-ahlgren Sep 11, 2024
f52978e
updated some stuff
isaac-ahlgren Sep 13, 2024
7bc9749
updated project directory again and am currently redoing exactly how …
isaac-ahlgren Sep 15, 2024
2c5c8d6
got it to compile the simulation again
isaac-ahlgren Sep 15, 2024
1fbed5e
fixed a ton of stuff but i realized i accidentally made the read time…
isaac-ahlgren Sep 16, 2024
54d7329
fixed how sram was initialzed, turned it back to a single cycle read …
isaac-ahlgren Sep 19, 2024
06b42a6
got blinky working!
isaac-ahlgren Sep 19, 2024
4c44d1e
more progress
isaac-ahlgren Sep 20, 2024
1ff6782
added more stuff plus fixed sram in order to be able to be synthesized
isaac-ahlgren Sep 20, 2024
530a7ab
fixed some stuff in the sram
isaac-ahlgren Sep 20, 2024
109cdc1
fixed sram again
isaac-ahlgren Sep 25, 2024
717e49a
fixed sram i think
isaac-ahlgren Sep 29, 2024
45c4bbb
update
isaac-ahlgren Oct 1, 2024
abb92af
fixed some stuff with how verilog loads in the ram with the program
isaac-ahlgren Oct 18, 2024
cd86b06
fixed sram again for the most part
isaac-ahlgren Oct 24, 2024
e7fc839
victory! got something coherent going on withe managing memory transa…
isaac-ahlgren Nov 6, 2024
3fc5dc6
got cache controller to read and write data to memory correctly
isaac-ahlgren Nov 15, 2024
ada657a
fixed some stuff in the write through cache
isaac-ahlgren Nov 16, 2024
d235084
fixed more of my cache miss controller
isaac-ahlgren Nov 17, 2024
8172f75
added cache to memory system module and remade everything; still need…
isaac-ahlgren Nov 18, 2024
4b889c4
some updates to the memory system
isaac-ahlgren Nov 27, 2024
25b0e9d
new fixes
isaac-ahlgren Dec 31, 2024
d2b4b42
some structure changes, WIP bug fixes for the cache controller
isaac-ahlgren Feb 20, 2025
fef199b
fixed some issues with changing addresses in cache controller
isaac-ahlgren Mar 30, 2025
ec31331
updates to memory system controller, still wip
isaac-ahlgren Mar 31, 2025
e63207b
fixed some bugs and made progress
isaac-ahlgren Apr 14, 2025
554946a
fixed some bugs, switched over to simulating in icarus verilog + adde…
isaac-ahlgren Aug 17, 2025
9c8a819
adding jump test case
isaac-ahlgren Aug 21, 2025
7781cdb
adding test for reading and writing from a peripheral register
isaac-ahlgren Aug 24, 2025
401f595
adding a bunch of tests that currently pass
isaac-ahlgren Oct 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 54 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
work/
*.txt
dumpfile
risc_test_program/merge_sort
risc_test_program/risc_test
sram_dumpfile
merge_sort
risc_test
blinky

# ignore ModelSim generated files and directories (temp files and so on)
[_@]*
Expand All @@ -26,4 +28,53 @@ wlf*
cov*/
transcript*
sc_dpiheader.h
vsim.dbg
vsim.

# ignore Quartus II generated files
*_generation_script*
*_inst.vhd
*.bak
*.cmp
*.cdf
*.done
*.eqn
*.hex
*.html
*.jdi
*.jpg
*.mif
*.pin
*.pof
*.ptf.*
*.qar
*.qarlog
*.qws
*.rpt
*.smsg
*.sof
*.sopc_builder
*.summary
*.tcl
*.txt # Explicitly add any text files used
*~
*example*
*sopc_*
# *.sdc # I want those timing files

# ignore Quartus II generated folders
*/db/
*/incremental_db/
*/simulation/
*/timing/
*/testbench/
*/*_sim/
incremental_db/
db/
_output_files/
PLLJ_PLLSPE_INFO.txt

/xpacks
/.vscode
/build
*.o
/.pytest_cache
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
DIR := ./xpacks/.bin
SRC_DIR := ./tests/src
HEX_DIR := ./tests/hex
OBJ_DIR := ./tests/obj

CC := $(DIR)/riscv-none-elf-gcc
PYTHON := python3
OBJDUMP := $(DIR)/riscv-none-elf-objdump
OBJCOPY := $(DIR)/riscv-none-elf-objcopy
MEM_WORD_LENGTH := 4

CFLAGS := -O0 -ffunction-sections -Xlinker -g -T./tests/risc.ld -mbig-endian -nostdlib -ffreestanding -fno-pie -fno-stack-protector -Wall -mno-fdiv -march=rv32i -mabi=ilp32

SRCS = $(wildcard $(SRC_DIR)/*.c)

PROGS = $(patsubst ${SRC_DIR}/%.c,%,$(SRCS))
.PHONY: $(PROGS)

all: $(PROGS)

$(PROGS):
$(CC) $(CFLAGS) -o $(OBJ_DIR)/[email protected] $(SRC_DIR)/[email protected]
$(OBJCOPY) --remove-section=.comment --reverse-bytes=$(MEM_WORD_LENGTH) \
--verilog-data-width $(MEM_WORD_LENGTH) \
$(OBJ_DIR)/[email protected] -O verilog $(HEX_DIR)/[email protected]

test:
python3 -m pytest ./tests

dump:
$(OBJDUMP) -D --disassembler-options=no-aliases $(OBJ_DIR)/$(FILE)

clean:
rm -r tests/obj/* tests/hex/* build

11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# riscv-processor
RISCV processor in verilog.

Made for educational purposes.

Test programs are in risc\_test\_program.
## TODO:
1. Fix sram in simulation to make sure it works properly.
2. Make sure logic works on MAX10
3. Implement Linter and automatic formatter for Verilog
4. Design Cache
5. Refactor Verilog code to look neater.
6. Get SDRAM controller working
32 changes: 0 additions & 32 deletions data_addr_bus_controller.v

This file was deleted.

Loading