Re: [myhdl-list] intbv wrap
Brought to you by:
jandecaluwe
From: Ben <ben...@gm...> - 2011-05-11 12:31:55
|
Hi Chris, I am following your struggle with this feature with great interest, as I do think this would be an interesting addition to MyHDL, however, as an hypothetical future extension to MyHDL, I think this would deserve a MEP ... For now, If I want to understand your design decisions, I have to dig into my mails and look for the relevant part. I for one have for instance a question about the restrictions you enforce. See below. On Tue, May 10, 2011 at 13:27, Christopher Felton <chr...@gm...> wrote: > I made a couple of minor adjustments to this patch. > > 1. Made the wrap function private (_wrap) and moved _wrap to __wrap. The > wrap function should not be used directly because it will not covert > correctly. I think for a future (todo) enhancement the wrap function can be > made public and handled by the converter. This is an involved modification. > For now I think it is good to advertise the wrap function was private. I don't really understand the reason of such an enforcement on min and max for the wrapping. Let's be for a moment the devil's advocate and say I want my intbv to be between -3 and 12. Why would MyHDL prevent me to have it wrapped ? > > 2. Added myrange to a slot, _range. This is a coding style decision. This _range is used at only one place, and completely redundant with the existence of _nrbits. I don't think it deserves a slot. > > 3. Modified a couple comments. > BTW, did you got the testsuite to run ? To run the "core" one, I don't think you would need py.py. It uses unittest, which is included in your python distribution. Best Regards Benoît |