summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile13
2 files changed, 14 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index f4bb047..4d391b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@
*.log
*.svg
*.dep
+*.vvp
+*.lxt2
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)