Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blank compatible with HX1K #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions blank/Makefile
Original file line number Diff line number Diff line change
@@ -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/*
File renamed without changes.
7 changes: 7 additions & 0 deletions blank/pinmap_tq144.pcf
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions blank/top_1k.v
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.