Skip to content

Commit

Permalink
Add icefuzz support for the UP5K and rework underlying device specifi…
Browse files Browse the repository at this point in the history
…cation for more flexibility.
  • Loading branch information
tannewt committed Jun 23, 2017
1 parent ed8c4e8 commit 58a6110
Show file tree
Hide file tree
Showing 20 changed files with 7,452 additions and 136 deletions.
77 changes: 40 additions & 37 deletions icefuzz/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,26 @@ include ../config.mk
export LC_ALL=C
export ICE_SBTIMER_LP=1

#EIGTHK = _8k
THREEH = _384
DEVICECLASS := 1k

ifeq ($(DEVICECLASS), 384)
DEVICE := lp384-cm49
THREEH = _384
endif

ifeq ($(DEVICECLASS), 1k)
DEVICE := hx1k-tq144
endif

ifeq ($(DEVICECLASS), 5k)
DEVICE := up5k-sg48
RAM_SUFFIX := _5k
endif

ifeq ($(DEVICECLASS), 8k)
DEVICE := hx8k-ct256
RAM_SUFFIX = _8k
endif

TESTS =
TESTS += binop
Expand All @@ -18,32 +36,30 @@ TESTS += gbio
TESTS += gbio2
TESTS += prim
TESTS += fflogic
ifneq ($(THREEH),_384)
ifneq ($(DEVICECLASS),384)
TESTS += ram40
TESTS += mem
TESTS += pll
TESTS += aig
endif

database: bitdata_io.txt bitdata_logic.txt bitdata_ramb$(EIGTHK).txt bitdata_ramt$(EIGTHK).txt
ifeq ($(EIGTHK),_8k)
database: bitdata_io.txt bitdata_logic.txt bitdata_ramb$(RAM_SUFFIX).txt bitdata_ramt$(RAM_SUFFIX).txt
ifneq ($(RAM_SUFFIX),)
cp cached_ramb.txt bitdata_ramb.txt
cp cached_ramt.txt bitdata_ramt.txt
else
cp cached_ramb_8k.txt bitdata_ramb_8k.txt
cp cached_ramt_8k.txt bitdata_ramt_8k.txt
cp cached_ramb$(RAM_SUFFIX).txt bitdata_ramb$(RAM_SUFFIX).txt
cp cached_ramt$(RAM_SUFFIX).txt bitdata_ramt$(RAM_SUFFIX).txt
endif
python3 database.py
ICEDEVICE=$(DEVICECLASS) python3 database.py
python3 export.py
diff -U0 cached_io.txt bitdata_io.txt || cp -v bitdata_io.txt cached_io.txt
diff -U0 cached_logic.txt bitdata_logic.txt || cp -v bitdata_logic.txt cached_logic.txt
diff -U0 cached_ramb.txt bitdata_ramb.txt || cp -v bitdata_ramb.txt cached_ramb.txt
diff -U0 cached_ramt.txt bitdata_ramt.txt || cp -v bitdata_ramt.txt cached_ramt.txt
diff -U0 cached_ramb_8k.txt bitdata_ramb_8k.txt || cp -v bitdata_ramb_8k.txt cached_ramb_8k.txt
diff -U0 cached_ramt_8k.txt bitdata_ramt_8k.txt || cp -v bitdata_ramt_8k.txt cached_ramt_8k.txt
diff -U0 cached_ramb$(RAM_SUFFIX).txt bitdata_ramb$(RAM_SUFFIX).txt || cp -v bitdata_ramb$(RAM_SUFFIX).txt cached_ramb$(RAM_SUFFIX).txt
diff -U0 cached_ramt$(RAM_SUFFIX).txt bitdata_ramt$(RAM_SUFFIX).txt || cp -v bitdata_ramt$(RAM_SUFFIX).txt cached_ramt$(RAM_SUFFIX).txt

timings:
ifeq ($(EIGTHK),_8k)
ifeq ($(DEVICECLASS),8k)
cp tmedges.txt tmedges.tmp
set -e; for f in work_*/*.vsb; do echo $$f; yosys -q -f verilog -s tmedges.ys $$f; done
sort -u tmedges.tmp > tmedges.txt && rm -f tmedges.tmp
Expand All @@ -52,7 +68,7 @@ ifeq ($(EIGTHK),_8k)
python3 timings.py -t timings_lp8k.txt work_*/*.slp > timings_lp8k.new
mv timings_lp8k.new timings_lp8k.txt
else
ifeq ($(THREEH),_384)
ifeq ($(DEVICECLASS),384)
cp tmedges.txt tmedges.tmp
set -e; for f in work_*/*.vsb; do echo $$f; yosys -q -f verilog -s tmedges.ys $$f; done
sort -u tmedges.tmp > tmedges.txt && rm -f tmedges.tmp
Expand All @@ -76,11 +92,11 @@ timings_html:
python3 timings.py -h tmedges.txt -t timings_lp8k.txt -l "LP8K with default temp/volt settings" > timings_lp8k.html
python3 timings.py -h tmedges.txt -t timings_lp384.txt -l "LP384 with default temp/volt settings" > timings_lp384.html

data_cached.txt: cached_io.txt cached_logic.txt cached_ramb$(EIGTHK).txt cached_ramt$(EIGTHK).txt
data_cached.txt: cached_io.txt cached_logic.txt cached_ramb$(RAM_SUFFIX).txt cached_ramt$(RAM_SUFFIX).txt
gawk '{ print "io", $$0; }' cached_io.txt > data_cached.new
gawk '{ print "logic", $$0; }' cached_logic.txt >> data_cached.new
gawk '{ print "ramb$(EIGTHK)", $$0; }' cached_ramb$(EIGTHK).txt >> data_cached.new
gawk '{ print "ramt$(EIGTHK)", $$0; }' cached_ramt$(EIGTHK).txt >> data_cached.new
gawk '{ print "ramb$(RAM_SUFFIX)", $$0; }' cached_ramb$(RAM_SUFFIX).txt >> data_cached.new
gawk '{ print "ramt$(RAM_SUFFIX)", $$0; }' cached_ramt$(RAM_SUFFIX).txt >> data_cached.new
mv data_cached.new data_cached.txt

bitdata_io.txt: data_cached.txt $(addprefix data_,$(addsuffix .txt,$(TESTS)))
Expand All @@ -89,11 +105,11 @@ bitdata_io.txt: data_cached.txt $(addprefix data_,$(addsuffix .txt,$(TESTS)))
bitdata_logic.txt: data_cached.txt $(addprefix data_,$(addsuffix .txt,$(TESTS)))
grep ^logic $^ | tr -s ' ' | tr -d '\r' | cut -f2- -d' ' | sort -u > $@

bitdata_ramb$(EIGTHK).txt: data_cached.txt $(addprefix data_,$(addsuffix .txt,$(TESTS)))
grep ^ramb$(EIGTHK) $^ | tr -s ' ' | tr -d '\r' | cut -f2- -d' ' | sort -u > $@
bitdata_ramb$(RAM_SUFFIX).txt: data_cached.txt $(addprefix data_,$(addsuffix .txt,$(TESTS)))
grep ^ramb$(RAM_SUFFIX) $^ | tr -s ' ' | tr -d '\r' | cut -f2- -d' ' | sort -u > $@

bitdata_ramt$(EIGTHK).txt: data_cached.txt $(addprefix data_,$(addsuffix .txt,$(TESTS)))
grep ^ramt$(EIGTHK) $^ | tr -s ' ' | tr -d '\r' | cut -f2- -d' ' | sort -u > $@
bitdata_ramt$(RAM_SUFFIX).txt: data_cached.txt $(addprefix data_,$(addsuffix .txt,$(TESTS)))
grep ^ramt$(RAM_SUFFIX) $^ | tr -s ' ' | tr -d '\r' | cut -f2- -d' ' | sort -u > $@

datafiles: $(addprefix data_,$(addsuffix .txt,$(TESTS)))

Expand All @@ -102,21 +118,9 @@ datafiles: $(addprefix data_,$(addsuffix .txt,$(TESTS)))

define data_template
data_$(1).txt: make_$(1).py ../icepack/icepack
ifeq ($(EIGTHK),_8k)
ICE8KPINS=1 python3 make_$(1).py
+ICEDEV=hx8k-ct256 $(MAKE) -C work_$(1)
python3 extract.py -8 work_$(1)/*.glb > $$@
else
ifeq ($(THREEH),_384)
ICE384PINS=1 python3 make_$(1).py
+ICEDEV=lp384-cm49 $(MAKE) -C work_$(1)
python3 extract.py -3 work_$(1)/*.glb > $$@
else
python3 make_$(1).py
+$(MAKE) -C work_$(1)
python3 extract.py work_$(1)/*.glb > $$@
endif
endif
ICEDEVICE=$(DEVICECLASS) python3 make_$(1).py
+ICEDEV=$(DEVICE) $(MAKE) -C work_$(1)
ICEDEVICE=$(DEVICECLASS) python3 extract.py work_$(1)/*.glb > $$@
endef

$(foreach test,$(TESTS),$(eval $(call data_template,$(test))))
Expand All @@ -141,4 +145,3 @@ clean:
rm -rf timings_*.html

.PHONY: database datafiles check clean

75 changes: 75 additions & 0 deletions icefuzz/cached_io.txt
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,19 @@
(14 14) routing glb_netwk_5 <X> wire_io_cluster/io_1/outclk
(14 14) routing glb_netwk_6 <X> wire_io_cluster/io_1/outclk
(14 14) routing glb_netwk_7 <X> wire_io_cluster/io_1/outclk
(14 15) IO control bit: BIODOWN_extra_padeb_test_0
(14 15) IO control bit: BIOUP_extra_padeb_test_0
(14 15) IO control bit: GIODOWN0_extra_padeb_test_0
(14 15) IO control bit: GIODOWN1_extra_padeb_test_0
(14 15) IO control bit: GIOLEFT0_extra_padeb_test_0
(14 15) IO control bit: GIOLEFT1_extra_padeb_test_0
(14 15) IO control bit: GIORIGHT0_extra_padeb_test_0
(14 15) IO control bit: GIORIGHT1_extra_padeb_test_0
(14 15) IO control bit: GIOUP0_extra_padeb_test_0
(14 15) IO control bit: GIOUP1_extra_padeb_test_0
(14 15) IO control bit: HIPBIOUP_extra_padeb_test_0
(14 15) IO control bit: IODOWN_extra_padeb_test_0
(14 15) IO control bit: IOUP_extra_padeb_test_0
(14 2) routing span4_horz_l_13 <X> span4_vert_7
(14 2) routing span4_horz_r_1 <X> span4_vert_7
(14 2) routing span4_vert_b_1 <X> span4_horz_7
Expand Down Expand Up @@ -388,6 +401,28 @@
(15 11) routing glb_netwk_7 <X> wire_io_cluster/io_1/cen
(15 11) routing lc_trk_g1_2 <X> wire_io_cluster/io_1/cen
(15 11) routing lc_trk_g1_5 <X> wire_io_cluster/io_1/cen
(15 12) IO control bit: BIODOWN_cf_bit_39
(15 12) IO control bit: BIOUP_cf_bit_39
(15 12) IO control bit: GIODOWN0_cf_bit_39
(15 12) IO control bit: GIOLEFT1_cf_bit_39
(15 12) IO control bit: GIORIGHT0_cf_bit_39
(15 12) IO control bit: GIORIGHT1_cf_bit_39
(15 12) IO control bit: GIOUP0_cf_bit_39
(15 12) IO control bit: GIOUP1_cf_bit_39
(15 12) IO control bit: IODOWN_cf_bit_39
(15 14) IO control bit: BIODOWN_extra_padeb_test_1
(15 14) IO control bit: BIOUP_extra_padeb_test_1
(15 14) IO control bit: GIODOWN0_extra_padeb_test_1
(15 14) IO control bit: GIODOWN1_extra_padeb_test_1
(15 14) IO control bit: GIOLEFT0_extra_padeb_test_1
(15 14) IO control bit: GIOLEFT1_extra_padeb_test_1
(15 14) IO control bit: GIORIGHT0_extra_padeb_test_1
(15 14) IO control bit: GIORIGHT1_extra_padeb_test_1
(15 14) IO control bit: GIOUP0_extra_padeb_test_1
(15 14) IO control bit: GIOUP1_extra_padeb_test_1
(15 14) IO control bit: HIPBIOUP_extra_padeb_test_1
(15 14) IO control bit: IODOWN_extra_padeb_test_1
(15 14) IO control bit: IOUP_extra_padeb_test_1
(15 15) Enable bit of Mux _clock_links/clk_mux => glb_netwk_0 wire_io_cluster/io_1/outclk
(15 15) Enable bit of Mux _clock_links/clk_mux => glb_netwk_1 wire_io_cluster/io_1/outclk
(15 15) Enable bit of Mux _clock_links/clk_mux => glb_netwk_2 wire_io_cluster/io_1/outclk
Expand Down Expand Up @@ -424,6 +459,13 @@
(15 5) routing lc_trk_g1_4 <X> wire_gbuf/in
(15 5) routing lc_trk_g1_6 <X> fabout
(15 5) routing lc_trk_g1_6 <X> wire_gbuf/in
(15 6) IO control bit: BIODOWN_cf_bit_35
(15 6) IO control bit: BIOUP_cf_bit_35
(15 6) IO control bit: GIOLEFT1_cf_bit_35
(15 6) IO control bit: GIORIGHT0_cf_bit_35
(15 6) IO control bit: GIORIGHT1_cf_bit_35
(15 6) IO control bit: GIOUP0_cf_bit_35
(15 6) IO control bit: IODOWN_cf_bit_35
(15 9) Enable bit of Mux _clock_links/inclk_mux => glb_netwk_0 wire_io_cluster/io_1/inclk
(15 9) Enable bit of Mux _clock_links/inclk_mux => glb_netwk_1 wire_io_cluster/io_1/inclk
(15 9) Enable bit of Mux _clock_links/inclk_mux => glb_netwk_2 wire_io_cluster/io_1/inclk
Expand Down Expand Up @@ -489,7 +531,12 @@
(2 0) PLL config bit: CLOCK_T_0_3_IOLEFT_cf_bit_1
(2 0) PLL config bit: CLOCK_T_0_4_IOLEFT_cf_bit_1
(2 0) PLL config bit: CLOCK_T_0_5_IOLEFT_cf_bit_1
(2 0) PLL config bit: CLOCK_T_10_31_IOUP_cf_bit_1
(2 0) PLL config bit: CLOCK_T_11_31_IOUP_cf_bit_1
(2 0) PLL config bit: CLOCK_T_12_31_IOUP_cf_bit_1
(2 0) PLL config bit: CLOCK_T_13_31_IOUP_cf_bit_1
(2 0) PLL config bit: CLOCK_T_14_0_IODOWN_cf_bit_1
(2 0) PLL config bit: CLOCK_T_14_31_IOUP_cf_bit_1
(2 0) PLL config bit: CLOCK_T_15_0_IODOWN_cf_bit_1
(2 0) PLL config bit: CLOCK_T_16_0_IODOWN_cf_bit_1
(2 0) PLL config bit: CLOCK_T_17_0_IODOWN_cf_bit_1
Expand All @@ -506,6 +553,8 @@
(2 2) PLL config bit: CLOCK_T_0_2_IOLEFT_cf_bit_4
(2 2) PLL config bit: CLOCK_T_0_3_IOLEFT_cf_bit_4
(2 2) PLL config bit: CLOCK_T_0_4_IOLEFT_cf_bit_4
(2 2) PLL config bit: CLOCK_T_12_31_IOUP_cf_bit_4
(2 2) PLL config bit: CLOCK_T_13_31_IOUP_cf_bit_4
(2 2) PLL config bit: CLOCK_T_14_0_IODOWN_cf_bit_4
(2 2) PLL config bit: CLOCK_T_15_0_IODOWN_cf_bit_4
(2 2) PLL config bit: CLOCK_T_16_0_IODOWN_cf_bit_4
Expand All @@ -518,13 +567,18 @@
(2 4) PLL config bit: CLOCK_T_0_2_IOLEFT_cf_bit_7
(2 4) PLL config bit: CLOCK_T_0_3_IOLEFT_cf_bit_7
(2 4) PLL config bit: CLOCK_T_0_4_IOLEFT_cf_bit_7
(2 4) PLL config bit: CLOCK_T_10_31_IOUP_cf_bit_7
(2 4) PLL config bit: CLOCK_T_11_31_IOUP_cf_bit_7
(2 4) PLL config bit: CLOCK_T_12_31_IOUP_cf_bit_7
(2 4) PLL config bit: CLOCK_T_13_31_IOUP_cf_bit_7
(2 4) PLL config bit: CLOCK_T_14_0_IODOWN_cf_bit_7
(2 4) PLL config bit: CLOCK_T_15_0_IODOWN_cf_bit_7
(2 4) PLL config bit: CLOCK_T_16_0_IODOWN_cf_bit_7
(2 4) PLL config bit: CLOCK_T_17_0_IODOWN_cf_bit_7
(2 5) Enable bit of Mux _out_links/OutMux4_1 => wire_io_cluster/io_0/D_IN_1 span4_horz_34
(2 5) Enable bit of Mux _out_links/OutMux4_1 => wire_io_cluster/io_0/D_IN_1 span4_vert_34
(2 6) IO control bit: BIODOWN_REN_0
(2 6) IO control bit: BIODOWN_REN_1
(2 6) IO control bit: BIOLEFT_REN_0
(2 6) IO control bit: BIORIGHT_REN_0
(2 6) IO control bit: BIORIGHT_REN_1
Expand Down Expand Up @@ -563,12 +617,18 @@
(3 0) PLL config bit: CLOCK_T_0_2_IOLEFT_cf_bit_2
(3 0) PLL config bit: CLOCK_T_0_3_IOLEFT_cf_bit_2
(3 0) PLL config bit: CLOCK_T_0_4_IOLEFT_cf_bit_2
(3 0) PLL config bit: CLOCK_T_10_31_IOUP_cf_bit_2
(3 0) PLL config bit: CLOCK_T_11_31_IOUP_cf_bit_2
(3 0) PLL config bit: CLOCK_T_12_31_IOUP_cf_bit_2
(3 0) PLL config bit: CLOCK_T_13_31_IOUP_cf_bit_2
(3 0) PLL config bit: CLOCK_T_14_0_IODOWN_cf_bit_2
(3 0) PLL config bit: CLOCK_T_14_31_IOUP_cf_bit_2
(3 0) PLL config bit: CLOCK_T_15_0_IODOWN_cf_bit_2
(3 0) PLL config bit: CLOCK_T_16_0_IODOWN_cf_bit_2
(3 0) PLL config bit: CLOCK_T_17_0_IODOWN_cf_bit_2
(3 0) PLL config bit: CLOCK_T_18_0_IODOWN_cf_bit_2
(3 0) PLL config bit: CLOCK_T_18_33_IOUP_cf_bit_2
(3 1) IO control bit: BIODOWN_REN_0
(3 1) IO control bit: BIODOWN_REN_1
(3 1) IO control bit: BIOLEFT_REN_1
(3 1) IO control bit: BIORIGHT_REN_0
Expand Down Expand Up @@ -611,6 +671,7 @@
(3 2) PLL config bit: CLOCK_T_0_3_IOLEFT_cf_bit_5
(3 2) PLL config bit: CLOCK_T_0_4_IOLEFT_cf_bit_5
(3 2) PLL config bit: CLOCK_T_0_5_IOLEFT_cf_bit_5
(3 2) PLL config bit: CLOCK_T_13_31_IOUP_cf_bit_5
(3 2) PLL config bit: CLOCK_T_14_0_IODOWN_cf_bit_5
(3 2) PLL config bit: CLOCK_T_15_0_IODOWN_cf_bit_5
(3 2) PLL config bit: CLOCK_T_16_0_IODOWN_cf_bit_5
Expand All @@ -621,7 +682,10 @@
(3 3) PLL config bit: CLOCK_T_0_3_IOLEFT_cf_bit_3
(3 3) PLL config bit: CLOCK_T_0_4_IOLEFT_cf_bit_3
(3 3) PLL config bit: CLOCK_T_0_5_IOLEFT_cf_bit_3
(3 3) PLL config bit: CLOCK_T_11_31_IOUP_cf_bit_3
(3 3) PLL config bit: CLOCK_T_13_31_IOUP_cf_bit_3
(3 3) PLL config bit: CLOCK_T_14_0_IODOWN_cf_bit_3
(3 3) PLL config bit: CLOCK_T_14_31_IOUP_cf_bit_3
(3 3) PLL config bit: CLOCK_T_15_0_IODOWN_cf_bit_3
(3 3) PLL config bit: CLOCK_T_16_0_IODOWN_cf_bit_3
(3 3) PLL config bit: CLOCK_T_17_0_IODOWN_cf_bit_3
Expand All @@ -630,17 +694,23 @@
(3 4) PLL config bit: CLOCK_T_0_2_IOLEFT_cf_bit_8
(3 4) PLL config bit: CLOCK_T_0_3_IOLEFT_cf_bit_8
(3 4) PLL config bit: CLOCK_T_0_4_IOLEFT_cf_bit_8
(3 4) PLL config bit: CLOCK_T_10_31_IOUP_cf_bit_8
(3 4) PLL config bit: CLOCK_T_11_31_IOUP_cf_bit_8
(3 4) PLL config bit: CLOCK_T_13_31_IOUP_cf_bit_8
(3 4) PLL config bit: CLOCK_T_14_0_IODOWN_cf_bit_8
(3 4) PLL config bit: CLOCK_T_15_0_IODOWN_cf_bit_8
(3 4) PLL config bit: CLOCK_T_17_0_IODOWN_cf_bit_8
(3 5) PLL config bit: CLOCK_T_0_1_IOLEFT_cf_bit_6
(3 5) PLL config bit: CLOCK_T_0_2_IOLEFT_cf_bit_6
(3 5) PLL config bit: CLOCK_T_0_3_IOLEFT_cf_bit_6
(3 5) PLL config bit: CLOCK_T_0_4_IOLEFT_cf_bit_6
(3 5) PLL config bit: CLOCK_T_11_31_IOUP_cf_bit_6
(3 5) PLL config bit: CLOCK_T_13_31_IOUP_cf_bit_6
(3 5) PLL config bit: CLOCK_T_14_0_IODOWN_cf_bit_6
(3 5) PLL config bit: CLOCK_T_15_0_IODOWN_cf_bit_6
(3 5) PLL config bit: CLOCK_T_16_0_IODOWN_cf_bit_6
(3 5) PLL config bit: CLOCK_T_17_0_IODOWN_cf_bit_6
(3 6) IO control bit: BIODOWN_IE_0
(3 6) IO control bit: BIODOWN_IE_1
(3 6) IO control bit: BIOLEFT_IE_1
(3 6) IO control bit: BIORIGHT_IE_0
Expand Down Expand Up @@ -674,11 +744,16 @@
(3 7) PLL config bit: CLOCK_T_0_2_IOLEFT_cf_bit_9
(3 7) PLL config bit: CLOCK_T_0_3_IOLEFT_cf_bit_9
(3 7) PLL config bit: CLOCK_T_0_4_IOLEFT_cf_bit_9
(3 7) PLL config bit: CLOCK_T_10_31_IOUP_cf_bit_9
(3 7) PLL config bit: CLOCK_T_11_31_IOUP_cf_bit_9
(3 7) PLL config bit: CLOCK_T_12_31_IOUP_cf_bit_9
(3 7) PLL config bit: CLOCK_T_13_31_IOUP_cf_bit_9
(3 7) PLL config bit: CLOCK_T_14_0_IODOWN_cf_bit_9
(3 7) PLL config bit: CLOCK_T_15_0_IODOWN_cf_bit_9
(3 7) PLL config bit: CLOCK_T_16_0_IODOWN_cf_bit_9
(3 7) PLL config bit: CLOCK_T_17_0_IODOWN_cf_bit_9
(3 9) IO control bit: BIODOWN_IE_0
(3 9) IO control bit: BIODOWN_IE_1
(3 9) IO control bit: BIOLEFT_IE_0
(3 9) IO control bit: BIORIGHT_IE_0
(3 9) IO control bit: BIORIGHT_IE_1
Expand Down
Loading

0 comments on commit 58a6110

Please sign in to comment.