Guest
Hi VHDL gurus,
Below a few snippets from code which behaves not as expected. I am wondering if it is a tool issue or that it is forbidden by the language.
type rt_rec_type is record
data_i : std_logic_vector(31 downto 0);
busy : std_logic;
header : std_logic;
dest : std_logic_vector(3 downto 0);
end record rt_rec_type;
type t_channels is array (0 to 7) of rt_rec_type;
gen1 : for i in 0 to 7 generate
channels(i).data_i <= (others => â0â);
channels(i).header <= â0â;
end generate gen1;
p_data : process(clk) is
begin
if rising_edge(clk) then
if resetn = â0â then
for i in 0 to 7 generate
channels(i).busy <= â0â;
channels(i).dest <= (others => â0â);
end for;
.....
end process;
What we see in Modelsim is that data_i and header are still âUâ and not initialised as expected. Modelsim steps through the lines of data_i and header at 0 ps + 0.
When we move these signals inside the process and add them to the reset they are initialised. Is it forbidden by the language to assign the record elements at different places?
Thanks, Devas
Below a few snippets from code which behaves not as expected. I am wondering if it is a tool issue or that it is forbidden by the language.
type rt_rec_type is record
data_i : std_logic_vector(31 downto 0);
busy : std_logic;
header : std_logic;
dest : std_logic_vector(3 downto 0);
end record rt_rec_type;
type t_channels is array (0 to 7) of rt_rec_type;
gen1 : for i in 0 to 7 generate
channels(i).data_i <= (others => â0â);
channels(i).header <= â0â;
end generate gen1;
p_data : process(clk) is
begin
if rising_edge(clk) then
if resetn = â0â then
for i in 0 to 7 generate
channels(i).busy <= â0â;
channels(i).dest <= (others => â0â);
end for;
.....
end process;
What we see in Modelsim is that data_i and header are still âUâ and not initialised as expected. Modelsim steps through the lines of data_i and header at 0 ps + 0.
When we move these signals inside the process and add them to the reset they are initialised. Is it forbidden by the language to assign the record elements at different places?
Thanks, Devas