I
Ilya Kalistru
Guest
Hello.
Iâd like to know your opinion on an issue I met.
I used a procedure in my code. Letâs say that it is the procedure
(Itâs not. Just an example):
procedure p1(
signal clk : in std_logic;
signal A : in std_logic;
signal C : out std_logic
) is
begin
loop
wait until rising_edge(clk);
C <= A xor â1â;
end loop;
end procedure p1;
Then I decided that I needed extended version of the procedure,
so I rewrote it using a new procedure name p2 for extended version,
and I just called the new procedure p2 with a constant parameter in
the old procedure p1 like that:
procedure p2(
signal clk : in std_logic;
signal A : in std_logic;
signal B : in std_logic;
signal C : out std_logic
) is
begin
loop
wait until rising_edge(clk);
C <= A xor B;
end loop;
end procedure p2;
procedure p1(
signal clk : in std_logic;
signal A : in std_logic;
signal C : out std_logic
) is
begin
p2(clk, A, '1', C);
end procedure p1;
The problem is that I got an error
ERROR: [VRFC 10-275] actual '1' of formal b must be a signal [D:/VHDL_proj/test1/test1.srcs/sources_1/new/test.vhd:59]
Is it impossible to call a subprogram from an another subprogram,
assigning an actual constant to a formal signal parameter of the
internal subprogram?
Iâd like to know your opinion on an issue I met.
I used a procedure in my code. Letâs say that it is the procedure
(Itâs not. Just an example):
procedure p1(
signal clk : in std_logic;
signal A : in std_logic;
signal C : out std_logic
) is
begin
loop
wait until rising_edge(clk);
C <= A xor â1â;
end loop;
end procedure p1;
Then I decided that I needed extended version of the procedure,
so I rewrote it using a new procedure name p2 for extended version,
and I just called the new procedure p2 with a constant parameter in
the old procedure p1 like that:
procedure p2(
signal clk : in std_logic;
signal A : in std_logic;
signal B : in std_logic;
signal C : out std_logic
) is
begin
loop
wait until rising_edge(clk);
C <= A xor B;
end loop;
end procedure p2;
procedure p1(
signal clk : in std_logic;
signal A : in std_logic;
signal C : out std_logic
) is
begin
p2(clk, A, '1', C);
end procedure p1;
The problem is that I got an error
ERROR: [VRFC 10-275] actual '1' of formal b must be a signal [D:/VHDL_proj/test1/test1.srcs/sources_1/new/test.vhd:59]
Is it impossible to call a subprogram from an another subprogram,
assigning an actual constant to a formal signal parameter of the
internal subprogram?