Re: [myhdl-list] Setting of enum values
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2016-01-22 21:15:56
|
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 |