summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoruvok2025-12-26 10:49:02 +0100
committeruvok2025-12-26 10:49:02 +0100
commit4c127436520b897202cb04bb5150cf8d1a17d991 (patch)
treea85c0a8e0aec2eb86a51846a6d38d3ccaa7ded68 /Makefile
parent5b59c9092092c4e502f6446990650290775283d2 (diff)
Add simulation targets
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9e8bcca..e7fc552 100644
--- a/Makefile
+++ b/Makefile
@@ -48,7 +48,10 @@ flash: $(PROGRAM).fs
openFPGALoader -b tangnano9k $(FLASH_OPTS) $(PROGRAM).fs
clean:
- rm -rf *.json *.fs *.svg *.log *.dep
+ rm -rf *.json *.fs *.svg *.log *.dep *.vvp *.lxt2
+
+simu: $(PROGRAM).lxt2
+ gtkwave $<
## Patterns
@@ -80,6 +83,14 @@ clean:
%.fs: %.pnr.json
gowin_pack -d $(DEVICE_FAMILY) -o $@ $<
+### simulation
+
+%.lxt2: %.vvp
+ ./$< -lxt2
+
+%.vvp: %.v %.tb.v
+ iverilog -o $*.vvp $*.v $*.tb.v
+
## inter-file dependencies
-include $(DEPS)
-include $($(wildcard *.fs:.fs=.dep)