Re: [myhdl-list] Python bool type used as constant
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2014-08-02 16:38:13
|
Thanks for the bug report. I have fixed this in the maintenance and development branches. On 07/14/2014 10:55 AM, Josy Boelen wrote: > Hi all, > > The following code: > def ramreader( Clk, Reset , ... , WRAP_AROUND ): # WRAP_AROUND is a Python > bool constant > ... > @always_... > def f(): > ... > if not WRAP_AROUND : > > gets converted to: > if (not '1') then > > which is invalid VHDL ... > > A work-around is to bring the constant to the highest level and > conditionally generate the two cases: > > def ramreader( Clk, Reset , ... , WRAP_AROUND ): # WRAP_AROUND is a Python > bool constant > ... > if not WRAP_AROUND : > @always_... > def f(): > ... > else: > @always_... > def f(): > ... > > Now we have duplicated the code and the maintenance > > Regards, > > Josy > > > ------------------------------------------------------------------------------ > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck® > Code Sight™ - the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com World-class digital design: http://www.easics.com |