Guest
First thanks for the input. Somewhat new to VHDL. I hope I can protray
my question easily enough to get a quick accurate answer.
I have a testbench which has multiple large procedures. I have these
repeated in many testbenches which is inefficient and not neat. These
procedures "take in" many (>50) signals and vectors when inititiated
from my testbench stimulus. The procedure declaration may define just
one input, however the procedure will "take in" and execute a large
testbench signal set as it is defined at that time. This large signal
set is not required as part of the procedure decleration signal set,
since they are all visible within the testbench. Below is a brief
example in text which I hope helps instead of displaying my huge
example.
procedure SIMULATE_GPS_IN (
signal SIM_SESSION : in string(1 to 10)
)
begin
---- in this procedure, many many sigals and vectors are being
utilized. However since they are all in the tesbench
---- they are visible, and don't have to be passed into the
procedure as part of the declaration statement
---- like the "SIM_SESSION" input string shown above.
end SIMULATE_GPS_IN;
STIMULUS : process
reset <= '0' ;
wait for 10us;
reset <= '1' ;
-- Test #1
A <= "0010"; B <= '1'; C <= X"1234"; -- these signals are viewed
("taken in") by the procedure
wait for 1us;
SIMULATE_GPS_IN (3); -- invoking procedure
-- add self checking tests here.
-- Test #2
A <= "1000"; B <= '0'; C <= X"3421"; -- these signals are viewed
("taken in") by the procedure
wait for 1us;
SIMULATE_GPS_IN (2); -- invoking procedure
-- add self checking tests here.
-- Test #3
A <= "1111"; -- these signals are viewed ("taken in") by the
procedure (using B, C's previous stimulus values)
wait for 1us;
SIMULATE_GPS_IN (7); -- invoking procedure
-- add self checking tests here.
end process;
Now for my question: The signals A, B, and C are utilized (read) by
the procedure when invoked. This all works great. Now when I switch to
a composite package and place all procedures within; can I still pass
just one variable into the package (and thus into the procedure within
the package), or do I now have to pass A, B, and C along with the
SIM_SESSION string value in the procedure call. Again my signal set is
huge, so when implemented inside the testbench (without a package),
the simulation portion of the testbench is very neat and easy to read
(not cluttered with each individual signal). But again, it is not very
neat to repeat every procedure in every testbench. If I can not make
the signals available (global) to the package, then I will have to
change my procedures to look like this.
procedure SIMULATE_GPS_IN (
signal A : in std_logic;
signal B : in std_logic_vector(31 downto 0);
signal C : in std_logic_vector(31 downto 0);
signal SIM_SESSION : in string(1 to 10)
)
begin
------ logic , ......................
end SIMULATE_GPS_IN;
STIMULUS : process
reset <= '0' ;
wait for 10us;
reset <= '1' ;
-- Test #1
wait for 1us;
SIMULATE_GPS_IN (A, B, C, 3); -- invoking procedure with all data
signals which are utilized to execute logic.
-- add self checking tests here.
......
......
end process;
I am trying to avoid making huge procedure declarations. If I have to
then I can't preserve the "neatness" of the testbench style when not
using a package. I HOPE that all makes sense. I believe it is a pretty
straight forward issue, but I just can't figure out how (or if) I can
make all the signals globally visible to the package without passing
them through huge procedure calls. Again (ahead of time) thanks to you
experts out there!!
my question easily enough to get a quick accurate answer.
I have a testbench which has multiple large procedures. I have these
repeated in many testbenches which is inefficient and not neat. These
procedures "take in" many (>50) signals and vectors when inititiated
from my testbench stimulus. The procedure declaration may define just
one input, however the procedure will "take in" and execute a large
testbench signal set as it is defined at that time. This large signal
set is not required as part of the procedure decleration signal set,
since they are all visible within the testbench. Below is a brief
example in text which I hope helps instead of displaying my huge
example.
procedure SIMULATE_GPS_IN (
signal SIM_SESSION : in string(1 to 10)
)
begin
---- in this procedure, many many sigals and vectors are being
utilized. However since they are all in the tesbench
---- they are visible, and don't have to be passed into the
procedure as part of the declaration statement
---- like the "SIM_SESSION" input string shown above.
end SIMULATE_GPS_IN;
STIMULUS : process
reset <= '0' ;
wait for 10us;
reset <= '1' ;
-- Test #1
A <= "0010"; B <= '1'; C <= X"1234"; -- these signals are viewed
("taken in") by the procedure
wait for 1us;
SIMULATE_GPS_IN (3); -- invoking procedure
-- add self checking tests here.
-- Test #2
A <= "1000"; B <= '0'; C <= X"3421"; -- these signals are viewed
("taken in") by the procedure
wait for 1us;
SIMULATE_GPS_IN (2); -- invoking procedure
-- add self checking tests here.
-- Test #3
A <= "1111"; -- these signals are viewed ("taken in") by the
procedure (using B, C's previous stimulus values)
wait for 1us;
SIMULATE_GPS_IN (7); -- invoking procedure
-- add self checking tests here.
end process;
Now for my question: The signals A, B, and C are utilized (read) by
the procedure when invoked. This all works great. Now when I switch to
a composite package and place all procedures within; can I still pass
just one variable into the package (and thus into the procedure within
the package), or do I now have to pass A, B, and C along with the
SIM_SESSION string value in the procedure call. Again my signal set is
huge, so when implemented inside the testbench (without a package),
the simulation portion of the testbench is very neat and easy to read
(not cluttered with each individual signal). But again, it is not very
neat to repeat every procedure in every testbench. If I can not make
the signals available (global) to the package, then I will have to
change my procedures to look like this.
procedure SIMULATE_GPS_IN (
signal A : in std_logic;
signal B : in std_logic_vector(31 downto 0);
signal C : in std_logic_vector(31 downto 0);
signal SIM_SESSION : in string(1 to 10)
)
begin
------ logic , ......................
end SIMULATE_GPS_IN;
STIMULUS : process
reset <= '0' ;
wait for 10us;
reset <= '1' ;
-- Test #1
wait for 1us;
SIMULATE_GPS_IN (A, B, C, 3); -- invoking procedure with all data
signals which are utilized to execute logic.
-- add self checking tests here.
......
......
end process;
I am trying to avoid making huge procedure declarations. If I have to
then I can't preserve the "neatness" of the testbench style when not
using a package. I HOPE that all makes sense. I believe it is a pretty
straight forward issue, but I just can't figure out how (or if) I can
make all the signals globally visible to the package without passing
them through huge procedure calls. Again (ahead of time) thanks to you
experts out there!!