Re: [myhdl-list] Setting of enum values
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2014-12-29 18:56:46
|
On 12/28/2014 11:44 AM, 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? I don't know about the original design decision. > > AFAICT it doesn't acquire any state from the enum function so it could > just as easily be at the module level, allowing more flexible usage when > needing to fit the enum to an existing definition. I am sure there are many ways to implement it, this may not have been a use case envision or desired. We can propose a modification to have the "Enum" class public and then various custom functions can be created to implement the codedicts, etc. I think this would provide flexibility but also maintain a minimal / logical enum. Note, I am thinking out loud here. I don't know if there was a design decision to limit the use - I can't think of one ... Regards, Chris |