Re: [myhdl-list] Setting of enum values
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2015-01-10 08:48:41
|
On 12/28/2014 12:24 PM, Henry Gomersall wrote: > Is there a way to set an enum to have a specific value? The enumeration values of an abstract enum type are set at construction time. If you mean an integer value - that is not the purpose of enums. Use a symbolic constant. > > 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. > > The use case is to interface with a library block that has the states > already defined, and I don't really want to implement every enumeration > for my usage. > > I suppose the simple workaround is to wrap the library with the state > logic and let the synthesis tools worry about any optimisations. > > Cheers, > > Henry > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com World-class digital design: http://www.easics.com |