Re: [myhdl-list] Floating Point Libraries
Brought to you by:
jandecaluwe
From: Jan L. <ja...@la...> - 2011-04-14 16:02:42
|
Hi, just a quick comment. Wouldn´t an explicit statement which signals should be treated as hardware signals be better? Something like def __to_hardware__(self): return self.x,self.y,self.z I really think too much magic with Python´s introspection should be avoided. On a sidenote: the poster (unfortunately we had to scale it down a bit) and the flyers are finally up and I will report back on the generated interest later. greetings from argentina, Jan Quoting Christopher Felton <chr...@gm...>: > <snip> >> >> So why not start with a workaround? We could define an >> interface using a_sign, a_mant, a_exp and b_sign, b_mant, b_exp. >> Ok, the interface is flattened, but in the code the only >> difference would be the underscore instead of dot notation. >> But it would teach us if this type of interface is really >> what we want to work with. And it works today. And if conversion ever >> gets more powerful, an upgrade may be simple. > > > > Are you thinking something like the following? If I understand, the > proposal would be to have one Signal for a complex structure vs. a > structure with multiple Signals. > > ----------- > from myhdl import * > > class TypeStruct(object): > > def __init__(self): > x = intbv(0)[8:] > y = intbv(0)[12:] > z = intbv(0)[23:] > > > if __name__ == '__main__': > struct = Signal(TypeStruct()) > struct.next.x = 1 > struct.next.y = 2 > struct.next.z = 3 > struct._update() # usually happens behind the scenes > > print struct.x, struct.y, struct.z > > ----------- > > This isn't specific to the FP interface proposal. This is the general > method to handle grouping of types. And then the conversion proposal > would be; that a Signal carrying a class type (and dict?) the internal > intbv types would be expanded to struct_x, struct_y, struct_z, for the > above example? > > I follow, that the conversion work would follow the general modeling > approach. > > Or when you said "code" you are referring to the MyHDL code. And for > the near-term it is more important to define a working convertible FP > module that is support by MyHDL 0.7. The FP unit would be built using > the interface you mentioned and in the future it could be replaced by > something like the above. > > Chris Felton > > > > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > > -- jan langer ... ja...@la... "pi ist genau drei" |