mirror of
https://gitlab.com/brendanhaines/ice40.git
synced 2024-11-09 13:05:01 -07:00
use separate build directory
This commit is contained in:
parent
0ec0c32d87
commit
d850556bb7
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
build
|
|
@ -2,13 +2,14 @@ PROJ = top
|
||||||
PIN_DEF = pins.pcf
|
PIN_DEF = pins.pcf
|
||||||
DEVICE = hx8k
|
DEVICE = hx8k
|
||||||
PACKAGE = ct256
|
PACKAGE = ct256
|
||||||
|
BUILD_DIR = build
|
||||||
|
|
||||||
SOURCE_V = $(wildcard *.v)
|
SOURCE_V = $(wildcard hdl/*.v)
|
||||||
TESTBENCH_V = $(wildcard tb/*.v)
|
TESTBENCH_V = $(wildcard hdl/tb/*.v)
|
||||||
|
|
||||||
all: $(PROJ).rpt $(PROJ).bin
|
all: $(BUILD_DIR)/$(PROJ).rpt $(BUILD_DIR)/$(PROJ).bin
|
||||||
|
|
||||||
%.blif: %.v
|
$(BUILD_DIR)/%.blif: hdl/%.v
|
||||||
yosys -p 'synth_ice40 -top top -blif $@' $(SOURCE_V)
|
yosys -p 'synth_ice40 -top top -blif $@' $(SOURCE_V)
|
||||||
# yosys -p 'synth_ice40 -top top -blif $@' $<
|
# yosys -p 'synth_ice40 -top top -blif $@' $<
|
||||||
|
|
||||||
|
@ -28,14 +29,17 @@ sudo-prog: $(PROJ).bin
|
||||||
@echo 'Executing prog as root!!!'
|
@echo 'Executing prog as root!!!'
|
||||||
sudo iceprog $<
|
sudo iceprog $<
|
||||||
|
|
||||||
tb.out: $(SOURCE_V) $(TESTBENCH_V)
|
$(BUILD_DIR):
|
||||||
|
mkdir $(BUILD_DIR)
|
||||||
|
|
||||||
|
$(BUILD_DIR)/tb.out: $(BUILD_DIR) $(SOURCE_V) $(TESTBENCH_V)
|
||||||
iverilog $^ -o $@
|
iverilog $^ -o $@
|
||||||
|
|
||||||
sim: tb.out
|
sim: $(BUILD_DIR)/tb.out
|
||||||
./tb.out
|
$(BUILD_DIR)/tb.out
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(PROJ).blif $(PROJ).asc $(PROJ).rpt $(PROJ).bin tb.out tb.vcd
|
rm -rf $(BUILD_DIR)
|
||||||
|
|
||||||
.SECONDARY:
|
.SECONDARY:
|
||||||
.PHONY: all prog clean sim
|
.PHONY: all prog clean sim
|
Loading…
Reference in New Issue
Block a user