Re: [myhdl-list] Verilator as a backend to myhdl?
Brought to you by:
jandecaluwe
From: Terry C. <ter...@gm...> - 2010-10-07 22:40:49
|
Hello Lane, Thanks for the reply, actually I was just thinking about using Boost.Python to wrap the C code. It is relatively easy for simple blocks, but I have to explicitly list which C variables/function/class I want accessible. Maybe I could get away with using Pyste/Py++ to automate the C to Python layer generation. Do you (or anyone else), have any experience with this? I am afraid of going over-the-top with this. Also, I was just pondering whether to use pure python as the high-level testbench or attempt to hack myhdl's _Simulation.py->Simulation.run to instead redirect its calls to python-wrapped verilated model. Pure Python might be easier for me, but myhdl's similarity with verilog and its use of decorators is really elegant and clean. I will admit that it is taking me quite a bit of time to wrap my head around the myhdl code as some of the usages of myhdl generators is sending me back to my Python textbooks. So my abilities as a python programmer may actually be too limited to get this too work. I guess I will keep shaking this Boost.Python idea and see what falls out. Thanks, Terry On Thu, Oct 7, 2010 at 5:37 PM, Lane Brooks <la...@ub...> wrote: > > Hi myhdl developers, > > > > I am new to the mailing list. So I am not sure if this issue has already > > been discussed. I tried searching the mailing list archive, but didn't > > find > > anything similar. > > > > My question is: has anyone attempted to use a verilated C model (from > > wilson > > snyder's verilator) as the backend simulator for myhdl through some sort > > of > > python-to-C foreign language interface? > > > > The motivation behind this is that I would like to combine the high-level > > programming power of python (and myhdl) with the speed of verilator. I > > could > > use co-sim w/ icarus or cver, but I find that cosimulation time is > > prohibitively slow. Commercial simulator (we use modelsim) are acceptably > > fast, but we have a limited number of licenses, and we can't afford to > use > > them to run regressions. > > > > Any thoughts / comments would be much appreciated. > > > > Thanks, > > Terry > > > > My normal flow these days has become to wrap verilated code up as a python > C extension module so that I can use python to generate stimulus and > control the flow. It is quite nice, especially when used with numpy and > nose. With numpy you can get fast numerical analysis and with nose you get > a nice test framework. > > It is quite easy to do once you know how to write a python extension > module. It takes a little bit of time to understand how to write an > extension module, but knowing how to write C extension modules for python > is well worth the effort beyond just wrapping verilated code. I wrap > things all the time when I need access in python something written in C. > > Furthermore, using this approach, you can develop high level stuff in > python and then if it is too slow, push whatever makes sense down into the > C extension module to speed it up as necessary. Flow control, checking a > bit for pass or fail, etc. is typically not a bottle neck and is quite > nice to do it python. Even things like generating sin waves, comparing > memory buffers for equality, etc, is not a bottle neck in python > (especially if you use numpy). > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today. > http://p.sf.net/sfu/beautyoftheweb > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > |