fix sim output location

This commit is contained in:
2021-07-02 01:12:29 -06:00
parent d850556bb7
commit 4e68e34cbf
4 changed files with 18 additions and 1866 deletions

View File

@@ -1,15 +1,17 @@
PROJ = top
PIN_DEF = pins.pcf
DEVICE = hx8k
PACKAGE = ct256
BUILD_DIR = build
PIN_DEF = constraints/pins.pcf
SOURCE_V = $(wildcard hdl/*.v)
TESTBENCH_V = $(wildcard hdl/tb/*.v)
all: $(BUILD_DIR)/$(PROJ).rpt $(BUILD_DIR)/$(PROJ).bin
all: $(BUILD_DIR) $(BUILD_DIR)/$(PROJ).rpt $(BUILD_DIR)/$(PROJ).bin
$(BUILD_DIR)/%.blif: hdl/%.v
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/%.blif: hdl/%.v | $(BUILD_DIR)
yosys -p 'synth_ice40 -top top -blif $@' $(SOURCE_V)
# yosys -p 'synth_ice40 -top top -blif $@' $<
@@ -29,14 +31,11 @@ sudo-prog: $(PROJ).bin
@echo 'Executing prog as root!!!'
sudo iceprog $<
$(BUILD_DIR):
mkdir $(BUILD_DIR)
$(BUILD_DIR)/tb.out: $(BUILD_DIR) $(SOURCE_V) $(TESTBENCH_V)
$(BUILD_DIR)/tb.out: $(SOURCE_V) $(TESTBENCH_V) | $(BUILD_DIR)
iverilog $^ -o $@
sim: $(BUILD_DIR)/tb.out
$(BUILD_DIR)/tb.out
cd $(BUILD_DIR) && ./tb.out
clean:
rm -rf $(BUILD_DIR)