V
valentin tihomirov
Guest
My TB submits inputs to a DUT and saves the outputs. The widths of input and
output ports of the DUT are arbitrary. Is it possible to create such a TB
that can deal with arbitrary number of inputs and outputs in DUT? I have no
ideas about how should VHDL code look like. For example, the genreal
interface of DUT is:
entity CUS is -- circuit unter simulation interface
generic (
I_WIDTH : Integer;
O_WIDTH : Integer
);
port (
INPUTS: STD_LOGIC_VECTOR (I_WIDTH-1 downto 0);
OUTPUTS: STD_LOGIC_VECTOR (O_WIDTH-1 downto 0)
);
end CUS;
and particular device, let's say a 1-bit inverter, conforming to this
interface:
architecture INV of CUS is
begin
-- specify I_WIDTH = O_WIDTH := 1 somehow
OUTPUTS <= not INPUTS;
end INV;
I need to specify width of inputs and outputs = constant 1 for particular
circuit implementing CUS interface. The same constant should be passed to TB
during instantiation of CUS.
output ports of the DUT are arbitrary. Is it possible to create such a TB
that can deal with arbitrary number of inputs and outputs in DUT? I have no
ideas about how should VHDL code look like. For example, the genreal
interface of DUT is:
entity CUS is -- circuit unter simulation interface
generic (
I_WIDTH : Integer;
O_WIDTH : Integer
);
port (
INPUTS: STD_LOGIC_VECTOR (I_WIDTH-1 downto 0);
OUTPUTS: STD_LOGIC_VECTOR (O_WIDTH-1 downto 0)
);
end CUS;
and particular device, let's say a 1-bit inverter, conforming to this
interface:
architecture INV of CUS is
begin
-- specify I_WIDTH = O_WIDTH := 1 somehow
OUTPUTS <= not INPUTS;
end INV;
I need to specify width of inputs and outputs = constant 1 for particular
circuit implementing CUS interface. The same constant should be passed to TB
during instantiation of CUS.