Is it a valid and synthesizeable VHDL code?
case IR(10 downto 7) is -- RD
when "0000" => R0 <= RTA;
when "0001" => R1 <= RTA;
when "0010" => R2 <= RTA;
when "0011" => R3 <= RTA;
when "0100" => R4 <= RTA;
when "0101" => R5 <= RTA;
when "0110" => R6 <= RTA;
when "0111" => R7 <= RTA;
when "1000" => R8 <= RTA;
when "1001" => R9 <= RTA;
when "1010" => R10 <= RTA;
when "1011" => R11 <= RTA;
when "1100" => R12 <= RTA;
when "1101" => R13 <= RTA;
when "1110" => R14 <= RTA;
when "1111" => R15 <= RTA;
when others => null ;
end case;
As you see in each case the output signal is different: R0, R1, R2, etc. I thought maybe I have to put all the outputs in each case; Something like this:
case IR(10 downto 7) is -- RD
when "0000" =>
R0 <= RTA;
R1 <= 0; -- The problem here is that I don't want R1 to be 0
-- but to retain its previous value
R2 <= 0;
R3 <= 0;
R4 <= 0;
R5 <= 0;
R6 <= 0;
R7 <= 0;
R8 <= 0;
R9 <= 0;
R10 <= 0;
R11 <= 0;
R12 <= 0;
R13 <= 0;
R14 <= 0;
R15 <= 0;
when "0001" =>
R0 <= 0;
R1 <= RTA;
R2 <= 0;
R3 <= 0;
R4 <= 0;
R5 <= 0;
R6 <= 0;
R7 <= 0;
R8 <= 0;
R9 <= 0;
R10 <= 0;
R11 <= 0;
R12 <= 0;
R13 <= 0;
R14 <= 0;
R15 <= 0;
.
.
.
when others => null ;
end case;
If I don't have all the outputs (R0 to R15) into each case the VHDL compiler gives me a warning: "Found 1-bit latch for signal . Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems."
I need to get rid of this warning.