R
rickman
Guest
On Nov 9, 4:06 am, Jan Decaluwe <j...@jandecaluwe.com> wrote:
allows the use of integers to replace all data types... I tried using
Boolean for some control signals as this simplifies expressions in
conditionals. But in simulation Boolean signals are displayed as a
value like an integer which is a PITA. A std_logic signal is
displayed as a line with two levels and is very easy to see rather
than having to read a value which can be off the display.
vendor may need that. The synthesis tool is designed for the target.
If it works better to represent integers as signed magnitude then the
synthesis tool can do that without my involvement or knowledge. How
would you allow a synthesis tool to optimize for a given target
implementation if the representation is fixed? By requiring the tool
to work one way when the bit representation is accessed and a
different way when it is not sounds like a complexity that could cause
problems for users.
Maybe that is not really important. I know it is an issue in the
software world, but in FPGAs and ASICs I can't think of an example
where the number representation is anything other than 2's
complement. But I don't see it helping with any problems unless you
can replace all data types with integers.
Rick
I don't see where it would solve the problems I have seen unless itrickman wrote:
On Nov 5, 1:23 pm, Jan Decaluwe <j...@jandecaluwe.com> wrote:
I don't see what you are referring to here. It can't be Python/MyHDL's
actual choice, because that is the same as VHDL/Verilog for signed, and
probably any VHDL synthesis tool for integer.
I think I have no idea what you are saying with this. What Python
does with integers has no bearing on what VHDL does. So what is your
point about mentioning Python?
I try to convince people to take a good look at Python/MyHDL integers
and possibly consider to do it similarly in a future VHDL standard.
Agreed, you complained about the consequences of VHDL's strong
typing system. But that's what I intended to refer to also.
Again, I have no idea why you are bringing this up. How does it
pertain to the discussion?
The ideas I'm proposing would solve many of the VHDL usability
issues that we are all struggling with, including the OP and
you as I understood it, when you announced that you'd rather
switch (to Verilog) than fight (with VHDL).
allows the use of integers to replace all data types... I tried using
Boolean for some control signals as this simplifies expressions in
conditionals. But in simulation Boolean signals are displayed as a
value like an integer which is a PITA. A std_logic signal is
displayed as a line with two levels and is very easy to see rather
than having to read a value which can be off the display.
representationThat's what I mean, yes: strong typing and abstract types without
an implied representation, such as VHDL's boolean, enum and
integer. I'm personally all for it in general, but not for the
case of integer. Sometimes practicality beats purity.
Ok, you have stated your preference, but you have not given any basis
ccc> > for it. In general a given type does not have an
I don't need control over the representation of integers. But my toolimplied so that it can be implemented in the manner that suits the
application the best. Although 2's complement is pretty universal, it
is not the only way to use integers. Do you think it is worth
eliminating the use of integers for any other representation by
specifying one representation in the standard? I guess I know the
answer to that one. But you can see where this is a problem for some
usage that others may want, no?
No, I don't think there is a problem.
Imagine an integer type with an "accessible" 2's complement representation.
A synthesis tool only has to honour that when the representation is
actually "accessed" in the code, something which is easy for a tool to
detect. Otherwise, it could implement it with any optimized representation it
chooses. The latter case is equivalent to the current situation, with an
"inaccessible" representation. In other words, this would be a backwards
compatible enhancement.
If you need full control over representation, you'd have to do it like
today: use bit vectors with dedicated logic, and interprete the bit
vector values as numbers yourself.
vendor may need that. The synthesis tool is designed for the target.
If it works better to represent integers as signed magnitude then the
synthesis tool can do that without my involvement or knowledge. How
would you allow a synthesis tool to optimize for a given target
implementation if the representation is fixed? By requiring the tool
to work one way when the bit representation is accessed and a
different way when it is not sounds like a complexity that could cause
problems for users.
Maybe that is not really important. I know it is an issue in the
software world, but in FPGAs and ASICs I can't think of an example
where the number representation is anything other than 2's
complement. But I don't see it helping with any problems unless you
can replace all data types with integers.
Rick