Re: [myhdl-list] Floating Point Libraries
Brought to you by:
jandecaluwe
From: Tom D. <td...@di...> - 2011-04-13 15:39:55
|
> Actually I believe there are many good applications for > "hierarchy" in signals, but I don't think this particular > case is one. > > Before continuing, let me stress once more a point which > is missed all the time. Everything that is being talked > about, no matter how complex, can being done in MyHDL - > the modeling language today. That is not the problem. > > The problem is conversion. We need it for the things > that have to get implemented, but I'm finding it hard. > For other parts in MyHDL, we can reuse the python > interpreter. For conversion, we write a compiler > ourselves. The biggest problem is that for anything > that we want to support, we have to find and implement > a meaningful mapping in a much less capable language > such as Verilog. > > Once again: in MyHDL modeling you can do anything you > want. There is nothing that prevents us from experimenting > with the type of interface we would like to have, > and then see if and how we could support it in > the conversion. > I agree that this is only an issue with conversion. And I would also add, it is only an issue at the top module level. The simple solution I use is make a wrapper for the top level I/O. Honestly a couple of lines of python code. Like this: C = cordic.cordic(type=cordic.MAG) # must have intbv at top to make Verilog, so need wrapper def cordic_top(mag,in_r,in_i,ov,clk,r,iv) : inC = cplx.cplx(in_r,in_i) CM0 = C.logic(mag,inC,ov,clk,r,iv) return CM0 cplx is just a class that maintains the real and imaginary of whatever type you are using. Typically I would have two of some other data type, fixed, float or int. cordic is a class that contains the logic and models for the module. Now I don't know how conversion works and frankly it is like magic to me. I was just saying if we wanted to fix this, my idea (for what it's worth) would be to allow a class to inherit a base set of methods that conversion knew about. Then change the ones needed to simplify your life. My assumption is that the Signal class contains some conversion information. |