Re: [myhdl-list] Setting of enum values
Brought to you by:
jandecaluwe
From: Henry G. <he...@ca...> - 2015-01-10 09:55:45
|
On 10/01/15 08:50, Jan Decaluwe wrote: > On 12/28/2014 06:44 PM, Henry Gomersall wrote: >> >On 28/12/14 11:24, Henry Gomersall wrote: >>> >>Looking at the code, it seems the enum value is set by the argument >>> >>order, so I can't see how to do it trivially. >> > >> >It strikes me that the problem is that the class definition is inside >> >the enum factory function. Is there a reason for this? > Sure - the enum factory function is intended to create > a brand new type, like in VHDL. Right, that makes sense in light of the view that enum should more than just a symbolic representation of an int down to the HDL level. This is handled rather differently in the standard enum that allows quite a bit more flexibility in the design - the uniqueness of the items is enforced through the Enum metaclass. Cheers, Henry |