Saturday, January 17, 2009

From Python to Silicon

Salam 3lykum
Currently I'm trying to get a holdon hardware design using Python language with the aid of myHDL. The authors claim through their logo "From Python to Silicon" that you can use Python to design hardware directly or at least play a role in the design process author than the conventional role taken by a script language as Python, which is making scripts to automate recurring tasks such as compiling, simulating, etc. 

The path seems far from python to silicon but there is one to say the least. It is not like the path from Verilog/VHDL to silicon, which is the usual path, and it is not as smooth (H/W design is rarely smooth but we compare it to the conventional design flow) or as predictable, on the other hand the original path is not pleasant to start with. The advantage of using such high level (even when compared to C/C++) powerful language is the degree of abstraction and simplicity. In addition to the open source nature in the case of Python and the growing enthusiastic community behind it.

Python can be used for scripting in HDL design process, by myHDL adds two main features to it;
1) It can build a verification framework; powerful and simple to perform the tedious testing tasks.
2) More interestingly it can provide the actual hardware design that can be synthesized into silicon.
But as mentioned earlier this comes with a high price of extra effort in setting up the appropriate environment for developing, debugging and testing. Such environment can be found easily in the open source community (and freely as well). What is needed for this is:

1) Developing environment: Eclipse + PyDev.
2) Verilog HDL (HDL that I'm using) compiler and simulator: Icarus.
3) Wave viewer: GTKwave.

Furthermore, the way most literature explains how to program in Python is significantly different from the methodology used in H/W design, or even the way used by engineers (excluding software engineers). Although there is attempts to bridge the gap with the amazing efforts in SciPy, which tries to rise up to MATLABs' success.
On the bright side, I managed to set up this "tool chain" if we abuse the term and design simple shift register with myHDL. If Allah give me time to my next post, we will inshAllah describe how to set up the development environment and discuss the design strategy with Python.
Salam 3lykum

No comments: