diff options
author | hermitsoft <hermisu@mail.com> | 2017-03-10 02:09:46 +0100 |
---|---|---|
committer | hermitsoft <hermisu@mail.com> | 2017-03-10 02:09:46 +0100 |
commit | e832acc445f64d1f9379eef8ef01576ccc0494b6 (patch) | |
tree | 429c136200b76a4a3621e71f62c608365998b142 /icefuzz/tests | |
parent | dacf221f3b61603b5d1998ca0afca125a5b18d50 (diff) | |
download | icestorm-e832acc445f64d1f9379eef8ef01576ccc0494b6.tar.gz icestorm-e832acc445f64d1f9379eef8ef01576ccc0494b6.tar.bz2 icestorm-e832acc445f64d1f9379eef8ef01576ccc0494b6.zip |
icefuzz data and test scripts for LP384-CM49
Diffstat (limited to 'icefuzz/tests')
-rw-r--r-- | icefuzz/tests/colbuf_384.py | 29 | ||||
-rw-r--r-- | icefuzz/tests/colbuf_384.sh | 35 | ||||
-rw-r--r-- | icefuzz/tests/colbuf_io_384.sh | 41 | ||||
-rw-r--r-- | icefuzz/tests/colbuf_logic_384.sh | 29 | ||||
-rw-r--r-- | icefuzz/tests/io_latched_384.sh | 31 | ||||
-rw-r--r-- | icefuzz/tests/ioctrl_384.py | 26 | ||||
-rw-r--r-- | icefuzz/tests/ioctrl_384.sh | 33 |
7 files changed, 224 insertions, 0 deletions
diff --git a/icefuzz/tests/colbuf_384.py b/icefuzz/tests/colbuf_384.py new file mode 100644 index 0000000..e9f5332 --- /dev/null +++ b/icefuzz/tests/colbuf_384.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 + +import fileinput + +colbuf_tile = None +glbnet_tile = None + +for line in fileinput.input(): + line = line.split() + if len(line) == 0: + continue + if line[0] in [".io_tile", ".logic_tile"]: + current_tile = (int(line[1]), int(line[2])) + if line[0] == "ColBufCtrl": + assert colbuf_tile is None + colbuf_tile = current_tile + if line[0] == "buffer" and line[1].startswith("glb_netwk_"): + assert glbnet_tile is None + glbnet_tile = current_tile + +if colbuf_tile is None: + if glbnet_tile is None: print("( ? , ? , ? , ? ),") + else: print("( ? , ? , %2d, %2d)," % (glbnet_tile[0], glbnet_tile[1])) +elif glbnet_tile is None: + if colbuf_tile is None: print("( ? , ? , ? , ? ),") + else: print("(%2d, %2d, ? , ? )," % (colbuf_tile[0], colbuf_tile[1])) +else: + print("(%2d, %2d, %2d, %2d)," % (colbuf_tile[0], colbuf_tile[1], glbnet_tile[0], glbnet_tile[1])) + diff --git a/icefuzz/tests/colbuf_384.sh b/icefuzz/tests/colbuf_384.sh new file mode 100644 index 0000000..4820f8f --- /dev/null +++ b/icefuzz/tests/colbuf_384.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +for f in colbuf_io_384.work/*.exp colbuf_logic_384.work/*.exp; do + echo $f >&2 + python3 colbuf_384.py $f +done | sort -u > colbuf_384.txt + +get_colbuf_data() +{ + tr -d '(,)' < colbuf_384.txt +} + +{ + echo "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"580\" width=\"460\">" + for x in {1..7}; do + echo "<line x1=\"$((10+x*30))\" y1=\"10\" x2=\"$((10+x*30))\" y2=\"$((10+18*30))\" style=\"stroke:rgb(0,0,0);stroke-width:3\" />" + done + for y in {1..9}; do + echo "<line x1=\"10\" y1=\"$((10+y*30))\" x2=\"$((10+14*30))\" y2=\"$((10+y*30))\" style=\"stroke:rgb(0,0,0);stroke-width:3\" />" + done + for x in {0..7}; do + echo "<text x=\"$((10+$x*30+7))\" y=\"$((10+18*30+15))\" fill=\"black\">$x</text>" + done + for y in {0..9}; do + echo "<text x=\"$((10+14*30+5))\" y=\"$((10+(17-y)*30+20))\" fill=\"black\">$y</text>" + done + while read x1 y1 x2 y2; do + echo "<line x1=\"$((10+x1*30+15))\" y1=\"$((10+(17-y1)*30+15))\" x2=\"$((10+x2*30+15))\" y2=\"$((10+(17-y2)*30+15))\" style=\"stroke:rgb(255,0,0);stroke-width:5\" />" + done < <( get_colbuf_data; ) + while read x1 y1 x2 y2; do + echo "<circle cx=\"$((10+x1*30+15))\" cy=\"$((10+(17-y1)*30+15))\" r=\"5\" fill=\"gray\" />" + done < <( get_colbuf_data; ) + echo "</svg>" +} > colbuf_384.svg + diff --git a/icefuzz/tests/colbuf_io_384.sh b/icefuzz/tests/colbuf_io_384.sh new file mode 100644 index 0000000..655afbb --- /dev/null +++ b/icefuzz/tests/colbuf_io_384.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +set -ex + +mkdir -p colbuf_io_384.work +cd colbuf_io_384.work + +glb_pins="B4 C4 D2 D6 D7 E2 F3 F4" + +pins=" + A1 A2 A3 A4 A5 A6 A7 + B1 B2 B3 B4 + C1 C2 C4 C5 C6 C7 + D1 D2 D3 D4 D6 D7 + E2 E6 E7 + F1 F2 F3 F4 F5 F6 F7 + G1 G3 G4 G6 +" +pins="$( echo $pins )" + +for pin in $pins; do + pf="colbuf_io_384_$pin" + gpin=$( echo $glb_pins | tr ' ' '\n' | grep -v $pin | sort -R | head -n1; ) + cat > ${pf}.v <<- EOT + module top (input clk, data, output pin); + SB_IO #( + .PIN_TYPE(6'b 0101_00) + ) pin_obuf ( + .PACKAGE_PIN(pin), + .OUTPUT_CLK(clk), + .D_OUT_0(data) + ); + endmodule + EOT + echo "set_io pin $pin" > ${pf}.pcf + echo "set_io clk $gpin" >> ${pf}.pcf + ICEDEV=lp384-cm49 bash ../../icecube.sh ${pf}.v > ${pf}.log 2>&1 + ../../../icebox/icebox_explain.py ${pf}.asc > ${pf}.exp + rm -rf ${pf}.tmp +done + diff --git a/icefuzz/tests/colbuf_logic_384.sh b/icefuzz/tests/colbuf_logic_384.sh new file mode 100644 index 0000000..2b455d5 --- /dev/null +++ b/icefuzz/tests/colbuf_logic_384.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -ex + +mkdir -p colbuf_logic_384.work +cd colbuf_logic_384.work + +glb_pins="B4 C4 D2 D6 D7 E2 F3 F4" + +for x in 1 2 3 4 5 6; do +for y in 1 2 3 4 5 6 7 8; do + pf="colbuf_logic_384_${x}_${y}" + gpin=$( echo $glb_pins | tr ' ' '\n' | sort -R | head -n1; ) + cat > ${pf}.v <<- EOT + module top (input c, d, output q); + SB_DFF dff ( + .C(c), + .D(d), + .Q(q) + ); + endmodule + EOT + echo "set_location dff $x $y 0" > ${pf}.pcf + echo "set_io c $gpin" >> ${pf}.pcf + ICEDEV=lp384-cm49 bash ../../icecube.sh ${pf}.v > ${pf}.log 2>&1 + ../../../icebox/icebox_explain.py ${pf}.asc > ${pf}.exp + rm -rf ${pf}.tmp +done; done + diff --git a/icefuzz/tests/io_latched_384.sh b/icefuzz/tests/io_latched_384.sh new file mode 100644 index 0000000..04ea00f --- /dev/null +++ b/icefuzz/tests/io_latched_384.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -ex + +mkdir -p io_latched_384.work +cd io_latched_384.work + +pins=" + A1 A2 A3 A4 A5 A6 A7 + B1 B2 B3 B4 + C1 C2 C4 C5 C6 C7 + D1 D2 D3 D4 D6 D7 + E2 E6 E7 + F1 F2 F3 F4 F5 F6 F7 + G1 G3 G4 G6 +" +pins="$( echo $pins )" + +for pin in $pins; do + pf="io_latched_384_$pin" + cp ../io_latched.v ${pf}.v + read pin_latch pin_data < <( echo $pins | tr ' ' '\n' | grep -v $pin | sort -R; ) + { + echo "set_io pin $pin" + echo "set_io latch_in $pin_latch" + echo "set_io data_out $pin_data" + } > ${pf}.pcf + ICEDEV=lp384-cm49 bash ../../icecube.sh ${pf}.v + ../../../icebox/icebox_vlog.py -SP ${pf}.psb ${pf}.asc > ${pf}.ve +done + diff --git a/icefuzz/tests/ioctrl_384.py b/icefuzz/tests/ioctrl_384.py new file mode 100644 index 0000000..ec8ddb8 --- /dev/null +++ b/icefuzz/tests/ioctrl_384.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +import fileinput + +ren = None + +for line in fileinput.input(): + line = line.split() + if len(line) == 0: + continue + if line[0] == ".io_tile": + current_tile = (int(line[1]), int(line[2])) + if line[0] == "IoCtrl" and line[1] == "REN_0": + ren = (current_tile[0], current_tile[1], 0) + if line[0] == "IoCtrl" and line[1] == "REN_1": + ren = (current_tile[0], current_tile[1], 1) + if line[0] == "IOB_0": + iob = (current_tile[0], current_tile[1], 0) + if line[0] == "IOB_1": + iob = (current_tile[0], current_tile[1], 1) + +if ren is None: + print("(%2d, %2d, %2d, ? , ? , ? )," % (iob[0], iob[1], iob[2])) +else: + print("(%2d, %2d, %2d, %2d, %2d, %2d)," % (iob[0], iob[1], iob[2], ren[0], ren[1], ren[2])) + diff --git a/icefuzz/tests/ioctrl_384.sh b/icefuzz/tests/ioctrl_384.sh new file mode 100644 index 0000000..b75b864 --- /dev/null +++ b/icefuzz/tests/ioctrl_384.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -ex + +mkdir -p ioctrl_384.work +cd ioctrl_384.work + +pins=" + A1 A2 A3 A4 A5 A6 A7 + B1 B2 B3 B4 + C1 C2 C4 C5 C6 C7 + D1 D2 D3 D4 D6 D7 + E2 E6 E7 + F1 F2 F3 F4 F5 F6 F7 + G1 G3 G4 G6 +" +pins="$( echo $pins )" + +for pin in $pins; do + pf="ioctrl_384_$pin" + echo "module top (output pin); assign pin = 1; endmodule" > ${pf}.v + echo "set_io pin $pin" > ${pf}.pcf + ICEDEV=lp384-cm49 bash ../../icecube.sh ${pf}.v > ${pf}.log 2>&1 + ../../../icebox/icebox_explain.py ${pf}.asc > ${pf}.exp +done + +set +x +echo "--snip--" +for pin in $pins; do + python3 ../ioctrl_384.py ioctrl_384_${pin}.exp +done | tee ioctrl_384_db.txt +echo "--snap--" + |