I'm making my way through the myHDL manual, tutorials and cookbook using PyPy. Several things have been needed to make PyPy work for the tutorials:
1. Install pypy 1.6:
For Fedora, it is in Rawhide. For other platforms, follow these instructions: http://pypy.org/download.html
2. Install setuptools:
wget http://python-distribute.org/distribute_setup.py
sudo pypy distribute_setup.py
sudo ln -s /usr/lib/pypy-1.6/bin/easy_install /usr/bin/pypy_easy_install
3. Install pytest:
sudo pypy_easy_install -U pytest
sudo ln -s /usr/lib/pypy-1.6/bin/py.test /usr/bin/pypy.test
As you can see above, I created two soft links: 1) For easy_install as pypy_easy_install, and 2) for py.test as pypy.test Both were done mainly to keep my default python install pristine while having the pypy tools in my path. So instead of running py.test, I run pypy.test.
I've completed the StopWatch and SineComputer examples, and so far everything works fine.
I'm using Eclipse + PyDev along with WebPACK ISE. For simplicity, I'm using the default Eclipse project structure (~/EclipseWorkspace/<ProjectName>/src) with a ~/EclipseWorkspace/<ProjectName>/ise directory for the Xilinx project.
For cosimulation I tried to use cver, but it segfaults on my Fedora 15 system, so I've been modifying the tutorials as I go to use Icarus, which works well. For example, here's my modification to SineComputer_v() in SineComputer.py:
def SineComputer_v(cos_z0, sin_z0, done, z0, start, clock, reset):
"""Perform Verilog cosimulaton."""
toVerilog(SineComputer, **locals())
# Presently, cver segfaults on my system.
#cmd = "cver -q +loadvpi=myhdl_vpi:vpi_compat_bootstrap SineComputer.v tb_SineComputer.v"
#return Cosimulation(cmd, **locals())
# Use Icarus instead.
os.system("iverilog -o SineComputer SineComputer.v tb_SineComputer.v")
return Cosimulation("vvp -m ./myhdl.vpi SineComputer", **locals())
One other thing: I could not find "myhdl.vpi", but was able to build it from myhdl_vpi.c. Copying myhdl.vpi into the local project directory seems wasteful, but I haven't yet looked for a system-wide solution.
If anyone has any other hints to add, I'm all ears!
-BobC
|