Skip to content

Commit bd279af

Browse files
committed
added spi pcf
1 parent 12f2d65 commit bd279af

File tree

4 files changed

+56
-13
lines changed

4 files changed

+56
-13
lines changed

firmware/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SOURCEDIR = src
1414
# u4k set device type to iCE5LP4K
1515
DEVICE = lp384
1616
PACKAGE = SG32
17-
TOPVFILE = top
17+
TOPMODULE = top
1818

1919
# Sources
2020
SRCFILES := $(addsuffix /*, $(SOURCEDIR))
@@ -33,11 +33,11 @@ synthesize: make-dir $(TARGETBIN)
3333

3434
$(TARGETBLIF): $(VSOURCES)
3535
@echo Synthesizing blif file...
36-
@yosys -q -p "synth_ice40 -top $(TOPVFILE) -asc $@" $(VSOURCES)
36+
@yosys -q -p "synth_ice40 -top $(TOPMODULE) -asc $@" $(VSOURCES)
3737

3838
$(TARGETJSON): $(VSOURCES)
3939
@echo Synthesizing json file...
40-
@yosys -q -p "synth_ice40 -top $(TOPVFILE) -json $@" $(VSOURCES)
40+
@yosys -q -p "synth_ice40 -top $(TOPMODULE) -json $@" $(VSOURCES)
4141

4242
$(TARGETASC): $(TARGETJSON) $(PCFILE)
4343
@echo Runing place and route...
@@ -61,7 +61,7 @@ erase:
6161

6262
timing: $(TARGETASC)
6363
@echo Running timing analysis tool...
64-
@icetime -tmd $(DEVICE) -r $(TARGETDIR)/$@.txt $<
64+
@icetime -tmd $(DEVICE) -r $(TARGETDIR)/$(TARGET_NAME)-timing.txt $<
6565

6666
make-dir:
6767
@mkdir -p $(TARGETDIR)

firmware/src/constraints.pcf

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,45 @@
1-
set_io clk_25mhz 2
2-
set_io led 1
1+
###############################################################################
2+
#
3+
# icy-gecko constraint file (.pcf)
4+
# SG32 package
5+
#
6+
###############################################################################
7+
8+
####
9+
# icy-gecko information: https://github.com/
10+
####
11+
12+
# BANK 3
13+
#set_io --warn-no-port IOL_2A 2
14+
#set_io --warn-no-port IOL_2B 1 # LED
15+
#set_io --warn-no-port IOL_4A 5
16+
#set_io --warn-no-port IOL_4B_GBIN7 6
17+
#set_io --warn-no-port IOL_5A_GBIN6 8
18+
#set_io --warn-no-port IOL_5B 7
19+
20+
# BANK 1
21+
#set_io --warn-no-port IOR_34 18
22+
#set_io --warn-no-port IOR_35_GBIN3 19
23+
#set_io --warn-no-port IOR_36_GBIN2 20
24+
#set_io --warn-no-port IOR_38 22
25+
#set_io --warn-no-port IOR_39 23
26+
27+
# BANK 0
28+
#set_io --warn-no-port IOT_45 26
29+
#set_io --warn-no-port IOT_47 27
30+
#set_io --warn-no-port IOT_49_GBIN0 29
31+
#set_io --warn-no-port IOT_50_GBIN1 30 # CLK_25MHZ
32+
#set_io --warn-no-port IOT_52 32
33+
#set_io --warn-no-port IOT_53 31
34+
35+
# SPI
36+
#set_io --warn-no-port IOB_24_SDO 12
37+
#set_io --warn-no-port IOB_25_SDI 13
38+
#set_io --warn-no-port IOB_26_SCK 15
39+
#set_io --warn-no-port IOB_27_SS 14
40+
41+
# LED
42+
set_io --warn-no-port LED 1
43+
44+
# 25MHz clock
45+
set_io --warn-no-port CLK_25MHZ 30 # input

firmware/src/ice40-dev.v

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module top(input CLK_25MHZ, output LED);
2+
3+
reg [23:0] counter = 0;
4+
assign LED = counter[23];
5+
always @(posedge CLK_25MHZ) counter <= counter + 1;
6+
7+
endmodule

firmware/src/top.v

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)