Re: [myhdl-list] Floating Point Libraries
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2011-04-14 16:20:22
|
Glad to hear you got the poster and things are going good. Hope you enjoy your time in Argentina! On 4/14/2011 11:02 AM, Jan Langer wrote: > 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. This would go back to a complex structure having many signals versus one signal for a complex structure. I have to think about this a little more. > > 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 >> >> > > > |