Introduction
============

The Chips library gives Python the ability to design, simulate and realise
digital devices such as FPGAs. Chips provides a simple yet powerful suite of
primitive components, *Streams*, *Processes* and *Sinks* that can be
succinctly combined to form *Chips*. The *Chips* library can automatically
convert *Streams*, *Processes* and *Sinks* into a Hardware Description
Language, which can be synthesised into real hardware. 

Python programs cannot themselves be converted into real hardware, but it is
possible to programmatically generate which construct *Chips*, which can
in-turn be converted into hardware. When combined with the extensive
libraries already supported by Python, such as NumPy and SciPy, Python and
Chips make the ideal design and verification environment.

A new approach to device design
-------------------------------

Traditionally, the tool of choice for digital devices is a Hardware
Description Language (HDL), the most common being Verilog and VHDL. These
languages provide a reasonably rich environment for modeling and simulating
hardware, but only a limited subset of the language can be realised in a
digital device (synthesised). 

While a software designer would typically implement a function in an
imperative style using loops, branches and sub procedures; a hardware model
written in an imperative style cannot be synthesised.

Synthesizable designs require a different approach. Digital device designers
must work at the Register Transfer Level (RTL). The primitive elements of an
RTL design are clocked memory elements (registers) and combinational logic
elements. A typical synthesis tool would be able to infer boolean logic,
addition, subtraction, multiplexing and bit manipulation from HDL code
written in a very specific style.

An RTL designer has to work at a low level of abstraction. In practical
terms this means that a designer has to do more of the work themselves.

1. A designer is responsible for designing their own interfaces to
   the outside world.

2. The designer is responsible for clock to clock timing, manually
   balancing propagation delays between clocked elements to achieve
   high performance.

3. A designer has to provide their own mechanism to synchronise and
   pass data between concurrent computational elements (by
   implementing a bus with control and handshaking signals).

4. A designer has to provide their own mechanism to control the flow
   of execution within a computational element (usually by manually
   coding a finite state machine). 

5. The primitive elements are primitive. Synthesis tools provide
   limited support for multiplication, and division is not usually
   supported at all.


This is where *Python Chips* comes in. In *Python Chips*, there is no
synthesizable subset, but a standalone synthesizable language built on top
of Python. *Python Chips* allows designers to work at a higher level of
abstraction. It does a lot more of the work for you.


1. *Python Chips* provides a suite of device interfaces including
   I/O ports and UARTs.

2. Synthesizable RTL code is generated automatically by the tool.
   Clocks, resets, and clock to clock timing are all taken care of
   behind the scenes.

3. *Python Chips* provides a simple method to synchronise concurrent
   elements, and to pass data between them - streams. The tool
   automatically generates interconnect buses and handshaking
   signals behind the scenes.

4. *Python Chips* provides processes with imperative style
   sequences branches and loop. The tool automatically generates
   state machines, or highly optimized soft-core processors behind
   the scenes.

5. The primitive elements are not so primitive. Common constructs
   such as counters, lookup tables, ROMS and RAMS are invoked with a
   single keyword and a few parameters. *Python Chips* also provides
   a richer set of arithmetic operators including fully
   synthesizable division and multiplication.

A language within a language 
----------------------------

*Python Chips* is a python library, just an add-on to Python which is no
more or less than a programming language. The *Python Chips* library
provides an Application Programmers Interface (API) to a suite of hardware
design functions.

The *Python Chips* library can also be considered a language in its own
right, The Python language itself provides statements which are executed on
your own computer. The *Python Chips* provides an alternative language,
statements which are executed on the target device.
