S
Seb
Dear all,
I am surprised by the behaviour of the following code where I try to
assign (different) elements of an array from different processes. When
doing so with a procedure, it does not work as expected. Can somebody
explain me why?
Thanks a lot.
Seb.
=====
library ieee;
use ieee.std_logic_1164.all;
entity vector_splicing is
end vector_splicing;
architecture one of vector_splicing is
signal ok, still_ok, not_ok : std_logic_vector(1 downto 0);
signal clk : std_logic := '1';
procedure assign(signal d: inout std_logic_vector; i: in integer;
v: in std_logic) is
begin
d(i) <= v;
end assign;
begin
clk <= not clk after 5 ns;
process( clk )
begin
if rising_edge( clk ) then
ok(0) <= '0';
assign(still_ok, 0, '0');
assign(still_ok, 1, '1');
assign(not_ok, 0, '0');
end if;
end process;
process( clk )
begin
if rising_edge( clk ) then
ok(1) <= '1';
assign(not_ok, 1, '1');
end if;
end process;
end one;
I am surprised by the behaviour of the following code where I try to
assign (different) elements of an array from different processes. When
doing so with a procedure, it does not work as expected. Can somebody
explain me why?
Thanks a lot.
Seb.
=====
library ieee;
use ieee.std_logic_1164.all;
entity vector_splicing is
end vector_splicing;
architecture one of vector_splicing is
signal ok, still_ok, not_ok : std_logic_vector(1 downto 0);
signal clk : std_logic := '1';
procedure assign(signal d: inout std_logic_vector; i: in integer;
v: in std_logic) is
begin
d(i) <= v;
end assign;
begin
clk <= not clk after 5 ns;
process( clk )
begin
if rising_edge( clk ) then
ok(0) <= '0';
assign(still_ok, 0, '0');
assign(still_ok, 1, '1');
assign(not_ok, 0, '0');
end if;
end process;
process( clk )
begin
if rising_edge( clk ) then
ok(1) <= '1';
assign(not_ok, 1, '1');
end if;
end process;
end one;