다음 코드에서 정수 값 1로 cipher_temp2를 초기화했습니다. 그러나 코드를 시뮬레이트 할 때 cipher_temp2의 값이 0 대신 초기화됩니다. 나는 내가 어디로 잘못되었는지 알아낼 수 없다.신호가 VHDL에서 정수 값으로 초기화 할 수 없습니다.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity ciphercalculation is
Port (Msg_temp2 : in integer;
cipher : out integer);
end ciphercalculation;
architecture Behavioral of ciphercalculation is
CONSTANT e1: std_logic_vector(0 TO 2) := ('1', '0', '1');
CONSTANT Pk:integer:=377;
CONSTANT le:integer:=2;
Signal cipher_temp2:integer:=1;
begin
process(cipher_temp2,Msg_temp2)
begin
for i in 0 to le loop
if (e1(i)= '0') then
cipher_temp2<=((cipher_temp2*cipher_temp2) mod Pk);
else
cipher_temp2<=((cipher_temp2*cipher_temp2) mod Pk);
cipher_temp2<=((cipher_temp2*Msg_temp2)mod Pk);
end if;
end loop;
cipher<=cipher_temp2;
end process;
end Behavioral;
이 것을 보여주는 최소 테스트 벤치 게시. 또한 사용중인 시뮬레이터/버전을 언급하십시오. ghdl에서 나는 그것이 1로 초기화되는 것을 본다. 그 다음 프로세스는 활성화되고 340으로 설정되고 0으로 설정된다. –
http://imgur.com/a/B2Lgj 여기 시뮬레이션의 스크린 샷입니다. 나는 비바도 (Vivado)를 사용했다. 2014.4 –
그리고 내가 설명했듯이 그것은 당신이 볼 필요가있는 것을 쌓아 두지 않을 것이다. –