Altera_Forum
Honored Contributor
16 years agoVHDL Strange Behavior
Hello,
I need to calculate the average between 4 std_logic_vectors: "A, B, C and D". When I simulate my code in modelsim everything seems to be OK:cool:. But, When I test it in the FPGA :confused: the output is corrupted. The strange thing is that if I calculate the average between A and B the output is ok. The same If I calculate the average between C and D the output is ok. The same If I calculate the average between A and C the output is ok. The same If I calculate the average between B and D the output is ok. I suspect is something relationated with the FAN OUT. I verified each signal, and she is ok, but if I use the 4 at the same time :mad: it fails. In my code I have 2 process: one combinational and one sequential. --------------------------COMBINATORIE----------------------- PROCESS(A30022, B30022, C30022, D30022) IS BEGIN aux_pij <= (B"00" & A30022)+(B"00" & B30022)+ (B"00" & C30022)+(B"00" & D30022); END PROCESS; --------------------------SEQUENTIAL------------------------- PROCESS(reset_n,clk) IS BEGIN if reset_n = '0' then pij <= (others =>'0'); elsif clk'EVENT AND clk = '1' THEN pij <= aux_pij(9 downto 2); end if; END PROCESS; ------------------------------------------------------------- Here I will attach the complete VHDL file. Thank you in advance. Cordially, DABG