diff --git a/blank/Makefile b/blank/Makefile index 8a1f8ac..a45d58e 100644 --- a/blank/Makefile +++ b/blank/Makefile @@ -1,26 +1,33 @@ # Project setup PROJ = blank BUILD = ./build -DEVICE = 8k +DEVICE = 1k +#DEVICE = 8k +ifeq (8k,$(DEVICE)) FOOTPRINT = ct256 +else +FOOTPRINT = tq144 +endif # Files -FILES = top.v +FILES = top_$(DEVICE).v .PHONY: all clean burn -all: +all:$(BUILD)/$(PROJ)_$(DEVICE).bin + +$(BUILD)/$(PROJ)_$(DEVICE).bin: $(FILES) Makefile # if build folder doesn't exist, create it mkdir -p $(BUILD) # synthesize using Yosys yosys -p "synth_ice40 -top top -blif $(BUILD)/$(PROJ).blif" $(FILES) # Place and route using arachne - arachne-pnr -d $(DEVICE) -P $(FOOTPRINT) -o $(BUILD)/$(PROJ).asc -p pinmap.pcf $(BUILD)/$(PROJ).blif + arachne-pnr -d $(DEVICE) -P $(FOOTPRINT) -o $(BUILD)/$(PROJ)_$(DEVICE).asc -p pinmap_$(FOOTPRINT).pcf $(BUILD)/$(PROJ).blif # Convert to bitstream using IcePack - icepack $(BUILD)/$(PROJ).asc $(BUILD)/$(PROJ).bin + icepack $(BUILD)/$(PROJ)_$(DEVICE).asc $(BUILD)/$(PROJ)_$(DEVICE).bin -burn: - iceprog $(BUILD)/$(PROJ).bin +burn: $(BUILD)/$(PROJ)_$(DEVICE).bin + iceprog $< clean: - rm build/* + rm -f build/* diff --git a/blank/pinmap.pcf b/blank/pinmap_ct256.pcf similarity index 100% rename from blank/pinmap.pcf rename to blank/pinmap_ct256.pcf diff --git a/blank/pinmap_tq144.pcf b/blank/pinmap_tq144.pcf new file mode 100644 index 0000000..4cdac50 --- /dev/null +++ b/blank/pinmap_tq144.pcf @@ -0,0 +1,7 @@ +# example.pcf +set_io --warn-no-port led1 99 +set_io --warn-no-port led2 98 +set_io --warn-no-port led3 97 +set_io --warn-no-port led4 96 +set_io --warn-no-port led5 95 +set_io --warn-no-port hwclk 21 diff --git a/blank/top_1k.v b/blank/top_1k.v new file mode 100644 index 0000000..468ea33 --- /dev/null +++ b/blank/top_1k.v @@ -0,0 +1,12 @@ +// Blink an LED provided an input clock +/* module */ +module top (hwclk, led1, led2, led3, led4, led5); + /* I/O */ + input hwclk; + output led1; + output led2; + output led3; + output led4; + output led5; + +endmodule diff --git a/blank/top.v b/blank/top_8k.v similarity index 100% rename from blank/top.v rename to blank/top_8k.v