aboutsummaryrefslogtreecommitdiff
path: root/toolruns
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@assured.se>2019-02-12 10:41:53 +0100
committerJoachim StroĢˆmbergson <joachim@assured.se>2019-02-12 10:41:53 +0100
commitea442d768cba08d3728ea2e7e62f1d90e0e781fd (patch)
treed2d03acf772b95b800115daca65fc3f245f82af3 /toolruns
parent681c311e98b704b383bdca67f569a206fad551a0 (diff)
(1) Fixed Makefile. Now we can build sim target, generate bitstream and also burn it to the FPGA dev board. (2) Started structuring the RTL source file.
Diffstat (limited to 'toolruns')
-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