Re: [myhdl-list] Floating Point Libraries
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2011-04-14 13:33:20
|
<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. > At the risk of embarrassing myself but to keep this thread going I will start a FP interface based on Jan D and Tom D. suggestions. Something like the following could be a start to an interface definition. class FloatingPoint(object): def __init__(self): pass def Add(self, clk, reset, a_sign, a_mant, a_exp, dva, b_sign, b_mant, b_exp, dvb, r_sign, r_mant, r_exp, dvr, EXP_W=8, MAN_W=23): pass def Mul(self, clk, reset, a_sign, a_mant, a_exp, dva, b_sign, b_mant, b_exp, dvb, r_sign, r_mant, r_exp, dvr, EXP_W=8, MAN_W=23): pass def Div(self, clk, reset, a_sign, a_mant, a_exp, dva, b_sign, b_mant, b_exp, dvb, r_sign, r_mant, r_exp, dvr, EXP_W=8, MAN_W=23): pass I simply added a dv* and dvo for flow control. I did not add the error signals / info output signals. Note they are all the same interface for each op. Since the "sign" is explicit, it can be flipped for subtraction etc. This is for modeling not conversion, yet. Chris Felton |