Re: [myhdl-list] Convertible records
Brought to you by:
jandecaluwe
From: Jan L. <jan...@et...> - 2011-09-04 20:50:07
|
Am 02.09.2011 um 21:56 schrieb Christopher Felton: > On 9/2/2011 2:39 PM, Sébastien Bourdeauducq wrote: >> On 09/02/2011 09:20 PM, Christopher Felton wrote: >>> should limit the discussion to building >>> objects similar to VHDL record and SV struct >> >> Hmm, this would be of little help for the high level synthesizer I'm >> trying to develop :-) I tend to think I need dynamically built >> structures. >> > > Doh, but the first post (start of the conversation) was this simple > type? > > class Binary: > def __init__(self): > self.a = Signal(intbv()[32:]) > self.b = Signal(intbv()[32:]) > > In general, I don't think it would be a big issue. If something like > the SignalStruct was used dynamically. You could add signals as you > like. Then the converter would look at the final configuration and > still get a list of signals. > > But I kinda want to wrap my head around the declarative types first > (converter issues, etc) without closing the door on the dynamic. I > think I am struggling with a use case were dynamic is more useful than > the declarative. A dynamic approach on top of a declarative is easily possible. I think we should have a protocol of what the converter expects from a type to be convertible. Then we can define signal types that have dynamic behavior from a users point of view and provide the declarative interface to the converter. The basic data structure used in this interface will probably be the classic intbv. I remember the discussions on the fixed point type. With an approach like the one above, it should be possible to have a very clean fixed point class that shows the user a nice and clean interface where the correct result data type is inferred in expressions and through the declarative interface behind the scene the converter knows how to map the fixed point object to bit vectors. Jan -- Jan Langer Professorship Circuit and System Design Chemnitz University of Technology, Reichenhainer Str. 70, 09126 Chemnitz Phone: +49 37209 688001, Fax: +49 371 531-833158, Mobile: +49 162 9847325 http://www.tu-chemnitz.de/etit/sse |