Re: Setting of enum values

Christopher Felton <[email protected]> Fri, 22 Jan 2016 15:15:43 -0600
Newsgroups gmane.comp.python.myhdl
Message-ID <[email protected]>
On 1/22/16 12:39 PM, Marcel Hellwig wrote:
> On 20.01.2016 23:11, Marcel Hellwig wrote:
>>
>> Now, myhdl tells me:
>>
>>>> myhdl.ConversionError: in file xxx.py, line 63:
>>>>      Unsupported attribute: User
>> line 63:
>>>> if mode == CpuMode.User:
>
>
> I finally found out, why this happens.
> Because I don't like to write the same code twice, I outsourced the
> if/elif section into a seperate function.
>

Hmmm, yes this doesn't appear to be currently supported,
that is accessing attributes in a combinatorial function.
Not sure why it is not?

Could you use a module instead of a function?

     rb_inst = register_bank(mode, mul)

     @always_seq(clk.posedge, reset=reset)
     def write():
         # ...
         re = regbank[mul*18 + rs]

     @always_comb
     def read():
         re = regbank[mul*18 + rs]

     return rb_inst, write, read

Regards,
Chris


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140