Skip to content

Commit

Permalink
added blank project folder
Browse files Browse the repository at this point in the history
  • Loading branch information
pdmart committed May 21, 2016
1 parent 259ba69 commit 499aa00
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions blank/.gitignore
@@ -0,0 +1 @@
build/*
26 changes: 26 additions & 0 deletions blank/Makefile
@@ -0,0 +1,26 @@
# Project setup
PROJ = blank
BUILD = ./build
DEVICE = 8k
FOOTPRINT = ct256

# Files
FILES = top.v

.PHONY: all clean burn

all:
# 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
# Convert to bitstream using IcePack
icepack $(BUILD)/$(PROJ).asc $(BUILD)/$(PROJ).bin

burn:
iceprog $(BUILD)/$(PROJ).bin

clean:
rm build/*
10 changes: 10 additions & 0 deletions blank/pinmap.pcf
@@ -0,0 +1,10 @@
# example.pcf
set_io --warn-no-port led1 B5
set_io --warn-no-port led2 B4
set_io --warn-no-port led3 A2
set_io --warn-no-port led4 A1
set_io --warn-no-port led5 C5
set_io --warn-no-port led6 C4
set_io --warn-no-port led7 B3
set_io --warn-no-port led8 C3
set_io --warn-no-port hwclk J3
15 changes: 15 additions & 0 deletions blank/top.v
@@ -0,0 +1,15 @@
// Blink an LED provided an input clock
/* module */
module top (hwclk, led1, led2, led3, led4, led5, led6, led7, led8 );
/* I/O */
input hwclk;
output led1;
output led2;
output led3;
output led4;
output led5;
output led6;
output led7;
output led8;

endmodule

0 comments on commit 499aa00

Please sign in to comment.