Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ metals.sbt

.envrc
.direnv/

lite*/
litex_setup.py
pythondata*/
valentyusb/
migen/
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
BUILDDIR ?= build
CPUDIR ?= cpu
TARGET ?= ulx3s
PORT ?= /dev/ttyUSB0

all: synth

Expand All @@ -12,7 +14,7 @@ $(BUILDDIR)/Raster.sv: $(shell find src/main/scala -type f)
$(BUILDDIR)/%:
@mkdir -p $@

.PHONY: sim
.PHONY: sim cpu
sim: $(BUILDDIR)/Raster.sv $(BUILDDIR)/sim
@make -C sim run BUILDDIR=$(CURDIR)/$(BUILDDIR)/sim

Expand All @@ -25,5 +27,13 @@ prog: $(BUILDDIR)/Raster.sv $(BUILDDIR)/$(TARGET)
flash: $(BUILDDIR)/Raster.sv $(BUILDDIR)/$(TARGET)
@make -C synth/$(TARGET) flash BUILDDIR=$(CURDIR)/$(BUILDDIR)/$(TARGET)

cpu: FORCE
@make -C $(CPUDIR)

cpu-test: $(CPUDIR)/bare-program
@PORT=$(PORT) make -C $(CPUDIR)/bare-program

clean:
@rm -rf $(BUILDDIR)

FORCE:
13 changes: 13 additions & 0 deletions cpu/CPU.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
TARGET = radiona_ulx3s
DEVICE = LFE5U-85F
SDRAM = W9825G6KH6
BUS ?= axi-lite
CPU ?= vexriscv
VARIANT ?= minimal+debug

all: FORCE
@python3 -m litex_boards.targets.$(TARGET) \
--device $(DEVICE) --sdram-module $(SDRAM) \
--bus-standard $(BUS) --cpu-type $(CPU) \
--cpu-variant $(VARIANT) --build --load
FORCE:
5 changes: 5 additions & 0 deletions cpu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
all: FORCE
@bash setup.sh
@make -C litex

FORCE:
10 changes: 10 additions & 0 deletions cpu/bare-program/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[target.riscv32i-unknown-none-elf]
rustflags = [
"-C", "link-arg=-Tmemory.x",
"-C", "link-arg=-Tlink.x",
"-C", "linker-plugin-lto",
]


[build]
target = "riscv32i-unknown-none-elf"
2 changes: 2 additions & 0 deletions cpu/bare-program/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
*.bin
Loading