aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/notes_osx.md39
-rw-r--r--examples/hx8kboard/Makefile28
-rw-r--r--examples/hx8kboard/example.v2
-rw-r--r--examples/icestick/Makefile28
-rw-r--r--examples/icestick/example.v2
-rw-r--r--icebox/icebox.py69
-rw-r--r--icefuzz/icecube.sh14
-rw-r--r--icefuzz/pinloc/pinloc-1k-qn84.sh34
8 files changed, 191 insertions, 25 deletions
diff --git a/docs/notes_osx.md b/docs/notes_osx.md
new file mode 100644
index 0000000..6b542d6
--- /dev/null
+++ b/docs/notes_osx.md
@@ -0,0 +1,39 @@
+# OSX Install
+The toolchain should be easy to install on OSX platforms. Below are a few troubleshooting items found on Mountain Lion (10.8.2).
+
+## installing ftdi library
+- libftdi (allows you to have .so lib binary and the ftdi.h header)
+libftdi has been renamed to libftdi0, so either do:
+
+`port install libftdi0` (note that ports installs the tool to /opt instead of /usr, see next note)
+
+`brew install libftdi0`
+
+## iceprog make error on "ftdi.h not found"
+Note that Mac Ports installs to /opt instead of /usr, so change the makefile's first two lines to:
+
+` LDLIBS = -L/usr/local/lib -L/opt/local/lib -lftdi -lm`
+
+` CFLAGS = -MD -O0 -ggdb -Wall -std=c99 -I/usr/local/include -I/opt/local/include/`
+
+Basically you are indicating where to find the lib with -L/opt/local/lib and where to find the .h with -I/opt/local/include/
+
+## yosis make error on "<tuple> not found"
+This is a compiler issue, i.e., you are probably running on clang and you can circumvent this error by compiling against another compiler.
+Edit the Makefile of yosis and replace the two first lines for this, i.e., comment the first line (clang) and uncomment the second (gcc):
+
+`#CONFIG := clang`
+
+` CONFIG := gcc`
+
+## error "Can't find iCE FTDI USB device (vedor_id 0x0403, device_id 0x6010)." while uploading code to FPGA (e.g., `iceprog example.bin`)
+You need to unload the FTDI driver. (notes below are from Mountain Lion, 10.8.2).
+First check if it is running: `kextstat | grep FTDIUSBSerialDriver`
+
+If you see if on the kextstat, we need to unload it: `sudo kextunload -b com.FTDI.driver.FTDIUSBSerialDriver`
+
+Repeat the kextstat command and check that the driver was successfully unloaded.
+
+Repeat your `iceprog example.bin`
+
+Note: On newer OSes perhaps you need to also kextunload the `com.apple.driver.AppleUSBFTDI`
diff --git a/examples/hx8kboard/Makefile b/examples/hx8kboard/Makefile
index 551de32..e9fd789 100644
--- a/examples/hx8kboard/Makefile
+++ b/examples/hx8kboard/Makefile
@@ -1,18 +1,26 @@
-all: example.bin
+PROJ = example
+PIN_DEF = hx8kboard.pcf
+DEVICE = 8k
-example.blif: example.v
- yosys -p 'synth_ice40 -top top -blif example.blif' example.v
+all: $(PROJ).bin
-example.txt: example.blif hx8kboard.pcf
- arachne-pnr -d 8k -o example.txt -p hx8kboard.pcf example.blif
+%.blif: %.v
+ yosys -p 'synth_ice40 -top top -blif $@' $<
-example.bin: example.txt
- icepack example.txt example.bin
+%.txt: $(PIN_DEF) %.blif
+ arachne-pnr -d $(DEVICE) -o $@ -p $^
-prog:
- iceprog example.bin
+%.bin: %.txt
+ icepack $< $@
+
+prog: $(PROJ).bin
+ iceprog $<
+
+sudo-prog: $(PROJ).bin
+ @echo 'Executing prog as root!!!'
+ sudo iceprog $<
clean:
- rm -f example.blif example.txt example.bin
+ rm -f $(PROJ).blif $(PROJ).txt $(PROJ).bin
.PHONY: all prog clean
diff --git a/examples/hx8kboard/example.v b/examples/hx8kboard/example.v
index 9fc5a11..accbc2e 100644
--- a/examples/hx8kboard/example.v
+++ b/examples/hx8kboard/example.v
@@ -20,6 +20,6 @@ module top (
counter <= counter + 1;
outcnt <= counter >> LOG2DELAY;
end
-
+
assign {LED0, LED1, LED2, LED3, LED4, LED5, LED6, LED7} = outcnt ^ (outcnt >> 1);
endmodule
diff --git a/examples/icestick/Makefile b/examples/icestick/Makefile
index 295642a..eaed6f7 100644
--- a/examples/icestick/Makefile
+++ b/examples/icestick/Makefile
@@ -1,18 +1,26 @@
-all: example.bin
+PROJ = example
+PIN_DEF = icestick.pcf
+DEVICE = 1k
-example.blif: example.v
- yosys -p 'synth_ice40 -top top -blif example.blif' example.v
+all: $(PROJ).bin
-example.txt: example.blif icestick.pcf
- arachne-pnr -d 1k -o example.txt -p icestick.pcf example.blif
+%.blif: %.v
+ yosys -p 'synth_ice40 -top top -blif $@' $<
-example.bin: example.txt
- icepack example.txt example.bin
+%.txt: $(PIN_DEF) %.blif
+ arachne-pnr -d $(DEVICE) -o $@ -p $^
-prog:
- iceprog example.bin
+%.bin: %.txt
+ icepack $< $@
+
+prog: $(PROJ).bin
+ iceprog $<
+
+sudo-prog: $(PROJ).bin
+ @echo 'Executing prog as root!!!'
+ iceprog $<
clean:
- rm -f example.blif example.txt example.bin
+ rm -f $(PROJ).blif $(PROJ).txt $(PROJ).bin
.PHONY: all prog clean
diff --git a/examples/icestick/example.v b/examples/icestick/example.v
index cb7cfcd..a934400 100644
--- a/examples/icestick/example.v
+++ b/examples/icestick/example.v
@@ -17,6 +17,6 @@ module top (
counter <= counter + 1;
outcnt <= counter >> LOG2DELAY;
end
-
+
assign {LED1, LED2, LED3, LED4, LED5} = outcnt ^ (outcnt >> 1);
endmodule
diff --git a/icebox/icebox.py b/icebox/icebox.py
index 398bfe8..b7f96d2 100644
--- a/icebox/icebox.py
+++ b/icebox/icebox.py
@@ -1866,6 +1866,75 @@ pinloc_db = {
( "99", 2, 17, 1),
("100", 1, 17, 1),
],
+ "1k-qn84": [
+ ( "A1", 0, 14, 0),
+ ("A10", 0, 5, 1),
+ ("A11", 0, 4, 0),
+ ("A12", 0, 2, 0),
+ ("A13", 4, 0, 0),
+ ("A14", 6, 0, 1),
+ ("A16", 6, 0, 0),
+ ("A19", 9, 0, 1),
+ ( "A2", 0, 13, 0),
+ ("A20", 10, 0, 1),
+ ("A22", 11, 0, 1),
+ ("A23", 12, 0, 0),
+ ("A25", 13, 4, 0),
+ ("A26", 13, 6, 0),
+ ("A27", 13, 7, 1),
+ ("A29", 13, 8, 1),
+ ( "A3", 0, 12, 0),
+ ("A31", 13, 11, 1),
+ ("A32", 13, 12, 1),
+ ("A33", 13, 13, 1),
+ ("A34", 13, 14, 0),
+ ("A35", 13, 15, 0),
+ ("A38", 11, 17, 0),
+ ("A39", 10, 17, 0),
+ ( "A4", 0, 11, 0),
+ ("A40", 9, 17, 0),
+ ("A41", 8, 17, 0),
+ ("A43", 7, 17, 0),
+ ("A44", 6, 17, 0),
+ ("A45", 5, 17, 0),
+ ("A46", 4, 17, 0),
+ ("A47", 3, 17, 0),
+ ("A48", 1, 17, 1),
+ ( "A5", 0, 10, 0),
+ ( "A8", 0, 9, 0),
+ ( "A9", 0, 8, 1),
+ ( "B1", 0, 13, 1),
+ ("B10", 5, 0, 0),
+ ("B11", 5, 0, 1),
+ ("B12", 7, 0, 0),
+ ("B13", 8, 0, 0),
+ ("B14", 9, 0, 0),
+ ("B15", 10, 0, 0),
+ ("B17", 11, 0, 0),
+ ("B18", 12, 0, 1),
+ ("B19", 13, 3, 1),
+ ( "B2", 0, 12, 1),
+ ("B20", 13, 6, 1),
+ ("B21", 13, 7, 0),
+ ("B22", 13, 9, 0),
+ ("B23", 13, 11, 0),
+ ("B24", 13, 12, 0),
+ ("B26", 13, 14, 1),
+ ("B27", 13, 15, 1),
+ ("B29", 10, 17, 1),
+ ( "B3", 0, 11, 1),
+ ("B30", 9, 17, 1),
+ ("B31", 8, 17, 1),
+ ("B32", 6, 17, 1),
+ ("B34", 4, 17, 1),
+ ("B35", 3, 17, 1),
+ ("B36", 2, 17, 1),
+ ( "B4", 0, 10, 1),
+ ( "B5", 0, 9, 1),
+ ( "B7", 0, 8, 0),
+ ( "B8", 0, 5, 0),
+ ( "B9", 0, 3, 0),
+ ],
"8k-ct256": [
( "A1", 4, 33, 1),
("A10", 22, 33, 1),
diff --git a/icefuzz/icecube.sh b/icefuzz/icecube.sh
index f3dabc6..55fb9bc 100644
--- a/icefuzz/icecube.sh
+++ b/icefuzz/icecube.sh
@@ -1,8 +1,8 @@
#!/bin/bash
#
# Installing iCEcube2:
-# - Install iCEcube2.2014.08 in /opt/lscc/iCEcube2.2014.08
-# - Install License in /opt/lscc/iCEcube2.2014.08/license.dat
+# - Install iCEcube2.2014.08 in /opt/lscc/iCEcube2.2015.08
+# - Install License in /opt/lscc/iCEcube2.2015.08/license.dat
#
# Creating a project:
# - <project_name>.v ## HDL sources (use "top" as name for the top module)
@@ -33,7 +33,7 @@ if [ -z "$scriptdir" ]; then scriptdir="."; fi
set -ex
set -- ${1%.v}
-icecubedir="${ICECUBEDIR:-/opt/lscc/iCEcube2.2014.08}"
+icecubedir="${ICECUBEDIR:-/opt/lscc/iCEcube2.2015.08}"
export SBT_DIR="$icecubedir/sbt_backend"
export SYNPLIFY_PATH="$icecubedir/synpbase"
export LM_LICENSE_FILE="$icecubedir/license.dat"
@@ -68,6 +68,10 @@ case "${ICEDEV:-hx1k-tq144}" in
iCEPACKAGE="CB132"
iCE40DEV="iCE40HX8K"
;;
+ lp1k-qn84)
+ iCEPACKAGE="QN84"
+ iCE40DEV="iCE40LP1K"
+ ;;
*)
echo "ERROR: Invalid \$ICEDEV device config '$ICEDEV'."
exit 1
@@ -82,6 +86,10 @@ case "$iCE40DEV" in
libfile="ice40HX8K.lib"
devfile="ICE40P08.dev"
;;
+ iCE40LP1K)
+ libfile="ice40LP1K.lib"
+ devfile="ICE40P01.dev"
+ ;;
esac
(
diff --git a/icefuzz/pinloc/pinloc-1k-qn84.sh b/icefuzz/pinloc/pinloc-1k-qn84.sh
new file mode 100644
index 0000000..e46743c
--- /dev/null
+++ b/icefuzz/pinloc/pinloc-1k-qn84.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+pins="
+ A1 B1 A2 B2 A3 B3 A4 B4 A5 B5 A8 A9 B7 A10 B8 A11 B9 A12
+ A13 B10 B11 A14 B12 A16 B13 B14 A19 B15 A20 B17 A22 A23 B18 B19 A25 A26
+ B20 B21 A27 A29 B22 B23 A31 B24 A32 A33 A34 B26 A35 B27 A38 B29 A39 B30
+ A40 B31 A41 A43 B32 A44 A45 B34 A46 B35 A47 B36 A48
+
+"
+
+{
+ echo -n "all:"
+ for pin in $pins; do
+ id="pinloc-1k-qn84_${pin}"
+ echo -n " ${id}.exp"
+ done
+ echo
+
+ for pin in $pins; do
+ id="pinloc-1k-qn84_${pin}"
+ echo "module top(output y); assign y = 0; endmodule" > ${id}.v
+ echo "set_io y ${pin}" >> ${id}.pcf
+ echo; echo "${id}.exp:"
+ echo " ICEDEV=lp1k-qn84 bash ../icecube.sh ${id} > ${id}.log 2>&1"
+ echo " ../../icebox/icebox_explain.py ${id}.txt > ${id}.exp.new"
+ echo " rm -rf ${id}.tmp"
+ echo " mv ${id}.exp.new ${id}.exp"
+ done
+} > pinloc-1k-qn84.mk
+
+set -ex
+make -f pinloc-1k-qn84.mk -j4
+python3 pinlocdb.py pinloc-1k-qn84_*.exp > pinloc-1k-qn84.txt
+