The Quickening

Why is an opensource HDL toolchain like IceStorm combined with low cost  FPGA kits important for opensource hardware and the community?

Modern digital electronics is hard, not just because of the mixed disciplines of engineering and computer science, rather it is the physical nature of the components, PCBs, assembly and testing. Manipulating atoms in the real world is totally unlike manipulating bits in the virtual world. PCBs have to be laid out and designed using CAD tools, boards have to be ordered and manufactured, components chosen and purchased, then we have to wait for them to be delivered before we can solder and assemble them ready for basic testing, inevitably we then repeat this cycle fixing any issues we discover. It is a time consuming and costly process that has many side effects in terms of design and production costs not to mention time to market for any product idea, it is anything other than agile…

Therefore anything that can be done to improve this situation is likely to result in great dividends for the engineers working on a project and likely improve turn around time as well as time to market for ideas. Compounding this, electronics tooling mostly produces monolithic design media and CAD files making it very difficult to manage in a modern fashion. The process lacks modularity, reuse and resists parallel design team strategies. Contrast this with software development with its flexible libraries, modular coding and distributed version control allowing geographically independent concurrent development. It is not hard to see why electronics design appears as if in slow motion compared to it’s agile algorithmic cousins in software development. This modern flexibility is what has helped to power the Arduino and Raspberry Pi communities, what if we could take this further, much further and see how deep this rabbit hole really goes…

The challenge

With FPGA chips we have a near blank slate on which to paint and compose our digital electronic designs and we can do so not using atoms but by using bits instead, this is incredibly powerful, it is to  electronics as the PC was to software. More importantly we are not confined to our restrictive CAD tooling during the design process, rather we have HDL languages which offers us many of the advantages software engineers have taken for granted over the last few decades. So what are these advantages and why are they important in opensource practices and communities?

The solution 

Anyone having developed even the simplest software whether a basic assembly routine, a simple C file or a large web based application will be familiar with the power of modular programming languages, build text files, compilers and linkers. Opensource compilers, linkers and libraries like GCC and binutils have democratised software development and have provided concrete foundations on which impressive opensource projects such as Linux, Apache and Firefox have been built. GCC , supporting tools and libraries have singularly changed the game, combined with low cost PCs and servers, they enabled an opensource revolution. Opensource tools wrapped around modern software development practices like agile with distributed version control , testing and continuous build have enabled software to literally takeover the world! Breakthrough tools like compilers and libraries therefore are the key enablers for opensource community development, proliferation and exponential growth, with GCC, git, bin utils you can change the world.

The Quickening 

Enter stage right ‘IceStorm‘ supporting a Verilog design chain to describe hardware, synthesis and simulation. That is, one can describe the electronics design in a modular fashion using simple text files composed using algorithmic language and build files. This allows significantly more complex designs to be rendered and tested in a fraction of the time of the torturous CAD design cycle. Right now opensource hardware is experiencing it’s GCC moment in the form of Yosys and supporting tools in IceStorm. These are the means and facilitation that will now impart their power and agility within the opensource hardware community development, allowing us to build radically different types of projects combining Verilog with FPGA chips upon the new low cost development boards of our new PC like canvas. This breakthrough  combination allows agility, modularisation and co-operation, allowing divide and conquer strategies that opensource communities excel at, quite naturally, It will also encourage the traditional opensource practice of standing on the shoulders of giants by using sharing and openness, this is then ‘The Quickening’ for opensource hardware and community, the beginning of it’s true exponential growth.

 

A Perfect Storm

My partner in crime working on myStorm – Ken Boak (@monsonite) has written a guest post about myStorm from his perspective, it’s much less hand wavy than mine, focusing in on the real features, enjoy..

myStorm is the perfect combination of a $5 Raspberry Pi Zero, a $1, 32-bit ARM microcontroller and a $5 versatile low power FPGA – an open hardware platform –  brought to life with innovative open source software.

As a low cost development platform for digital devices based on FPGA and ARM technology, myStorm aims to achieve a price point, previously unavailable in FPGA boards.
Aimed at Engineers, Hobbyists and Students of Electronics and Computing Science, myStorm offers a versatile FPGA platform that can be used as a system building block within physical computing devices.

The Story Begins…

I had been wanting to create an FPGA board for some time – especially now since Clifford Wolf’s open source ICE Storm toolset has become available.

The opportunity presented itself a couple of months ago, when following a discussion with fellow embedded hardware engineer,  Alan Wood (@folknology on Twitter) who came up with the concept and philosophy,  over a post-OSHUG beer, we decided that we would produce a small FPGA board using the Lattice ICE40HX4K part.

This dev-board will be needed for a forthcoming FPGA workshop to be held in early September at OSHCamp – held in Hebden Bridge, near Halifax, Yorkshire.

We wanted a “no-nonsense” FPGA development board that would encourage open source hardware enthusiasts to take their first steps with low cost FPGAs and verilog or VHDL. The emphasis would be in producing a low cost board that provided the greatest versatility and connectivity possible – and would form a useful platform that was cheap enough to be built into other projects.  So we aimed to hit the $30 price point – which is the sweet spot for open hardware designs.

Make it So….

The board had to be 2 layer, fit the size constraints of EagleCAD Lite, and use components that could, if necessary, be soldered at home – by those DIY’ers experienced with Surface Mount parts. For this reason we chose a 144 pin LQFP package for the FPGA rather than a BGA – as BGAs are neither very friendly for 2 layer pcb layout, nor for soldering.

Alan did the preliminary system design, whilst I looked at finding an efficient means of routing the on board SRAM to the FPGA for minimum signal skew. The solution was to put the SRAM on the underside of the pcb – directly beneath the FPGA package.

After several Saturday lunctime pub-meetups we settled on an overall design, with which we have played ping-pong on GitLab for the last week or so, slowly refining the layout between us – but is now ready to go for prototype pcb manufacturing.

myStorm

Low Cost – Achieving a price-point breakthrough!

Seldom do you get much of an FPGA board for under $50 – with the $22 Lattice ICE Stick setting the current lower limit.

But the ICEStick is limited by the HX1K part, and very little accessible I/O.

Like a lot of FPGA boards, it also uses the FT2232 USB to serial bridge to provide programming and communications, but this IC costs around $5, to me has always seemed a rather expensive solution. Something would have to be done to eliminate the FT2232.

Alan had the brilliant idea of using an inexpensive ARM microcontroller to provide the FPGA support role – acting both as the programmer, the store for the bitfile in it’s Flash and as a versatile GPIO slave processor.

We believe that with this approach we achieve a board selling price of $30 (£23) which will provide a highly versatile FPGA platform that is cheap enough to be embedded into other projects – it’s the “Arduino” of FPGA’s.

Raspberry Pi Zero

The Raspberry Pi Zero – which hosts all of the FPGA  and ARM development tools, provides an integrated design environment for FPGA and ARM  –  at a novel concept in hardware hacking projects.

The Pi Zero is used to host the Project Ice Storm tool chain, and if fitted via the 40 pin connector on the left to the myStorm board provides a complete integrated FPGA development system.

In addition to being used as a host system, the Pi Zero has full access to the FPGA via a bidirectional 8 bit bus. The FPGA can if required act as the complete I/O sub-system to the Raspberry Pi. This allows the myStorm board to be used in sophisticated projects, for example digital instrumentation, digital storage oscilloscopes, logic analysers, protocol analysers, waveform synthesis, graphics generators etc etc.

It is unlikely that this level of advanced system “building block” has been previously achievable to the hobbyist for around the $35 price-point.  (The Raspberry Pi Zero is supplied by the user for $5)

Connectivity

Connectivity is a key feature, and so the board uses some old familiar friends – including Arduino “Shield” headers to provide access to a rich mix of GPIO.  The GPIO and ADC lines connect directly to the ARM microcontroller, and the digital pins are 5V tolerant.

The ADC pins provide up to 6 channels of 12 bit ADC.  In some projects the STM32 will act mainly as an I/O slave, and for this it can be programmed using the STM32-Duino variant of the Arduino IDE or using mbed – where it can appear as a Nucleo 103.

The Arduino Shield connectors have a further 6 pins available on the “power” connector. These are connected to the STM32 pins but additionally via link resistors to 4 of the FPGA pins. These may be used where you need only a few lines of direct connection to the FPGA.

For small projects, the “Arduino” headers will accept a variety of shields or proto-boards, including the 50mm x 50mm sub-shields that I have developed over the last year.

Whilst many existing FPGA boards tend to be loaded with other hardware – such as LED digits, switches, VGA connectors and audio – we have chosen not to put these on board, but allow them to be added externally.

Our connectors have been placed as far as practically possible on an 0.1″ grid spacing. This allows a 75mm x 75mm “super-shield” to be placed on top – accessing the majority of the I/O lines.

The  industry standard connector for FPGA dev-boards is the PMOD connector – devised by Digilent – so our board has up to 13 of these available, either in the 6-pin single row PMOD, or double PMOD version.

Another recent ICE40 FPGA board by Olimex has defined a connector for low voltage differential signalling LVDS – and so this 34 pin connector can be added as an alternative to the PMODS on the right hand edge of the board.

Finally, for a bit of fun, we have also included a connector to directly drive 32 x 32 RGB LED panels. These are now available cheaply from several sources – and provide a very graphical way of seeing the output from the FPGA.

On Board ARM Microcontroller

As you can see from the pcb layout, we have included a microcontroller, to the left of the FPGA.

This is the popular STM32F103 part – an ARM Cortex M3, which gives the board a lot of its versatility and GPIO & peripherals by providing 12-bit ADC channels and communications interfaces – including USB, UART, SPI and I2C.as well as providing a large flash array, into which a bitfile for programming the FPGA will be stored.

The STM32 is linked to the FPGA by an 8 bit wide bidirectional data bus, complete with handshaking lines.

The Lattice ICE40 series FPGA with a large SRAM attached, connected to an ARM M3/M4 Cortex microcontroller provides the ideal platform for developing soft core cpu designs.

The STM32 can be programmed using STM32Duino – a variant of the Arduino programming IDE.

Other Features

Taking our inspiration from IceStick and the Olimex boards – they both use an ICE40 HX1K part which is about $1 cheaper, but we felt that this might ultimately prove to be a bit too small for hobbyist projects – so we opted for the HX4K part.

We have also made provision on the underside of the pcb for a 16-bit wide fast (10ns) SRAM. Olimex use a 256K x 16 SRAM, and we have stretched this out with an extra address line to allow for 512K x 16 SRAMs.

Some of the design features – summarised:

  • Open Source Hardware and Software
  • Low cost – suit even the smallest budget – about $30
  • Compact 75 x 75mm – but with a useful range of connectivity signals available
  • Lattice iCE40HX4K  – 144pin LQFP package with up to 52 I/O lines  – arranged on industry standard PMOD ports
  • PMOD and double PMOD connectors on 0.1″ grid spacing for easy interfacing
  • Arduino compatible shield headers – giving 5V tolerant GPIO, 12 bit ADC and peripherals
  • An onboard ARM M3 for handling USB comms, GPIO and ADC channels and FPGA loading
  • FPGA provided in an LQFP package – for easier layout and possibility of home assembly
  • A fast 64K x 16 SRAM (512K x 16 maximum) – allows soft core cpu system
  • Standard Pi 40 pin (2 x 20) GPIO header – allows easy attachment of Pi-Zero for programming and development – either using a cable or direct header connection to Raspberry Pi or Pi Zero
  • A connector to directly drive 32 x 32 RGB LED panels
  • The ARM Cortex M3 (M4) holds the bit-file for the FPGA in flash, and uploads it to the FPGA on power-up.
  • Pi Zero 8-bit Host Port  – an 8 bit bidirectional bus for high speed (up to 400Mbit/s) data transfers between the FPGA, the ARM Cortex M3 and the Pi.
  • 3rd party development open source software – eg  ICE Studio graphical design environment.
  • ARM M3/M4 Cortex provides a USB interface to a PC, plus the following I/O and peripherals:
    • 72MHz/120MHz  64 pin ARM Cortex M3/M4 processor:
    • Arduino compatible with STM32-Duino extension
    • 256Kbytes Flash
    • 32Kbytes SRAM
    • Up to 37 GPIO lines with 5V tolerance  (20 digital I/O available on Arduino style headers)
    • Up to 10 ADC inputs with 12bit 1MHz (2 ADCs)
    • Three 16-bit differential input SD-ADCs (optional – with STM32F373 mcu)
    • 3 UARTS
    • 2 SPI
    • 2 I2C
    • Many 16/32 bitTimers

Part 2 looks at the task of achieving the $30 price breakthrough

A new palette

Sometimes events and energy come together creating perfect storms, the passing of these cyclones freshens the canvas on which we can paint, the looms on which we weave and the palettes from which we draw our inspiration.

The core technology in this perfect storm I am referring to is not new, Hardware Description Languages (HDL) have been with use for many decades, as have the FPGA chips on which one carves out our designs using these tools. The current crop of these proprietary FGPA chips, languages and tools however, have not been anywhere close to accessible as opensource based micro-controllers and their opensource C toolchains  over the last few decades. The combination of the latter is epitomised by the Arduino movement making the micro-controller accessible in ways that proprietary vendors could never have imagined. The combination of GCC, AVRDude  and low cost AVR dev boards like Arduino brought the whole toolbox together creating a popular opensource platform and community we have all become familiar with. I believe that a key HDL tool chain and low cost hardware targets are coalescing right now within the opensource HDL/FPGA community, based around IceStorm;  Yosys, Arachne-pnr and low cost Lattice ICE40 chips representing perhaps watershed moment for opensource hardware. The similarity of the two movements has not been lost on the opensource hardware community and we are already seeing development boards and kits emerging based around the lattice ICE40 hardware running with IceStorm opensource Verilog tool chain. This new software and hardware alchemy offers us an exciting new palette with which to paint, entirely new landscapes with fresh new choices for opensource hardware delivery.

It really is an exciting time and a gear change for opensource hardware, entirely new capabilities are now available to us in the community and for me personally it is perfect  timing. As a result of this I had been working on a development board for my own personal use, conveniently after my FPGA Talk at OSHUG I got together with my good friend Ken Boak and we decided to scratch both of our itches with a joint FPGA development board design nick named ‘MyStorm’. We are working to get the first boards out in time for  the FPGA workshop at OSHCAMP 2016, part of the Wuthering Bytes festival at Hebden Bridge in September.

Today I can offer a sneak peak of MyStorm having just finished routing the board which has been tricky given the heavy cost constraints we are placing on it’s design in order to keep it accessible.

mystorm

This week after a few more checks we will be ordering prototype PCBs ready for the first test build, at the same time we will work on opening access to the repository (after a bit of clean up..) for your full perusal, we look forward to any constructive feedback over the next couple of months. This is just the first of many FPGA oriented developments there is lots more to come..

Already many folks are building on top of IceStorm’s opensource foundations and will expand the tool set further and wider, we will see more dev boards , more chips supported and greater applications coming from diverse sections of our opensource communities, I would like to personally thank Clifford Wolf  for his breakthrough work on IceStorm ,without which, this would not have been possible, thank you…

Long time coming

I know, I know it’s been a while  since I posted on my blog, naughty Folknology… I am contemplating the idea of switching my blog to Medium or even creating a static blog on Gitlab with the various projects I am working on, let me know if you have any experiences/opinions with these options. I could of course just keep things as they are…

But I guess I ought to let you know what I am currently working on project wise as it’s been a while. Although I am still working on robotics projects based around Xmos technology which I need to pay the mortgage and school fees etc.. I have also been doing a lot of research over the last few years into machine learning (ML). Although this isn’t my first foray into this it’s been a couple of decades since my last exploration in the 90s.

In case you haven’t noticed machine learning having lived through a serious A.I. winter has emerged refreshed and with renewed energy over the last half decade. This time around it has found real applications in big data and the major cloud players Google, Amazon, Facebook, Microsoft et al are now using machine learning on very large scales. It will not be long before the machine learning process time of most cloud infrastructures from these vendors will pass from minority into majority, as these applications are consuming exponentially more bandwidth and processing resources. In order to get higher performance densities. We also see these vendors employing the latest GPU technologies from Nvida (Pascal) in order to try to keep up with the extraordinary demands of these algorithms and data. Recently Google has even developed there own silicon (TPU) to help run these machine learnt inference platforms. Counter intuitively these new processors are actually integer rather than floating point based in order to try to contain the performance per watt targets of these deployments into manageable envelopes. The killer bottleneck for all of these vendors is performance per watt for specific machine learning and inference applications and we are likely to see a great deal of research and development in this area.

Intel will likely be placing more inside the chip package alongside their venerable Von Neumann Architectures (VNA) in order to try to cut Nvidia off at the pass so to speak. We can expect them to integrate very high bandwidth DRAM and Interconnects with massive FPGA inside single chip packages in  an attempt to reduce the power issues with their architectures in this critical application market place for them. IBM is moving in a radical direction with their Truenorth asics using spike based neurosynaptic corelets. Along with these big players expect many others to bring rapid innovation to satisfy both the big data players using machine learning and the emerging inference based embedded and robotics markets over the next decade.

The latter is of course is where my research and interest has been focused, I am working on hardware applications based around both hybrid embedded (VMA + VLIW cores) and emergent  FPGA inference + VMA learning along with a number of higher level tools like Theano Scikit-learn and others for the data analysis,ML and modelling etc.. Therefore you will likely see me posting within these areas at all different levels over the next few months, it’s good to be back and it’s great to live in such exciting times….

 

 

Xi and Flux

I did promise to give everyone an update on our Xmos dev work and let you folks know what became of Amino, apologies for the delay I have been busier than ever over the last few months. XiAfter several years work and experimentation with project Amino I (as well as others) have yielded some interesting new development platform ideas, we have also gained a great deal of experience using Xmos and modular multicore technology.Fluxxi As you are probably aware, much of my recent opensource hardware development has been focused on motion control applications for CNC and 3D printing applications, it will therefore not come as any surprise that I have been working on a a unified rapid prototyping system for these new motion projects, rather than the disparate microcontroller dev kit based approaches that I have been struggling with in the past. Thus I took much of what I learnt from Amino and my other projects combining them to create Xi which is a 2D and 3D modular board prototyping system that we now use for internal product design here at Folknology Labs. In its 2D mode it can be used rather simply with up to 3 small breadboards for rapid experimentation as shown in the first picture, Alternativiely it can be combined with up to 3 plugin modules like the Fluxxi (a hybrid motor module) to create a motion control combos. These Xi modules along with either a debug or communications board snap together form a cube with sensor and actuation connections on the rear of the assembly. This approach also enabled us to overcome one of the early Amino design flaws of physical strength and support. These modules when combined into a cube can also be housed in rectangular housings like angled steel and ALU or just held together with 3D printed corner joints for rigidity. If required these can also be expanded into a star topology with multiple cubed controllers using Xmos links for channel based development. We can make some kits available if anyone is interested in experimenting with the Xi for their own projects or simply want to kick the tyres, if so leave a comment or get in touch via the usual methods and we will endeavour to get you some Xi early access action, who knows you might even want to create your own modules.

Cartesian & delta robots, RepRap and a new hackerspace

I know its been quiet on the blogging front here for a while but that doesn’t mean a lot hasn’t been happening, I’ve had my head down in a number of projects, I need to rebalance my IRC, Twitter, usergroups and everything better! After meeting some 3D printing folk at OggCamp last year we decided to form a RepRap group for the Thames Valley area along with a build group within that (TVRRUG). I took a lead on the electronics side of the build as we couldn’t find a suitable design that met all of our group requirements. Ironically given the percentage of self builds occuring within the RepRap world most of the electronics designs are not adapted to through hole components, many use the Allegro QFN stepper drivers (amongst other SMD choices). In addition the electronics are often not designed with beginners in mind and are not modular allowing makers to build in testable sections. So we have spent the last 6 months or so designing, building and testing a modular through hole RepRap electronics set which has proved to be an interesting diversion from the Amino project, it also enables me to complete my own RepRap build. The modular components make up an opensource set of stepper based cartesian robotic controls and is starting to find interest outside of just RepRap builds but also CNC, plasma and laser cutting applications. Given the community nature of the project I decided to explore a new online service aimed at hosting hardware projects called SolderPad started by a couple of my OSHUG colleagues. You will find a number of my opensource projects listed at SolderPad, which incidentally makes it easier to embed stuff here (in theory but lets see how it works out).

Open Motion Controller
Open Motion Controller
Dual Stepper Module
Dual Stepper Motor Module

While talking about community stuff I should also mention Reading Maker Space (RMS) which is a new hackerspace in the Thames valley we have been bringing into life, I have already run some soldering classes there for the TVRRUG folk and others. RMS is on the cusp of going live as we speak just as soon as the RFID door system is in place, if you live in the Thames Valley area and are interested we run open days on Wednesday evenings where you are welcome to come and check out the space. There are already some great folk involved in RMS especiallty Ryan who stuck his neck out by putting money down on the space itself. At RMS there is already part of the TVRRUG crew contigent for that project and I am also getting involved in a delta robot project along with some of the other planned activities like polar robotic controls for things like robot Arms etc.. I am sure that there will be many more interesting projects emerging from RMS over the next few months.

I haven’t yet got Amino onto solderpad as have a fresh new design version in the pipe. The new design simplifies some of the board layout issues of the previous version and adds some Xmos backward compatability for my add ons, it also solves some of the physical issues I experienced with the last layout. The result will be something simpler, compact, expandable and more practical, I’ll have a lot more to report on this very soon. At the same time I have made some progress on the software side of things and now beleive I have found something more unified in my approach, again more on this shortly.

P.S. I will be talking at OSHUG 16 on Thursday along with some other interesting OSH folk, worth attending if your in town

iBOM Part 4 – Expanding the market

Production on the backend isn’t the only thing holding back opensource hardware, getting from innovation and good ideas into any sort of distributed production requires initial investment. In some cases it can be very small, but unlike opensource software there are physical requirements of pcbs, parts and tools that have very real costs! the iBom part of the equation could be connected in here also by the likes of an Octopart, either by aquiring someone like KickStarter or by rolling their own distributed investor community. This would have the effect of ‘quickening’ the front end in order to supply the backend and would facilitatte the emergence of a ‘Market’ which is the next key part of the move to distributed production. It doesn’t take an Einstein to take this further and envision market places bolted onto the innnovation front ends for successful projects, thus closing the circle and providing positive feedback whilst encourage fresh new agile growth.

*Update I added an iBom repo to get started on the idea/format etc..