2004-04-21 13:38:04 +00:00
|
|
|
MyHDL Release 0.4.1
|
|
|
|
===================
|
2003-01-30 17:30:38 +00:00
|
|
|
|
|
|
|
INTRODUCTION
|
|
|
|
------------
|
|
|
|
|
2003-02-14 11:42:55 +00:00
|
|
|
MyHDL is a Python package for using Python as a hardware description
|
2003-08-08 13:41:03 +00:00
|
|
|
and verification language. Languages such Verilog and VHDL are
|
|
|
|
compiled languages. Python with MyHDL can be viewed as a "scripting
|
|
|
|
language" counterpart of such languages. However, Python is more
|
|
|
|
accurately described as a very high level language (VHLL). MyHDL users
|
|
|
|
have access to the amazing power and elegance of Python.
|
|
|
|
|
|
|
|
The key idea behind MyHDL is to use Python generators for modeling
|
|
|
|
hardware concurrency. A generator is a resumable function with
|
|
|
|
internal state. In MyHDL, a hardware module is modeled as a function
|
|
|
|
that returns generators. With this approach, MyHDL directly supports
|
|
|
|
features such as named port association, arrays of instances, and
|
|
|
|
conditional instantiation.
|
|
|
|
|
|
|
|
MyHDL supports the classic hardware description concepts. It provides
|
|
|
|
a signal class similar to the VHDL signal, a class for bit oriented
|
|
|
|
operations, and support for enumeration types. The Python yield
|
|
|
|
statement is used as a general sensitivity list to wait on a signal
|
2004-02-02 10:47:49 +00:00
|
|
|
change, an edge, a delay, or on the completion of another
|
|
|
|
generator. MyHDL supports waveform viewing by tracing signal changes
|
|
|
|
in a VCD file.
|
2003-08-08 13:41:03 +00:00
|
|
|
|
2003-08-22 07:43:38 +00:00
|
|
|
Python's rare combination of power and clarity makes it ideal for high
|
|
|
|
level modeling. It can be expected that MyHDL users will often have
|
|
|
|
the ``Pythonic experience'' of finding an elegant solution to a
|
|
|
|
complex modeling problem. Moreover, Python is outstanding for rapid
|
|
|
|
application development and experimentation.
|
2003-08-08 13:41:03 +00:00
|
|
|
|
|
|
|
With MyHDL, the Python unit test framework can be used on hardware
|
|
|
|
designs. MyHDL can also be used as hardware verification language for
|
|
|
|
VHDL and Verilog designs, by co-simulation with any simulator that has
|
|
|
|
a PLI. The distribution contains a PLI module for the Icarus Verilog
|
2003-05-16 22:20:28 +00:00
|
|
|
simulator.
|
2003-02-14 11:42:55 +00:00
|
|
|
|
2004-02-04 16:01:23 +00:00
|
|
|
Finally, a subset of MyHDL code can be converted automatically to
|
2004-02-02 10:47:49 +00:00
|
|
|
synthesizable Verilog code. This feature provides a direct path from
|
|
|
|
Python to an FPGA or ASIC implementation.
|
|
|
|
|
2003-08-08 13:41:03 +00:00
|
|
|
The MyHDL software is open source software. It is licensed under the
|
|
|
|
GNU Lesser General Public License (LGPL).
|
|
|
|
|
2003-01-30 22:36:49 +00:00
|
|
|
|
2003-01-30 17:30:38 +00:00
|
|
|
INSTALLATION
|
|
|
|
------------
|
|
|
|
|
2003-02-14 11:42:55 +00:00
|
|
|
If you have superuser power, you can install MyHDL as follows:
|
2003-01-30 22:36:49 +00:00
|
|
|
|
|
|
|
python setup.py install
|
|
|
|
|
|
|
|
This will install the package in the appropriate site-wide Python
|
|
|
|
package location.
|
|
|
|
|
|
|
|
Otherwise, you can install it in a personal directory, e.g. as
|
|
|
|
follows:
|
|
|
|
|
|
|
|
python setup.py install --home=$HOME
|
|
|
|
|
|
|
|
In this case, be sure to add the appropriate install dir to the
|
|
|
|
$PYTHONPATH.
|
|
|
|
|
|
|
|
If necessary, consult the distutils documentation in the standard
|
|
|
|
Python library if necessary for more details; or contact me.
|
|
|
|
|
2004-04-21 13:38:04 +00:00
|
|
|
You can test the proper installation as follows:
|
2003-03-06 22:16:03 +00:00
|
|
|
|
2004-04-21 13:38:04 +00:00
|
|
|
cd myhdl/test
|
|
|
|
python test_all.py
|
2003-01-30 22:36:49 +00:00
|
|
|
|
2003-05-15 09:30:34 +00:00
|
|
|
To install co-simulation support:
|
2003-05-14 09:12:21 +00:00
|
|
|
|
2003-05-15 09:30:34 +00:00
|
|
|
Go to the directory co-simulation/<platform> for your target platform
|
2003-05-14 09:12:21 +00:00
|
|
|
and following the instructions in the README.txt file. Currently, the
|
2003-05-15 09:30:34 +00:00
|
|
|
only supported platform is Icarus.
|
2003-05-14 09:12:21 +00:00
|
|
|
|
2003-05-13 08:03:51 +00:00
|
|
|
|
2003-01-30 17:30:38 +00:00
|
|
|
DOCUMENTATION
|
|
|
|
-------------
|
|
|
|
|
2003-01-30 22:36:49 +00:00
|
|
|
See the doc/ subdirectory.
|
|
|
|
|
2003-05-13 08:03:51 +00:00
|
|
|
|
2003-01-30 17:30:38 +00:00
|
|
|
EXAMPLES
|
|
|
|
--------
|
2003-01-30 22:36:49 +00:00
|
|
|
|
|
|
|
See the example/ subdirectory for examples.
|
|
|
|
|
2003-05-13 08:03:51 +00:00
|
|
|
|
2003-01-30 22:36:49 +00:00
|
|
|
AUTHOR
|
|
|
|
------
|
|
|
|
Jan Decaluwe <jan@jandecaluwe.com>
|