aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNathan Ringo <nathan@remexre.com>2024-05-05 10:26:50 -0500
committerNathan Ringo <nathan@remexre.com>2024-05-05 10:26:50 -0500
commit2ec6d7d09e2cd6c08686aae9427b46a217972675 (patch)
tree60698fed7a07b2325acf65a85608c9e51a7bec02 /Makefile
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 19 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..80b04e5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,19 @@
+BSC_COMP_FLAGS = -aggressive-conditions -check-assert -keep-fires
+BSC_LINK_FLAGS = -keep-fires
+TOPFILE = Top
+TOPMODULE = mkTop
+
+all: tmp/$(TOPMODULE).exe tmp/$(TOPMODULE).v
+clean: clean.sh
+ @./clean.sh
+.PHONY: all clean
+
+tmp/$(TOPMODULE).exe: tmp/$(TOPMODULE).ba
+ @mkdir -p $(dir $@)
+ bsc -e $(TOPMODULE) -o $@ -p $(dir $<) -sim -simdir tmp -u $(BSC_LINK_FLAGS)
+tmp/$(TOPMODULE).ba: src/$(TOPFILE).bs
+ @mkdir -p $(dir $@)
+ bsc -bdir $(dir $@) -g $(TOPMODULE) -sim -u $(BSC_COMP_FLAGS) $<
+tmp/$(TOPMODULE).v: src/$(TOPFILE).bs
+ @mkdir -p $(dir $@)
+ bsc -bdir tmp -g $(TOPMODULE) -u -verilog -vdir tmp $(BSC_COMP_FLAGS) $<