[myhdl-list] Python bool type used as constant
Brought to you by:
jandecaluwe
From: Josy B. <jo...@c-...> - 2014-07-14 08:56:20
|
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 |