On 25/11/15 12:37, why...@f-cpu.org wrote:
Le 2015-11-25 12:00, KIMURA Masaru a écrit :
I have the range of 32 bit.
My range is 0x00000000 to 0xFFFFFFFF
0...2^32-1
This is the "normal" range for computers,
for at least 25 years, so it shouldn't create
any problem... "normally". But VHDL is not "normal".
No, that's not correct. VHDL has just only signed types and
no unsigned types.
Then you'd need unsigned integers. Does VHDL have those?
No, VHDL integer types are always signed.
FYI, and you may know, but i've not tested actually,
some closed source VHDL simulators (such as Aldec Riviera-PRO) have relax
options (e.g. integer range), IIRC.
consider to introduce these kind of relax options to GHDL?
That would be good, I would appreciate it too.
It seems to me that VHDL was designed in such a conservative way
that it *could* work on 1-complement machines that had not
disappeared yet in the 1980s (but were already old, expensive
relics from the 60s). They wanted VHDL to work "everywhere"
and now it wouldn't work well anywhere...
Maybe, but this is also the case for C.
My struggle to get boolean integer operations adopted is
one example of a perfectly fine, natural and easy operation
that is not provided "because you can do it the hard, slow way".
I am not sure this is really related.
The good news is that I have barely seen the 2^31 range
enforced in GHDL, as long as you don't perform computations
in VHDL domain, use VHPI and C code instead...
I am not sure to understand what you are saying.
There are no range checks for Integer, unless there is a type
conversion. That's because standard.Integer is represented
on 32 bit and the range cover all the bits.
Tristan.
_______________________________________________
Ghdl-discuss mailing list
Ghdl-discuss@gna.org
https://mail.gna.org/listinfo/ghdl-discuss