aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/polybench-syn/common.mk
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/polybench-syn/common.mk')
-rw-r--r--benchmarks/polybench-syn/common.mk41
1 files changed, 41 insertions, 0 deletions
diff --git a/benchmarks/polybench-syn/common.mk b/benchmarks/polybench-syn/common.mk
new file mode 100644
index 0000000..88fb059
--- /dev/null
+++ b/benchmarks/polybench-syn/common.mk
@@ -0,0 +1,41 @@
+VERICERT ?= vericert
+VERICERT_OPTS ?= -DSYNTHESIS -O0 -finline
+
+IVERILOG ?= iverilog
+IVERILOG_OPTS ?=
+
+VERILATOR ?= verilator
+VERILATOR_OPTS ?= -Wno-fatal --top main --exe /home/ymherklotz/projects/vericert/scripts/verilator_main.cpp
+
+TARGETS ?=
+
+%.v: %.c
+ $(VERICERT) $(VERICERT_OPTS) $< -o $@
+
+%.iver: %.v
+ $(IVERILOG) -o $@ $(IVERILOG_OPTS) $<
+
+%.gcc: %.c
+ $(CC) $(CFLAGS) $< -o $@
+
+%.verilator: %.v
+ $(VERILATOR) $(VERILATOR_OPTS) --Mdir $@ --cc $<
+ $(MAKE) -C $@ -f Vmain.mk
+
+%: %.iver %.gcc %.verilator
+ cp $< $@
+
+all: $(TARGETS)
+
+clean:
+ rm -f *.iver
+ rm -f *.v
+ rm -f *.gcc
+ rm -f *.clog
+ rm -f *.tmp
+ rm -f $(TARGETS)
+ rm -rf *.verilator
+
+.PRECIOUS: %.v %.gcc %.iver
+.PHONY: all clean
+.SUFFIXES: