myhdl-list Mailing List for MyHDL (Page 162)
Brought to you by:
jandecaluwe
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(14) |
Nov
(4) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(1) |
Feb
(10) |
Mar
(19) |
Apr
(14) |
May
(1) |
Jun
(4) |
Jul
(10) |
Aug
|
Sep
(2) |
Oct
(7) |
Nov
(17) |
Dec
(12) |
| 2005 |
Jan
(6) |
Feb
(10) |
Mar
(17) |
Apr
(10) |
May
(9) |
Jun
(5) |
Jul
(26) |
Aug
(34) |
Sep
(10) |
Oct
(38) |
Nov
(71) |
Dec
(74) |
| 2006 |
Jan
(20) |
Feb
(20) |
Mar
(7) |
Apr
(2) |
May
(13) |
Jun
|
Jul
|
Aug
(4) |
Sep
(37) |
Oct
(43) |
Nov
(30) |
Dec
(33) |
| 2007 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
(30) |
Jun
(9) |
Jul
(1) |
Aug
|
Sep
(8) |
Oct
(13) |
Nov
|
Dec
(4) |
| 2008 |
Jan
(13) |
Feb
(46) |
Mar
(25) |
Apr
(7) |
May
(20) |
Jun
(73) |
Jul
(38) |
Aug
(47) |
Sep
(24) |
Oct
(18) |
Nov
(9) |
Dec
(36) |
| 2009 |
Jan
(31) |
Feb
(24) |
Mar
(73) |
Apr
(13) |
May
(47) |
Jun
(28) |
Jul
(36) |
Aug
(2) |
Sep
(5) |
Oct
(8) |
Nov
(16) |
Dec
(29) |
| 2010 |
Jan
(34) |
Feb
(18) |
Mar
(18) |
Apr
(5) |
May
|
Jun
(24) |
Jul
(53) |
Aug
(3) |
Sep
(18) |
Oct
(33) |
Nov
(19) |
Dec
(15) |
| 2011 |
Jan
(9) |
Feb
(4) |
Mar
(39) |
Apr
(213) |
May
(86) |
Jun
(46) |
Jul
(22) |
Aug
(11) |
Sep
(78) |
Oct
(59) |
Nov
(38) |
Dec
(24) |
| 2012 |
Jan
(9) |
Feb
(22) |
Mar
(89) |
Apr
(55) |
May
(222) |
Jun
(86) |
Jul
(57) |
Aug
(32) |
Sep
(49) |
Oct
(69) |
Nov
(12) |
Dec
(35) |
| 2013 |
Jan
(67) |
Feb
(39) |
Mar
(18) |
Apr
(42) |
May
(79) |
Jun
(1) |
Jul
(19) |
Aug
(18) |
Sep
(54) |
Oct
(79) |
Nov
(9) |
Dec
(26) |
| 2014 |
Jan
(30) |
Feb
(44) |
Mar
(26) |
Apr
(11) |
May
(39) |
Jun
(1) |
Jul
(89) |
Aug
(15) |
Sep
(7) |
Oct
(6) |
Nov
(20) |
Dec
(27) |
| 2015 |
Jan
(107) |
Feb
(106) |
Mar
(130) |
Apr
(90) |
May
(147) |
Jun
(28) |
Jul
(53) |
Aug
(16) |
Sep
(23) |
Oct
(7) |
Nov
|
Dec
(16) |
| 2016 |
Jan
(86) |
Feb
(41) |
Mar
(38) |
Apr
(31) |
May
(37) |
Jun
(11) |
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(1) |
Nov
(5) |
Dec
(3) |
| 2017 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(3) |
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
| 2018 |
Jan
(1) |
Feb
(1) |
Mar
(7) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(3) |
Dec
|
| 2020 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
(3) |
| 2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(12) |
Dec
(11) |
| 2022 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
(3) |
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2023 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2024 |
Jan
(1) |
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
(2) |
| 2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
|
From: Jan D. <ja...@ja...> - 2008-03-20 22:09:53
|
hma...@fr... wrote: > Hi, > > I'm wondering if/how MyHDL could be used as an ESL language for system > simulations "a la" SystemC but without the burden of C++ ? I'm pretty sure beautiful things can be accomplished here. > I'd like to make simulations of a system on chip (simulate traffic on an > interconnection micronetwork from several initiators like CPU, DSP, DMA, etc... > and dimension accordingly memory bit width, latencies, FIFO sizes, etc...). > > I'm aware speed might be an issue depending on teh level of modeling used, but > for a high-level TLM I'm not scared a priori. Right attitude. > It strikes me that Python should be used for ESL, andif MyHDL for some reason is > not suitable, at least the same generator mechanism could be reused. Yes. Note that MyHDL in terms of modeling is intended to be fairly general though. (The limitations imposed by conversion to Verilog/VHDL are just that - limitations of convertibility. Pure MyHDL modeling is way more powerful.) > Obviously, the Verilog converter is of lesser interest in this case. May be a > SystemC converter .. ? Mm, even a system on chip needs to implemented at some time, right? :-) Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
|
From: Jan D. <ja...@ja...> - 2008-03-20 21:49:55
|
Blubaugh, David A. wrote: > Would anyone know as to how to develop floating point support for the > MyHDL module? Has anyone worked with any alternative versions of the > IEEE standard for floating -point? Also, has anyone developed a > floating-point library for a module within the python environment in > order to execute numerical computations. I would imagine since I am > translating python to verilog by using MyHDL , that I will have to > develop the floating-point support module in python source code as well ?? > > I believe this is what will be required in order to develop > floating-point capable algorithms within Verilog. If I can develop this > one feature from MyHDL, it would allow this module to be fairly > competitive with commercial products. I am no expert in floating point. What is it exactly that the commercial products you refer to do? Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
|
From: Jan D. <ja...@ja...> - 2008-03-20 21:40:09
|
Some words about the status of the MyHDL documentation, in
particular the manual.
In the near future I'll have to write and rewrite considerable
amounts of documentation. Not only about the VHDL stuff: I also
want to rewrite the whole unit testing chapter to show the
use of py.test instead of unittest, and the possibility to
convert test suites.
Recently I became a little worried. For MyHDL, I have reused
the Python documentation flow based on latex, which is a bit
of a mess (based partially on Perl!). I also noticed that a
new system based on Restructured Text (reST) was introduced
in Python development starting with 2.6. The Python docs have
already been converted to the new format, and are further
being developed in it, e.g. for 3.0. The new documentation
generation tool is called "sphinx".
Obviously I don't want to be left with an unsupported flow and
even less to write new documentation in it.
So, even though the new flow is not officially released, I decided
to bite the bullet and try to adapt right away. Not unexpectedly,
the existing Python doc sources have been converted to the new
format using a use-once, throw-away script. I wanted to reuse it,
but as it is now obsolete for Python itself, the conversion
script is already being "phased out". So it was best to act
right away.
After some hacking I managed to convert the current
MyHDL doc sources to the new system, and build html with it.
It works, though I don't like the resulting "look" completely -
but that is just a matter of stylesheets and templates.
I do like the fact that all documentation is in reST format
now - if this works well it might be good idea to move more
parts of the web site to that format.
You can preview the result here:
http://www.jandecaluwe.com/Tools/MyHDL/dev/html
Jan
--
Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com
Kaboutermansstraat 97, B-3000 Leuven, Belgium
From Python to silicon:
http://myhdl.jandecaluwe.com
|
|
From: Blubaugh, D. A. <dbl...@be...> - 2008-03-20 20:10:40
|
> Would anyone know as to how to develop floating point support for the > MyHDL module? Has anyone worked with any alternative versions of the > IEEE standard for floating -point? Also, has anyone developed a > floating-point library for a module within the python environment in > order to execute numerical computations. I would imagine since I am > translating python to verilog by using MyHDL , that I will have to > develop the floating-point support module in python source code as > well ?? I believe this is what will be required in order to develop floating-point capable algorithms within Verilog. If I can develop this one feature from MyHDL, it would allow this module to be fairly competitive with commercial products. > Thanks, > > David Blubaugh This e-mail transmission contains information that is confidential and may be privileged. It is intended only for the addressee(s) named above. If you receive this e-mail in error, please do not read, copy or disseminate it in any manner. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this information is prohibited. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please erase it from your computer system. Your assistance in correcting this error is appreciated. |
|
From: <hma...@fr...> - 2008-03-20 16:53:44
|
Hi, I'm wondering if/how MyHDL could be used as an ESL language for system simulations "a la" SystemC but without the burden of C++ ? I'd like to make simulations of a system on chip (simulate traffic on an interconnection micronetwork from several initiators like CPU, DSP, DMA, etc... and dimension accordingly memory bit width, latencies, FIFO sizes, etc...). I'm aware speed might be an issue depending on teh level of modeling used, but for a high-level TLM I'm not scared a priori. It strikes me that Python should be used for ESL, andif MyHDL for some reason is not suitable, at least the same generator mechanism could be reused. Obviously, the Verilog converter is of lesser interest in this case. May be a SystemC converter .. ? Any comment ? Regards, Hervé |
|
From: Jan D. <ja...@ja...> - 2008-03-18 21:23:44
|
Development version 0.6dev7 is available from here:
http://myhdl.jandecaluwe.com/doku.php/dev:snapshots#snapshots
* All outstanding bugs have been addressed and changed to "Pending" status.
* issue with bit inversion on intbv's addressed, as discussed recently in
the mailing list.
Jan
--
Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com
Kaboutermansstraat 97, B-3000 Leuven, Belgium
From Python to silicon:
http://myhdl.jandecaluwe.com
|
|
From: Jan D. <ja...@ja...> - 2008-03-17 20:16:29
|
For the next development release I want to address all outstanding bug requests. I have implemented a satisfactory fix for all of them except one, and I'd like to make everyone aware of this. The problem is that conversion flattens hierarchy, and signals get renamed to have a "global" name that is non-conflicting among themselves. However, those new names may conflict with "local" names from variables within generators/processes/always blocks. This issue is not detected in current releases. The way to solve this would be to change local names if necessary. However, this is not so trivial. Moreover, there are other naming issues (e.g. VHDL and Verilog keywords are not detected at this moment) so this calls for a general solution that solves all naming issues at once. But there's no time to do that now. So what I have implemented is simply to detect the situation and flag it as an "error". This is not satisfactory, but at least you'll get an early warning. The bug report in question lives here: http://sourceforge.net/tracker/index.php?func=detail&aid=1837003&group_id=91207&atid=596332 Regards, Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
|
From: Kanchan D. <kan...@gm...> - 2008-03-11 17:00:36
|
I had been running cosimulation with icarus but discovered that certain features (such as arrays of nets) are not supported by icarus. My verilog code (with arrays of nets) does work with Modelsim though. Hence I was wondering if anyone has worked on cosimulation using Modelsim, and if not, could I get some pointers as to how I should start modifying the PLI so that I can cosimulate using Modelsim? Thanks Kanchan |
|
From: Jan D. <ja...@ja...> - 2008-03-09 16:41:17
|
Jan Decaluwe wrote: > Conclusion > ---------- > > The drawback of the "Pure Python" solution is probably fatal > for practical purposes. Therefore, I propose to keep the > "Practical Hardware" solution. I have implemented this, including conversion support for Verilog and VHDL. This will be included in the upcoming development release 0.6dev7. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
|
From: Jan D. <ja...@ja...> - 2008-03-04 16:12:28
|
Christopher L. Felton wrote: > If I am following, the "Practical Hardware" solution is the proposal, > but it has the "disturbing" attribute (operate(s) having to look at > the constraints). > The solution will include the positive and negative intbv (as far as > the ~ operator goes)? Yes. -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
|
From: Christopher L. F. <cf...@uc...> - 2008-03-04 15:04:22
|
On Mar 3, 2008, at 10:55 AM, Jan Decaluwe wrote: > Ok, let's try to reach a decision. > > I believe there are 2 solutions that can be defended. > > Possible solutions > ------------------ > > 1) "Pure Python" > Bit inversion for intbv's behaves like for Python int's. > > 2) "Practical Hardware" > Make an exception for intbv's whose allowed values are > a finite set of positive values. Let's call these p-intbv's. > For a p-intbv, bits outside the bit range of an unsigned > representation, are assumed to remain zero upon bit-inversion. > > Analysis > -------- > Both solutions have advantages and drawbacks. > > The major drawback of the "Pure Python" solution is that it > may be counter-intuitive to hardware designers. Many designs > mainly use p-intbvs, e.g. created by the form intbv(0)[n:]. > But with this solution it would not be possible to represent > the bit-inversion of a p-intbv by another p-intbv. Negative > values would have to be introduced just for this purpose. > > The major drawback of the "Practical Hardware" solution is > that the result of a bit-inversion would not just depend > on the intbv value, but also on its constraints. It is the > only operator for which this would be so. This is disturbing. > > Conclusion > ---------- > > The drawback of the "Pure Python" solution is probably fatal > for practical purposes. Therefore, I propose to keep the > "Practical Hardware" solution. This is in line with the > feedback from this thread thus far. If I am following, the "Practical Hardware" solution is the proposal, but it has the "disturbing" attribute (operate(s) having to look at the constraints). The solution will include the positive and negative intbv (as far as the ~ operator goes)? I agree with the "disturbing" to a new user it may not be clear why or how a negative number is represented. And it also falls out of the standard implementation (kinda a kludge). Overall I think it is a fair compromise / solution. > > > Jan > > -- > Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com > Kaboutermansstraat 97, B-3000 Leuven, Belgium > From Python to silicon: > http://myhdl.jandecaluwe.com > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list |
|
From: Jan D. <ja...@ja...> - 2008-03-03 17:51:59
|
Ok, let's try to reach a decision. I believe there are 2 solutions that can be defended. Possible solutions ------------------ 1) "Pure Python" Bit inversion for intbv's behaves like for Python int's. 2) "Practical Hardware" Make an exception for intbv's whose allowed values are a finite set of positive values. Let's call these p-intbv's. For a p-intbv, bits outside the bit range of an unsigned representation, are assumed to remain zero upon bit-inversion. Analysis -------- Both solutions have advantages and drawbacks. The major drawback of the "Pure Python" solution is that it may be counter-intuitive to hardware designers. Many designs mainly use p-intbvs, e.g. created by the form intbv(0)[n:]. But with this solution it would not be possible to represent the bit-inversion of a p-intbv by another p-intbv. Negative values would have to be introduced just for this purpose. The major drawback of the "Practical Hardware" solution is that the result of a bit-inversion would not just depend on the intbv value, but also on its constraints. It is the only operator for which this would be so. This is disturbing. Conclusion ---------- The drawback of the "Pure Python" solution is probably fatal for practical purposes. Therefore, I propose to keep the "Practical Hardware" solution. This is in line with the feedback from this thread thus far. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
|
From: Tom D. <TD...@di...> - 2008-02-28 22:11:16
|
On Thursday 28 February 2008 03:36:37 pm Jan Decaluwe wrote: > Tom Dillon wrote: > > I don't think the sliced result gets ._nrbits .min or .max set. > > > > I think it should, at least for clarification. > > Actually a slice returns a new intbv with _nrbits, min and max set. > (this is the idiomatic way to create an "unsigned", hardware-oriented > intbv). > sorry, I misunderstood the example I ran to come to the conclusion they weren't set. I was wrong, it seems fine to me the way it is. |
|
From: Jan D. <ja...@ja...> - 2008-02-28 21:32:15
|
Tom Dillon wrote:
> I don't think the sliced result gets ._nrbits .min or .max set.
>
> I think it should, at least for clarification.
Actually a slice returns a new intbv with _nrbits, min and max set.
(this is the idiomatic way to create an "unsigned", hardware-oriented
intbv).
But it is the only operator that does this. All others currently
return unsized intbv's or even int's.
This is usually not an issue, because the idiomiatic MyHDL usage
for updates is:
for intbv's:
a[m:n] = <expression>
in particular, to set a new value:
a[:] = <expression>
and for signals:
s.next = <expression>
Therefore, I don't need to look at the right-hand expression to derive
a bit width. In this way, all issues with this as in VHDL and especially
Verilog are simply avoided. And of course I can optimize a little
(and keep it simple) by not worrying about setting bit widths on operator
results. Last but not least, I don't think that conversion to VHDL or
Verilog would otherwise be feasible.
Jan
--
Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com
Kaboutermansstraat 97, B-3000 Leuven, Belgium
From Python to silicon:
http://myhdl.jandecaluwe.com
|
|
From: Jan D. <ja...@ja...> - 2008-02-28 21:12:50
|
Christopher L. Felton wrote: > Is the following expected behavior? > >> >> y = intbv(15)[4:] >> >> ~y > intbv(0L) >> >> z = ~y >> >> z._nrbits > 0 >> >> > > The new number of bits is 0? Now you know why it's a private variable :-) Seriously, I use 0 (False) to indicate that the nr of bits is undefined. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
|
From: Christopher L. F. <cf...@uc...> - 2008-02-28 14:49:10
|
Here is a possible enhancement,
from _intbv.py around line 407
<<code>>
def __invert__(self):
if self._nrbits:
if self._min < 0:
return intbv(~self._val, min=self._min, max=self._max)
else:
return intbv(~self._val & (1L << self._nrbits)-1)
else:
return intbv(~self._val)
<<>>
I ran the test scripts, it didn't break anything. Also the sequential
mult that I sent works with the 2's comp flip.
On Feb 28, 2008, at 7:00 AM, Christopher L. Felton wrote:
> Is the following expected behavior?
>
> >>> y = intbv(15)[4:]
> >>> ~y
> intbv(0L)
> >>> z = ~y
> >>> z._nrbits
> 0
> >>>
>
> The new number of bits is 0? I think in normal case this is fine
> because usually it would be Signal.next, and the Signal type
> wouldn't be overridden only the value?
>
>
> On Feb 27, 2008, at 2:41 PM, Tom Dillon wrote:
>
>> Jan,
>>
>> On Wednesday 27 February 2008 02:33:57 pm Jan Decaluwe wrote:
>>
>>>>
>>>> intbv(5)[3:] is unsigned, so I think 2L is the right answer.
>>>
>>> That's not how I think about it. (Warning: this may get subtle.)
>>> To me, intbv(5)[3:] is simply intbv(5) with constraints on the
>>> allowed
>>> values. If the constraints are such that the value must be positive,
>>> then we can choose to represent such an intbv as an unsigned in
>>> another language such as Verilog or VHDL. An optimization really.
>>
>> yes, I agree with you thinking there. I was thinking the slice
>> would produce an unsigned intbv, but
>> of course that is wrong.
>>
>> I think it has to make sense and be as simple as possible in MyHDL
>> and force the translation to
>> Verilog or VHDL to produce the same results.
>>
>>>
>>> On the other hand, I see your point of course. We should be
>>> practical. I have to think further, there may be compromise
>>> solutions.
>>>
>>> In any case, there really is something wrong. Consider:
>>>>>> ~intbv(5, min=-6, max=6)
>>>
>>> intbv(10L)
>>
>> What about ~intbv(5,min=0, max=15)?
>>
>> intbv(10L)
>>
>> I think that is correct.
>>
>> Tom
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> myhdl-list mailing list
>> myh...@li...
>> https://lists.sourceforge.net/lists/listinfo/myhdl-list
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
> myhdl-list mailing list
> myh...@li...
> https://lists.sourceforge.net/lists/listinfo/myhdl-list
|
|
From: Tom D. <TD...@di...> - 2008-02-28 14:49:10
|
I don't think the sliced result gets ._nrbits .min or .max set. I think it should, at least for clarification. Tom On Thursday 28 February 2008 08:00:24 am Christopher L. Felton wrote: > Is the following expected behavior? > > >>> y = intbv(15)[4:] > >>> ~y > > intbv(0L) > > >>> z = ~y > >>> z._nrbits > > 0 > > > The new number of bits is 0? I think in normal case this is fine > because usually it would be Signal.next, and the Signal type wouldn't > be overridden only the value? > > On Feb 27, 2008, at 2:41 PM, Tom Dillon wrote: > > Jan, > > > > On Wednesday 27 February 2008 02:33:57 pm Jan Decaluwe wrote: > >>> intbv(5)[3:] is unsigned, so I think 2L is the right answer. > >> > >> That's not how I think about it. (Warning: this may get subtle.) > >> To me, intbv(5)[3:] is simply intbv(5) with constraints on the > >> allowed > >> values. If the constraints are such that the value must be positive, > >> then we can choose to represent such an intbv as an unsigned in > >> another language such as Verilog or VHDL. An optimization really. > > > > yes, I agree with you thinking there. I was thinking the slice would > > produce an unsigned intbv, but > > of course that is wrong. > > > > I think it has to make sense and be as simple as possible in MyHDL > > and force the translation to > > Verilog or VHDL to produce the same results. > > > >> On the other hand, I see your point of course. We should be > >> practical. I have to think further, there may be compromise > >> solutions. > >> > >> In any case, there really is something wrong. Consider: > >>>>> ~intbv(5, min=-6, max=6) > >> > >> intbv(10L) > > > > What about ~intbv(5,min=0, max=15)? > > > > intbv(10L) > > > > I think that is correct. > > > > Tom > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > myhdl-list mailing list > > myh...@li... > > https://lists.sourceforge.net/lists/listinfo/myhdl-list |
|
From: Christopher L. F. <cf...@uc...> - 2008-02-28 14:00:27
|
Is the following expected behavior? >>> y = intbv(15)[4:] >>> ~y intbv(0L) >>> z = ~y >>> z._nrbits 0 >>> The new number of bits is 0? I think in normal case this is fine because usually it would be Signal.next, and the Signal type wouldn't be overridden only the value? On Feb 27, 2008, at 2:41 PM, Tom Dillon wrote: > Jan, > > On Wednesday 27 February 2008 02:33:57 pm Jan Decaluwe wrote: > >>> >>> intbv(5)[3:] is unsigned, so I think 2L is the right answer. >> >> That's not how I think about it. (Warning: this may get subtle.) >> To me, intbv(5)[3:] is simply intbv(5) with constraints on the >> allowed >> values. If the constraints are such that the value must be positive, >> then we can choose to represent such an intbv as an unsigned in >> another language such as Verilog or VHDL. An optimization really. > > yes, I agree with you thinking there. I was thinking the slice would > produce an unsigned intbv, but > of course that is wrong. > > I think it has to make sense and be as simple as possible in MyHDL > and force the translation to > Verilog or VHDL to produce the same results. > >> >> On the other hand, I see your point of course. We should be >> practical. I have to think further, there may be compromise >> solutions. >> >> In any case, there really is something wrong. Consider: >>>>> ~intbv(5, min=-6, max=6) >> >> intbv(10L) > > What about ~intbv(5,min=0, max=15)? > > intbv(10L) > > I think that is correct. > > Tom > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list |
|
From: Christopher L. F. <cf...@uc...> - 2008-02-28 13:55:37
|
Does this make sense, and is it possible (easily possible)
intbv(5) -> signed, because this is consistent with
default python as you showed
default min=-??, default max=??
intbv(5)[4:] -> unsigned, has the feel of
Verilog/VHDL bit-vectors
default min=0, default max=16
intbv(5, min=0, max=15) -> unsigned because explicitly defined no
min
intbv(5, min=-8, max=7) -> signed because explicitly defined min
intbv(5, min=-8, max=7)[4:] -> ??
>>> x = intbv(5, min=-8, max=7)[4:]
>>> x
intbv(5L)
>>> dir(x)
>>> x._nrbits
4
>>> x._val
5L
>>> x.max
16
>>> x.min
0
>>>
Think the above would be somewhat straight forward, since the last
example shows that the [4:] syntax overrides the min.
Chris
On Feb 27, 2008, at 1:33 PM, Jan Decaluwe wrote:
>
>>>> ~intbv(5, min=-6, max=6)
> intbv(10L)
>
> This intbv would have to be represented by a signed in a target
> language, yet bitwise inversion still returns a positive number
> with the current implementation. As a miminum, this should be
> fixed - if someone disagrees, let me know.
>
> Jan
>
> --
> Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com
> Kaboutermansstraat 97, B-3000 Leuven, Belgium
> From Python to silicon:
> http://myhdl.jandecaluwe.com
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> myhdl-list mailing list
> myh...@li...
> https://lists.sourceforge.net/lists/listinfo/myhdl-list
|
|
From: Christopher F. <cf...@uc...> - 2008-02-27 23:55:34
|
> In any case, there really is something wrong. Consider: > > >>> ~intbv(5, min=-6, max=6) > intbv(10L) > > This intbv would have to be represented by a signed in a target > language, yet bitwise inversion still returns a positive number > with the current implementation. As a miminum, this should be > fixed - if someone disagrees, let me know. I agree, we are representing 2 types (at least in Verilog speak) with intbv. Unsigned bit vectors and signed bit vectors. As you pointed out we need to determine what is the correct usage given the context. As Tom pointed out for the bit vector that would be the expected value but for a signed bit vector value you will run into the problem above. Thanks! |
|
From: Tom D. <TD...@di...> - 2008-02-27 21:42:19
|
Jan, On Wednesday 27 February 2008 02:33:57 pm Jan Decaluwe wrote: > > > > intbv(5)[3:] is unsigned, so I think 2L is the right answer. > > That's not how I think about it. (Warning: this may get subtle.) > To me, intbv(5)[3:] is simply intbv(5) with constraints on the allowed > values. If the constraints are such that the value must be positive, > then we can choose to represent such an intbv as an unsigned in > another language such as Verilog or VHDL. An optimization really. yes, I agree with you thinking there. I was thinking the slice would produce an unsigned intbv, but of course that is wrong. I think it has to make sense and be as simple as possible in MyHDL and force the translation to Verilog or VHDL to produce the same results. > > On the other hand, I see your point of course. We should be > practical. I have to think further, there may be compromise solutions. > > In any case, there really is something wrong. Consider: > >>> ~intbv(5, min=-6, max=6) > > intbv(10L) What about ~intbv(5,min=0, max=15)? intbv(10L) I think that is correct. Tom |
|
From: Jan D. <ja...@ja...> - 2008-02-27 20:29:35
|
Tom Dillon wrote: > I'm not sure there is anything wrong, although I may not fully understand... > > On Wednesday 27 February 2008 10:06:33 am Jan Decaluwe wrote: > >>Chris Felton has recently signalled an issue with bit-wise >>inversion. Hereby an analysis. >> >>Consider the following interpreter log: >> >>> from myhdl import * >> >>> ~5 >>-6 > > That is because a python int is signed, right? > >> >>> ~intbv(5) >>intbv(-6) > > default intbv must be signed as well. > >> >>> ~intbv(5)[3:] >>intbv(2L) > > intbv(5)[3:] is unsigned, so I think 2L is the right answer. That's not how I think about it. (Warning: this may get subtle.) To me, intbv(5)[3:] is simply intbv(5) with constraints on the allowed values. If the constraints are such that the value must be positive, then we can choose to represent such an intbv as an unsigned in another language such as Verilog or VHDL. An optimization really. On the other hand, I see your point of course. We should be practical. I have to think further, there may be compromise solutions. In any case, there really is something wrong. Consider: >>> ~intbv(5, min=-6, max=6) intbv(10L) This intbv would have to be represented by a signed in a target language, yet bitwise inversion still returns a positive number with the current implementation. As a miminum, this should be fixed - if someone disagrees, let me know. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
|
From: Tom D. <TD...@di...> - 2008-02-27 16:48:52
|
Hi, I'm not sure there is anything wrong, although I may not fully understand... On Wednesday 27 February 2008 10:06:33 am Jan Decaluwe wrote: > Chris Felton has recently signalled an issue with bit-wise > inversion. Hereby an analysis. > > Consider the following interpreter log: > >>> from myhdl import * > >>> ~5 > -6 That is because a python int is signed, right? > > >>> ~intbv(5) > intbv(-6) default intbv must be signed as well. > > >>> ~intbv(5)[3:] >intbv(2L) intbv(5)[3:] is unsigned, so I think 2L is the right answer. I would not expect a unsigned to get changed to signed with the ~ operator. So I think the only question is should intbv(5)[3:] result in a signed or unsigned result? I don't know if I would use Verilog as the guideline for how anything signed should work, as the Verilog rules are fairly complicated (overly I think). Tom |
|
From: Jan D. <ja...@ja...> - 2008-02-27 16:02:08
|
Chris Felton has recently signalled an issue with bit-wise inversion. Hereby an analysis. Consider the following interpreter log: >>> from myhdl import * >>> ~5 -6 >>> ~intbv(5) intbv(-6) >>> ~intbv(5)[3:] intbv(2L) You can see that an "unsized" intbv behaves like an int, but a "sized" intbv behaves differently. Obviously confusing. Why is this? The answer is in the original support for conversion to Verilog and VHDL. Originally, only unsigned values were supported. But in Verilog and VHDL those don't behave like a Python int: bit-wise inversion of an unsigned (and therefore positive) number still returns a positive number. In contrast, the sign of an int is always changed upon bit-wise inversion. I modified the behavior of sized intbv's to mimic Verilog behavior. In this way the original convertor could support bit-wise inversion without signed/unsigned machinery. This behavior has not been changed since. Looking at this now, I think it is wrong. A sized intbv should also behave like a Python int. So I think the current behavior should be changed. The convertor should cast unsigned arguments to signed, to get the desired result (hopefully, to be checked). This would imply a backward-incompatible change of intbv behavior (but it could be viewed as a bug fix). So please review this carefully and give feedback if necessary. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
|
From: Jan D. <ja...@ja...> - 2008-02-27 11:10:12
|
Leonardo Laguna Ruiz wrote:
> Hi!
>
> I'm trying to make a block with an undefined number of inputs and outputs.
> An example is shown below. This in simulation works fine, and in the verilog
> conversion the only thing that does not work is that the 'us' and 'ds' ports
> are not defined.
>
> Is there any way to explicitly declare that a module has the ports 'us' and
> 'ds', and these are arrays of bool signals ?????
Unfortunately no, the problem is how to map these to Verilog ports.
However, this restriction only applies to the very top-level - for internal
modules you can use list of signals and convert to Verilog.
You may want to read the following cookbook design report; it deals with
these issues (and other ones) explicitly:
http://myhdl.jandecaluwe.com/doku.php/cookbook:bitonic
Jan
--
Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com
Kaboutermansstraat 97, B-3000 Leuven, Belgium
From Python to silicon:
http://myhdl.jandecaluwe.com
|