[myhdl-list] intbv.saturate, intbv.wrap
Brought to you by:
jandecaluwe
From: Thomas T. <tho...@de...> - 2007-06-29 07:51:38
|
Jan suggested this feature request <https://sourceforge.net/tracker/?func=detail&atid=596335&aid=1740780&group_id=91207> here on the list. I suppose "wrapping around" is the default behaviour of any logic. So to implement it checkBounds just need to be inhibited. "Saturate" instead of "wrapping around" makes may DSP circuit behaving like an analog circuit. Overflow is not so desasterous in saturate mode as in warp around mode. In Python itself a saturate mode is useless as there is no minimal and maximal value for integers (and extremly high limits for floats). BTW, I tried the follwing: --------------------------- class analogbv(intbv): def _checkBounds(): return --------------------------- It does not work, because in _Signal.py _checkBounds from _intbv.py is used and not my own _ceckBounds. It is not easy to add new types to myhdl. Thomas |