Re: [myhdl-list] intbv wrap
Brought to you by:
jandecaluwe
From: Tom D. <td...@di...> - 2011-05-04 14:12:02
|
On 05/04/2011 03:00 AM, Christopher Felton wrote: > At this point in time I am going to defer converting the wrap function > as briefly discussed in other threads. It is beyond my current > capabilities. But this doesn't change the approach. It simply means > the wrap can only be used as an attribute of the intbv object, thank you > Tom Dillon for the pointer here. Do you mean we won't have wrap support in conversion? Would it be possible to put an error or warning in so you would know the logic won't match the MyHDL code? It is beyond my capabilities too, I still conversion is magic. > It also seemed appropriate to add a property for _val, see the following. > > # val property > def _get_val(self): > return self._val > > def _set_val(self, pval): > > if self._wrap: > self._val = self.wrap(pval) > else: > self._val = pval > > self._checkBounds() > > val = property(_get_val, _set_val) > > > This had been discussed in some older threads. Are there any objections > against this type of implementation? The _checkBounds and wrap will be > called only from the _set_val property function. Will intbv work as it does now? I am a little rusty on properties. |