K
Ken Morrow
Guest
I have just had to move to a later version of a synthesiser, and I have
found that some code which syntesised fine on the earlier version, now
produces errors due to the port mapping of my component.
I have something like:-
signal DATA(2 downto 1); --NOTE. This signal is downto 1, not downto 0.
--The 2 downto 1 is because of an interface to a third party which
--numbers its busses in such a way
component SOME_COMPONENT
generic(
WIDTH : positive := 8);
port(
X_BUS : std_logic_vector(WIDTH-1 downto 0);
Y_BUS : std_logic_vector(WIDTH-1 downto 0);
);
end component SOME_COMPONENT;
..
..
..
COMPONENT_INSTANCE : SOME_COMPONENT
generic map(
WIDTH => DATA'length
)
port map(
X_BUS => DATA,
Y_BUS => (DATA'range=>'0')
);
This now gives an error on the line:-
Y_BUS => (DATA'range=>'0')
saying something like 2 is out of range 1 downto 0.
Yet the line
X_BUS => DATA
which also maps a 1 downto 0 to a 2 downto 1 is fine.
I have worked around this by using:-
Y_BUS => (DATA'length-1 downto 0=>'0')
but I was wondering if the error reportedwas because my VHDL was illegal,
or because the synthesiser had incorrectly reported an error.
Many Thanks,
Ken Morrow.
found that some code which syntesised fine on the earlier version, now
produces errors due to the port mapping of my component.
I have something like:-
signal DATA(2 downto 1); --NOTE. This signal is downto 1, not downto 0.
--The 2 downto 1 is because of an interface to a third party which
--numbers its busses in such a way
component SOME_COMPONENT
generic(
WIDTH : positive := 8);
port(
X_BUS : std_logic_vector(WIDTH-1 downto 0);
Y_BUS : std_logic_vector(WIDTH-1 downto 0);
);
end component SOME_COMPONENT;
..
..
..
COMPONENT_INSTANCE : SOME_COMPONENT
generic map(
WIDTH => DATA'length
)
port map(
X_BUS => DATA,
Y_BUS => (DATA'range=>'0')
);
This now gives an error on the line:-
Y_BUS => (DATA'range=>'0')
saying something like 2 is out of range 1 downto 0.
Yet the line
X_BUS => DATA
which also maps a 1 downto 0 to a 2 downto 1 is fine.
I have worked around this by using:-
Y_BUS => (DATA'length-1 downto 0=>'0')
but I was wondering if the error reportedwas because my VHDL was illegal,
or because the synthesiser had incorrectly reported an error.
Many Thanks,
Ken Morrow.