aboutsummaryrefslogtreecommitdiff
path: root/toolruns/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'toolruns/Makefile')
-rwxr-xr-xtoolruns/Makefile46
1 files changed, 23 insertions, 23 deletions
diff --git a/toolruns/Makefile b/toolruns/Makefile
index b95b3cc..e056830 100755
--- a/toolruns/Makefile
+++ b/toolruns/Makefile
@@ -45,9 +45,10 @@ BUILD = ./build
DEVICE = 1k
FOOTPRINT = tq144
-TOP_SRC= ../src/rtl/fpga_mkm.v
+TOP_NAME = fpga_mkm
+TOP_SRC = ../src/rtl/fpga_mkm.v
TB_TOP_SRC = ../src/tb/tb_fpga_mkm.v
-CONFIG_SRC= ../src/config/pinmap.pcf
+CONFIG_SRC = ../src/config/pinmap_icestick.pcf
CC = iverilog
CC_FLAGS = -Wall
@@ -55,10 +56,13 @@ CC_FLAGS = -Wall
LINT = verilator
LINT_FLAGS = +1364-2001ext+ --lint-only -Wall -Wno-fatal -Wno-DECLFILENAME
-.PHONY: all implement burn
+
+.PHONY: all bitstream burn
+
all: top.sim
+
top.sim: $(TB_TOP_SRC) $(TOP_SRC)
$(CC) $(CC_FLAGS) -o top.sim $(TB_TOP_SRC) $(TOP_SRC)
@@ -71,38 +75,34 @@ lint: $(TOP_SRC)
$(LINT) $(LINT_FLAGS) $(TOP_SRC)
-clean:
- rm -f *.sim
- rm build/*
-
-
-implement: $(TOP_SRC)
- # if build folder doesn't exist, create it
+bitstream: $(TOP_SRC)
mkdir -p $(BUILD)
- # synthesize using Yosys
- yosys -p "synth_ice40 -top top -blif $(BUILD)/$(PROJ).blif" $(TOP_SRC)
- # Place and route using arachne
- arachne-pnr -d $(DEVICE) -P $(FOOTPRINT) -o $(BUILD)/$(PROJ).asc -p pinmap.pcf $(BUILD)/$(PROJ).blif
- # Convert to bitstream using IcePack
+ yosys -p "synth_ice40 -top $(TOP_NAME) -blif $(BUILD)/$(PROJ).blif" $(TOP_SRC)
+ arachne-pnr -d $(DEVICE) -P $(FOOTPRINT) -o $(BUILD)/$(PROJ).asc -p $(CONFIG_SRC) $(BUILD)/$(PROJ).blif
icepack $(BUILD)/$(PROJ).asc $(BUILD)/$(PROJ).bin
-burn: $(PROJ).bin
+burn:
iceprog $(BUILD)/$(PROJ).bin
+clean:
+ rm -f *.sim
+ rm -rf build
+
+
help:
@echo "Build system for simulation of AES Verilog core"
@echo ""
@echo "Supported targets:"
@echo "------------------"
- @echo "all: Build all simulation targets."
- @echo "lint: Lint all rtl source files."
- @echo "top.sim: Build top level simulation target."
- @echo "sim-top: Run top level simulation."
- @echo "implement: Implement design for the FPGA."
- @echo "burn: Write bitstream to FPGA config mem.."
- @echo "clean: Delete all built files."
+ @echo "all: Build all simulation targets."
+ @echo "lint: Lint all rtl source files."
+ @echo "top.sim: Build top level simulation target."
+ @echo "sim-top: Run top level simulation."
+ @echo "bitstream: Generate FPGA bitstream."
+ @echo "burn: Write bitstream to FPGA config mem.."
+ @echo "clean: Delete all built files and directories."
#===================================================================
# EOF Makefile