RRomano001
Contributor
7 years agoIs "If elsif else" in this case errant?
I am trying to convert an Open Core from Verilog to VHDL, doing this I converted one to one modules then cheked them till code work by step.
After last packet conversion, (transmit logic) I seen a strange behaviour, If condition then .. elsif (not true)
execute elsif statement also if not true, is this correct and am wrong interpreting if syntax or quartus version s wrong?
I am observing a lot of strange errant on my IP cores...
packet type is this case (LA checked) UDP, so it must respond 0x11:
this code load paket data with val x11
if Local_IsARP = '1' then
Local_pkt_data<= HostMAC(39 downto 32); -- ARP
else
if SendPacketType = IPPKT_ICMPReply then
Local_pkt_data<= 8x"01"; -- ICMP Reply
else
Local_pkt_data<= 8x"11"; -- ICMP/UDP/TCP
end if;
end if;this code load paket data with val 01
if Local_IsARP = '1' then
Local_pkt_data<= HostMAC(39 downto 32); -- ARP
elsif SendPacketType = IPPKT_ICMPReply then
Local_pkt_data<= 8x"01"; -- ICMP Reply
else
Local_pkt_data<= 8x"11"; -- ICMP/UDP/TCP
end if;Packet type is set to UDP or 01
constants are here:
--- *** ***** **** **** *** *** *** -------------
-- USAGE --
--- *** ***** **** **** *** *** *** -------------
--library work;
--use work.package_ipconstants.all;
--- *** ***** **** **** *** *** *** -------------
library ieee;
use ieee.std_logic_1164.all;
-- Package Declaration Section
package package_ipconstants is
-- constant c_PIXELS : integer := 65536;
-- Packet Types
constant IPPKT_Unknown : Std_logic_vector(2 downto 0) := 3x"0";
constant IPPKT_UDP : Std_logic_vector(2 downto 0) := 3x"1";
constant IPPKT_ARPReq : Std_logic_vector(2 downto 0) := 3x"2";
constant IPPKT_ARPReply : Std_logic_vector(2 downto 0) := 3x"3";
constant IPPKT_ICMPReq : Std_logic_vector(2 downto 0) := 3x"4";
constant IPPKT_ICMPReply : Std_logic_vector(2 downto 0) := 3x"5";
-- constant IPPKT_new : Std_logic_vector(3 downto 0) := 3x"0";
--// Commands
constant IPPKT_CmdDone : Std_logic_vector(7 downto 0) := 8x"0";
constant IPPKT_CmdStatus : Std_logic_vector(7 downto 0) := 8x"1";
constant IPPKT_CmdLEDCtrl : Std_logic_vector(7 downto 0) := 8x"2";
constant IPPKT_CmdSetConfig : Std_logic_vector(7 downto 0) := 8x"3";
constant IPPKT_CmdSwChanged : Std_logic_vector(7 downto 0) := 8x"4";
constant IPPKT_CmdDataEcho : Std_logic_vector(7 downto 0) := 8x"5";regards
Roberto