Basic example, outputs work but inputs don't

This commit is contained in:
David Shah 2017-10-21 19:14:06 +01:00
parent ec419b4206
commit 88f91de113
4 changed files with 53 additions and 0 deletions

4
examples/up5k/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
example.bin
example.blif
example.asc
example.rpt

36
examples/up5k/Makefile Normal file
View File

@ -0,0 +1,36 @@
PROJ = example
PIN_DEF = up5k.pcf
DEVICE = up5k
# Relative paths for easier development without messing with installed version
ARACHNE = ../../../arachne-pnr/bin/arachne-pnr
ARACHNE_ARGS = -c ../../icebox/chipdb-5k.txt
ICEPACK = ../../icepack/icepack
ICETIME = ../../icetime/icetime
ICEPROG = ../../iceprog/iceprog
all: $(PROJ).bin
%.blif: %.v
yosys -p 'synth_ice40 -top top -blif $@' $<
%.asc: $(PIN_DEF) %.blif
$(ARACHNE) $(ARACHNE_ARGS) -d $(subst up,,$(subst hx,,$(subst lp,,$(DEVICE)))) -o $@ -p $^
%.bin: %.asc
$(ICEPACK) $< $@
%.rpt: %.asc
$(ICETIME) -d $(DEVICE) -mtr $@ $<
prog: $(PROJ).bin
$(ICEPROG) -S $<
sudo-prog: $(PROJ).bin
@echo 'Executing prog as root!!!'
sudo $(ICEPROG) -S $<
clean:
rm -f $(PROJ).blif $(PROJ).asc $(PROJ).rpt $(PROJ).bin
.SECONDARY:
.PHONY: all prog clean

10
examples/up5k/example.v Normal file
View File

@ -0,0 +1,10 @@
module top (
input btn,
output LED0,
output LED1,
);
assign LED0 = !btn;
assign LED1 = btn;
endmodule

3
examples/up5k/up5k.pcf Normal file
View File

@ -0,0 +1,3 @@
set_io LED0 12
set_io LED1 21
set_io btn 26