Verilog has very well defined behavior when using mixed types, although
unlike VHDL it doesn't require explicit conversion funcions or
libraries. The standard should require that a genvar which is not
otherwised sized or typed will be an integer (32-bits signed). That's
why the two additional warnings bothered me. i.e. there should have
been no need to go from signed to unsigned when using BITWIDTH with
these genvars. One possibility is that parameter BITWIDTH, which
should have taken on the integer type due to the assignment to an
integer constant, was actually given an unsigned type by the
compiler. In any case, since the values are all positive, there
would be no reason for any change in behavior due to the signed to
unsigned conversion regardless of where it actually happened. And
of course the fact that the lines referenced by the warnings had no
actual code in them (just ends) makes it hard to tell where the
conversion occured.
> The other warning about the compiler not working the same as earlier
> versions is one that I don't need to see every time I compile a file.
> The VHDL tools I use do similar things and the P&R tools generate lots
> of warnings that have nothing to do with my code. Synthesis generates
> modules for the FPGA that include unneeded outputs, like a carry on an
> adder. When the P&R tools strips them out it generates warnings as if
> some of your own code is being stripped out. A royal PITA to check
> every time. Warnings are there for a reason and need to be checked. If
> it warns me something I didn't ask for was taken out, that is of no value.
>
The warning that remains about the compiler versions is probably
appropriate if there were a lot of designs that relied on the
previous incorrect compiler behavior, especially since it would
potentially change the behavior of the synthesized logic. One
would hope that future versions would remove this warning. Xilinx
would call this an "info" rather than a warning.
Xilinx tools, which also do what you describe (adding their own stuff
and later stripping it out with warnings) at least allow you to filter
warnings that you've already seen, so you don't need to go through
the whole list on the next build.
--
Gabor