Guest
Can sombody tell me if the code below is vhdl 93 compliant or not.
Most of the compilers doesn't accept it but this doesn't mean that is
not vhdl 93 compliant.
Ncvhdl/ncsim (from cadence) for example accept it.
The problem of this code is that a type convertion is performed on an
unconstrained output in a port map,
I don't know if it's correct or not.
------------------------------------------------------
-- file add_unconstrained.vhd
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY add_unconstrained IS
PORT (
sample_in1 : IN unsigned;
sample_in2 : IN unsigned;
sample_out : OUT unsigned
);
END add_unconstrained;
ARCHITECTURE rtl OF add_unconstrained IS
BEGIN
sample_out <= sample_in1 + sample_in2;
END rtl;
------------------------------------------------------
-- file type_conversion_of_unconstr_output.vhd
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY type_conversion_of_unconstr_output IS
PORT (
Asample_in1 : IN std_logic_vector(7 DOWNTO 0);
Asample_in2 : IN std_logic_vector(7 DOWNTO 0);
Asample_out : OUT std_logic_vector(7 DOWNTO 0)
);
END type_conversion_of_unconstr_output;
ARCHITECTURE rtl OF type_conversion_of_unconstr_output IS
COMPONENT add_unconstrained
PORT (
sample_in1 : IN unsigned;
sample_in2 : IN unsigned;
sample_out : OUT unsigned
);
END COMPONENT;
SIGNAL Asample_in1_tmp : unsigned(7 DOWNTO 0);
SIGNAL Asample_in2_tmp : unsigned(7 DOWNTO 0);
BEGIN
Asample_in1_tmp <= unsigned(Asample_in1);
Asample_in2_tmp <= unsigned(Asample_in2);
u_add : add_unconstrained
PORT MAP (
sample_in1 => Asample_in1_tmp,
sample_in2 => Asample_in2_tmp,
std_logic_vector(sample_out) => Asample_out -- ??? IS this line
vhdl 93 compliant ???
);
END rtl;
Most of the compilers doesn't accept it but this doesn't mean that is
not vhdl 93 compliant.
Ncvhdl/ncsim (from cadence) for example accept it.
The problem of this code is that a type convertion is performed on an
unconstrained output in a port map,
I don't know if it's correct or not.
------------------------------------------------------
-- file add_unconstrained.vhd
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY add_unconstrained IS
PORT (
sample_in1 : IN unsigned;
sample_in2 : IN unsigned;
sample_out : OUT unsigned
);
END add_unconstrained;
ARCHITECTURE rtl OF add_unconstrained IS
BEGIN
sample_out <= sample_in1 + sample_in2;
END rtl;
------------------------------------------------------
-- file type_conversion_of_unconstr_output.vhd
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY type_conversion_of_unconstr_output IS
PORT (
Asample_in1 : IN std_logic_vector(7 DOWNTO 0);
Asample_in2 : IN std_logic_vector(7 DOWNTO 0);
Asample_out : OUT std_logic_vector(7 DOWNTO 0)
);
END type_conversion_of_unconstr_output;
ARCHITECTURE rtl OF type_conversion_of_unconstr_output IS
COMPONENT add_unconstrained
PORT (
sample_in1 : IN unsigned;
sample_in2 : IN unsigned;
sample_out : OUT unsigned
);
END COMPONENT;
SIGNAL Asample_in1_tmp : unsigned(7 DOWNTO 0);
SIGNAL Asample_in2_tmp : unsigned(7 DOWNTO 0);
BEGIN
Asample_in1_tmp <= unsigned(Asample_in1);
Asample_in2_tmp <= unsigned(Asample_in2);
u_add : add_unconstrained
PORT MAP (
sample_in1 => Asample_in1_tmp,
sample_in2 => Asample_in2_tmp,
std_logic_vector(sample_out) => Asample_out -- ??? IS this line
vhdl 93 compliant ???
);
END rtl;