Modelsim vs Xilinx
I use modelsim to develop my VHDL modules and testbenches. And then create components in Xillinx (Vivado/Vitus).
I have had a couple of cases where using integer instead of (un)singed would behave differently in my testbench than on hardware (Hardware gives no timing issues).
replace
signal sync0_ave, sync1_ave : integer := 0;
with
signal sync0_ave, sync1_ave : unsigned(31 downto 0) := (others => '0');
and then
sync0_ave <= sync0_ave + to_integer(unsigned(reg_rdata_array(REG_VAUX0)));
sync1_ave <= sync1_ave + to_integer(unsigned(reg_rdata_array(REG_VAUX1)));
with
sync0_ave <= sync0_ave + unsigned(reg_rdata_array(REG_VAUX0));
sync1_ave <= sync1_ave + unsigned(reg_rdata_array(REG_VAUX1));
The latter would give the result expected on hardware. BOTH gives the same result in test bench.
Is there something I am missing?