summaryrefslogtreecommitdiffstats
path: root/electronics
diff options
context:
space:
mode:
authorbryan newbold <bnewbold@twinleaf.com>2014-05-20 12:34:03 -0400
committerbryan newbold <bnewbold@twinleaf.com>2014-05-20 12:34:03 -0400
commitbda2da978ae03222ae594fc464b66b32e286681c (patch)
tree24dd71888f3f742a1834155c37eee1b7971e02ef /electronics
parent94da3402d391240e8d744ab08bc1e9af364d45cb (diff)
downloadknowledge-bda2da978ae03222ae594fc464b66b32e286681c.tar.gz
knowledge-bda2da978ae03222ae594fc464b66b32e286681c.zip
lattice dev setup for debian; ee tools cleanup
Diffstat (limited to 'electronics')
-rw-r--r--electronics/fpga-toolchain.page97
-rw-r--r--electronics/simulation.page25
2 files changed, 122 insertions, 0 deletions
diff --git a/electronics/fpga-toolchain.page b/electronics/fpga-toolchain.page
index 37ff174..010e88a 100644
--- a/electronics/fpga-toolchain.page
+++ b/electronics/fpga-toolchain.page
@@ -35,3 +35,100 @@ home folder.
To start the IDE run `/opt/Xilinx/13.3/ISE_DS/ISE/bin/lin64/ise` (set it up as
an alias or with a wrapper script).
+Lattice Diamond 3.1 on Debian Linux 64-bit
+--------------------------------------------
+
+Lattice Semi offers no-cost software development tools for their FPGA parts,
+called Lattice Diamond. The toolchain is based on Synopsys Synplify Pro for
+synthesis and Aldec Active-HDL for simulation, and runs on Linux. The
+non-supscription version of the toolchain can target most parts, but not some
+of the LatticeECP2 product line, any LatticeECP3 parts, or the
+LatticeSC/LatticeSCM devices.
+
+First you need to register for an account to get a no-cost license, and agree
+to a EULA. Doves cry. Generate a free license following a link from the
+"Licensing" tab of the Diamond Software page. You won't get the license
+immediately, it will be emailed to you (after human approval?). It's a 1.2 GB
+download, which is way smaller than Xilinx ISE. The below was tested with
+version 3.1 for 64 bit linux.
+
+The IDE comes as an .rpm file for Fedora/RedHat. To install on debian/ubuntu,
+the 'alien' tool can be used to convert this to a .deb. This process can take a
+long time (20+ minutes?), particularly at the "debian/rules binary" step. Run::
+
+ sudo alien --to-deb --scripts diamond_3_1-base_x64-96-x86_64-linux.rpm
+
+Unfortunately, this won't install as-is because the package will try to use
+``uname i`` to determine the architecture type, when it probably should use
+``uname -p`` (at least on linux/debian)[0]. So we need to extract, edit, and
+re-build the .deb:
+
+ # extract
+ chown $USER:$USER diamond-3-1-base-x64_3.1-97_amd64.deb
+ dpkg-deb -x diamond-3-1-base-x64_3.1-97_amd64.deb diamond
+ dpkg-deb --control diamond-3-1-base-x64_3.1-97_amd64.deb diamond/DEBIAN
+
+ # edit: `uname -i` => `uname -m`
+ $EDITOR diamond/DEBIAN/preinst
+
+ # rebuild: this is slow
+ dpkg -b diamond .
+
+Then (finally) install the package:
+
+ sudo dpkg -i diamond-3-1-base-x64_3.1-97_amd64.deb
+
+You'll need to add the following to your $PATH (or could have edited the
+install prefix above):
+
+ /usr/local/diamond/3.1_x64/bin/lin64
+
+Also install the license file which was emailed to you:
+
+ sudo cp license.dat /usr/local/diamond/3.1_x64/license
+
+Then run ''diamond''.
+
+Ref: http://effluviaofascatteredmind.blogspot.com/2010/10/lattice-diamond-on-ubuntu-1004-64-bit.html
+[0] https://lists.debian.org/debian-user/2013/05/msg01416.html
+
+Diamond Programmer
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+The programmer (for uploading bitfiles, eg via an FTDI chip on a breakout
+board or a JTAG cable) breaks if the ftdi_sio (FTDI USB-Serial) kernel module
+loaded for the bare USB device. This driver will automatically load on most
+linux platforms (which is normally the desired behavior), but we need to
+disable this to use the Lattice programmer. It's possible to disable the
+ftdi_sio driver system-wide using a blacklist entry in /etc/modprobe.d, but
+then no other FTDI-based devices (which are extremely common) will work. So
+instead we'll use a udev rule to match only on Lattice "upload cables".
+
+Setup:
+
+ sudo vim /etc/udev/rules.d/10-lattice-diamond
+
+ # Disable "ftdi_sio" driver for Lattice dev boards
+ SUBSYSTEM=="usb",DRIVER=="ftdi_sio",ATTRS{interface}=="Lattice FTUSB Interface Cable",ATTRS{bInterfaceNumber}=="00",RUN+="/bin/sh -c 'basename %p > /sys/bus/usb/drivers/ftdi_sio/unbind'"
+
+ sudo /etc/init.d/udev restart
+
+Then you can load the GUI:
+
+ sudo /usr/local/diamond/3.1_x64/bin/lin64/programmer
+
+or via command line, if you already have a .xcf upload configuration file
+generated (NB: this is distinct from the .jed bitfiles which actually get
+uploaded, and can be created with the programmer GUI):
+
+ sudo /usr/local/diamond/3.1_x64/bin/lin64/pgrcmd -infile program_breakout_example.xcf -cabletype USB2
+
+Troubleshooting:
+
+- only the programmer can be open; otherwise the IDE latches on?
+- better way is DIY with a script or using udev rules
+- udevadm test /dev/bus/usb/###/###
+- programming might not work ever?
+- bundled ftdi errors ("[122032.033366] pgrcmain[10879]: segfault at 50 ip 00007f4cf1508b5e sp 00007fffb86dc210 error 4 in libftd2xx.so[7f4cf14fe000+2c000]")
+- "Another instance of this program is running":
+
diff --git a/electronics/simulation.page b/electronics/simulation.page
new file mode 100644
index 0000000..52dcfb3
--- /dev/null
+++ b/electronics/simulation.page
@@ -0,0 +1,25 @@
+
+QUCS
+--------
+
+QUCS is alright. It does verilog-a, I think it can load SPICE files, has a
+decent parts library, enables parametric plotting of circuit parameters, can do
+basic transmission line and PCB layout simulations, etc. I found "A Qucs
+Tutorial for RF" helpful for getting started; the default tutorial is also
+good.
+
+On debian wheezy, install the following (some are probably not necessary, like
+cmake):
+
+ sudo aptitude install libxml-libxml-perl libgd-gd2-perl zlib1g zlib1g-dev libgd2-xpm-dev libxml2 libxml2-dev libxml-perl libqt4-dev libqt4-qt3support automake libtool gperf flex bison cmake
+
+Then follow the build directions at
+https://github.com/Qucs/qucs/wiki/Build-Linux. You don't need to set the
+``--prefix``, but you do need ``--enable-maintainer-mode``. You probably want
+to ``make -j8`` to build faster.
+
+Within QUCS, one "gotcha" is that simulating only creates a simulation engine
+and dataset; you then need to go to (or create) a data pane (seperate sheet
+from the circuit schematic) to visualize the results.
+
+