Re: [myhdl-list] MEP : Signal Containers
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2012-05-19 09:02:27
|
On 05/18/2012 09:57 PM, Christopher Felton wrote: > The advantage of a class method over a function ... no advantage per se. > They both achieve the same thing in the similar manner. But it gives > the ability to use a method versus a function if someone wanted. I think there has to be a much better reason than this to warrant the effort to support this in conversion. There should be some feature that many people find useful and that cannot reasonably done in a different way. Conversion is complex enough as it is! > We have had this conversation a couple times in the past. The current > solution is to have a method that returns the generators from the > function, essentially wrapping a function in a /class method/. By > allowing the /class method/ to be directly convertible would remove the > need to wrap a function. I don't remember - can you provide simple examples? Is the issue only related to the very top level, as I MEP 108 seems to suggest, or also to intermediate hierarchical levels? > MEP-108 is simple, its only intention is to enable a /class method/ the > same as a function. My best example of why you might want to do this is > the following example, http://bit.ly/w95kOd. > > The /class method/ conversion and the /class attribute/ can be viewed as > separate. They can be used together but nothing says they have to be > and the reason for the separate MEPs. The idea of the /class > attribute/, when it is a Signal (a.k.a Signal container), basically > helps manage namespace and organize collection of Signals. The MEP-107 > for the attributes simply proposes to create a unique name for /class > attribute/ when it is a Signal. > > If the example in the previous post (the wishbone) didn't illustrate how > /class attributes/ could be used, either I am poorly explaining or we > might have a misunderstanding what a /class attribute/ is. I guess, I > would refer you back to the internal bus examples I and Oscar provided. /114/50122263/ I'm confused about terminology. When you talk about class attributes, are you sure you don't mean instance attributes instead? -- 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 |