Re: [myhdl-list] always_comb exception
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2013-10-09 18:45:25
|
On 10/9/2013 1:16 PM, Per Karlsson wrote: > 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 > Don't know about the base Python interpreter-shell but from the ipython console it works fine. In [2]: from myhdl import * ...: 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) ...: I can never type it all correct to use the base-shell for multiline input, e.g. function definitions :) Regards, Chris |