[an error occurred while processing this directive]
[an error occurred while processing this directive]
|
Обычно в testbench определяются несколько компонентов, например входное воздействие и собственно проект (возможно и по- другому, но я делаю так). Пример testbench'а :
library ieee;
use ieee.STD_logic_1164.ALL;
use work.my_types.all;
entity des_test is
end des_test;
architecture test_box of des_test is
component clk_emul
port(e_clk1 : out std_logic := 'Z';
e_clk2 : out std_logic := 'Z';
e_reset : out std_logic := 'Z'
);
end component;
for all : clk_emul use entity work.clk_emul;
component design
port(clock : in std_logic;
reset : in std_logic;
c_in : in std_logic;
c_out : out std_logic;
div_clk : out std_logic_vector(17 downto 0);
des_led : out std_logic_vector(7 downto 0);
des_data : out char
);
end component;
for all : design use entity work.design;
signal clock : std_logic;
signal lf_clk : std_logic;
signal reset : std_logic;
signal olf_clk : std_logic;
signal dc : std_logic_vector(17 downto 0);
signal dl : std_logic_vector(7 downto 0);
signal dd : char;
begin
ce: clk_emul
port map(e_clk1 => clock,
e_clk2 => lf_clk,
e_reset => reset
);
des: design
port map(clock => clock,
reset => reset,
c_in => lf_clk,
c_out => olf_clk,
div_clk => dc,
des_led => dl,
des_data => dd
[code] );[/code]
end test_box;
Здесь обьявлены 2 компонента - входное воздействие (ce: clk_emul) и верифицируемое устройство (des: design).
Когда подключается sdf, надо указать, что этот sdf относится именно к "метке" des.
Вот, совственно, и все.
E-mail: info@telesys.ru