A
Analog_Guy
I am having difficulty with what seems to be a very simple thing.
I want to code a generic testbench procedure to automatically check any
n-input combinatorial function in my design.
Currently, I used a quick and dirty way just to get the automatic
checking working. For example, I have a separate combinatorial
procedure to handle 6-input functions, and another to handle 9-input
functions. This works fine, but now a requirements changes converted
one of my outputs to a 7-input function. With my current approach,
this means I now have to code a separate procedure to handle 7-input
combinatorial functions. This does not seem like a good way of
handling things.
What I would like is if someone knows how to pass a variable number of
input signals to a generic procedure?
I know I can send an unconstrained vector to a procedure, and use a
'range to determine the length inside the procedure, but am not sure if
this would work with a concatenated vector of inputs? I think I would
have to declare unique vectors for each of my different combinatorial
functions. Example:
Current Approach
================
test_comb_6ip(ip_1, ip_2, ip_3, ip_4, ip_5, ip_6, output_function);
Can I do this?
==============
signal vector_6ip : STD_LOGIC_VECTOR(5 DOWNTO 0);
vector_6ip <= ip_1 & ip_2 & ip_3 & ip_4 & ip_5 & ip_6;
test_comb(vector_6ip, output_function);
I have not yet convinced myself that the second approach will work?
Note that the input signals are declared as INOUT in my PROCEDURE, so
that I may force the various input combinations on my output_function.
Any help would be appreciated.
I want to code a generic testbench procedure to automatically check any
n-input combinatorial function in my design.
Currently, I used a quick and dirty way just to get the automatic
checking working. For example, I have a separate combinatorial
procedure to handle 6-input functions, and another to handle 9-input
functions. This works fine, but now a requirements changes converted
one of my outputs to a 7-input function. With my current approach,
this means I now have to code a separate procedure to handle 7-input
combinatorial functions. This does not seem like a good way of
handling things.
What I would like is if someone knows how to pass a variable number of
input signals to a generic procedure?
I know I can send an unconstrained vector to a procedure, and use a
'range to determine the length inside the procedure, but am not sure if
this would work with a concatenated vector of inputs? I think I would
have to declare unique vectors for each of my different combinatorial
functions. Example:
Current Approach
================
test_comb_6ip(ip_1, ip_2, ip_3, ip_4, ip_5, ip_6, output_function);
Can I do this?
==============
signal vector_6ip : STD_LOGIC_VECTOR(5 DOWNTO 0);
vector_6ip <= ip_1 & ip_2 & ip_3 & ip_4 & ip_5 & ip_6;
test_comb(vector_6ip, output_function);
I have not yet convinced myself that the second approach will work?
Note that the input signals are declared as INOUT in my PROCEDURE, so
that I may force the various input combinations on my output_function.
Any help would be appreciated.