Re: [myhdl-list] always_comb exception
Brought to you by:
jandecaluwe
From: Per K. <bas...@gm...> - 2013-10-09 18:17:11
|
I suspect you are running from the interpreter. That won't work, because MyHDL uses inspection. Every piece of MyHDL code has to be written to an actual file somewhere (or at least that's how I understand it). Cheers Per On Wed, Oct 9, 2013 at 7:48 PM, Steve Vejcik <ste...@ea...>wrote: > Hi Folks - I'm just wetting my feet with myhdl and have run into a problem > running the simple latch example from the wiki. I'm running python 2.7 with > myhdl v0.8. If anyone can offer some insight I'd appreciate it. Here's a > variant of the problem: > > def Mux(z, a, b, sel): > @always_comb > def muxLogic(): > if sel == 1: > z.next = a > else: > z.next = b > return muxLogic > >>> z, a, b, sel = [Signal(0) for i in range(4)] > >>> mux_1 = Mux(z,a,b,sel) > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "<stdin>", line 2, in Mux > File "/usr/local/lib/python2.7/dist-packages/myhdl/_always_comb.py", line > 64, in always_comb > c = _AlwaysComb(func, symdict) > File "/usr/local/lib/python2.7/dist-packages/myhdl/_always_comb.py", line > 185, in __init__ > s = inspect.getsource(func) > File "/usr/lib/python2.7/inspect.py", line 701, in getsource > lines, lnum = getsourcelines(object) > File "/usr/lib/python2.7/inspect.py", line 690, in getsourcelines > lines, lnum = findsource(object) > File "/usr/lib/python2.7/inspect.py", line 538, in findsource > raise IOError('could not get source code') > IOError: could not get source code > > Steve > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > |