library IEEE; use IEEE.STD_LOGIC_1164.all; entity ITPModul_tb is end entity ITPModul_tb; architecture testbench of ITPModul_tb is constant clk_frequency : integer := 100_000_000; constant clk_period : time := 1 sec / clk_frequency; signal simulation_run : boolean := true; signal tb_nrst : std_logic := '0'; signal tb_clk : std_logic := '0'; signal tb_XS : std_logic_vector(31 downto 0) := (others => '1'); -- Startpunkt Koordinate X signal tb_YS : std_logic_vector(31 downto 0) := (others => '1'); -- Startpunkt Koordinate Y signal tb_ZS : std_logic_vector(31 downto 0) := (others => '1'); -- Startpunkt Koordinate Z signal tb_XT : std_logic_vector(31 downto 0) := (others => '1'); -- Koordinate X relativ (XE-XS) signal tb_YT : std_logic_vector(31 downto 0) := (others => '1'); -- Koordinate Y relativ (YE-YS) signal tb_ZT : std_logic_vector(31 downto 0) := (others => '1'); -- Koordinate Z relativ (ZE-ZS) signal tb_pfrq : std_logic_vector(23 downto 0) := (others => '1'); --Bahn-Periode in anzahl CLK signal tb_L1 : std_logic_vector(15 downto 0) := (others => '1'); -- länge Arm1 in mm signal tb_L2 : std_logic_vector(15 downto 0) := (others => '1'); -- länge Arm2 in mm signal tb_L3 : std_logic_vector(15 downto 0) := (others => '1'); -- länge Arm3 in mm ----------------------- signal tb_Xlin : std_logic_vector(15 downto 0) := (others => '1'); -- Koord LinStz signal tb_Ylin : std_logic_vector(15 downto 0) := (others => '1'); -- Max.Eingabe +/-327.67 signal tb_ebene : std_logic_vector(3 downto 0) := (others => '1'); --interpolationsebene für LinSatz signal tb_Xactiv : std_logic := '0'; signal tb_Yactiv : std_logic := '0'; signal tb_celin : std_logic := '0'; ---start interpolation für linstz in einer ebene ---------------------------------------- signal tb_stopp : std_logic := '0'; -- stop interpolation,(stopp+) nach Endlage signal tb_RampRun : std_logic := '0'; -- rampe aktiv =1 signal tb_strimp : std_logic := '0'; -- start interpolation signal tb_ce : std_logic := '0'; -- start interpolation von kreis oder XYZ Satz : InversTransf ------------------------------- signal tb_calcok : std_logic := '0'; -- signalisiert alle berechnungen sind fertig signal tb_XAout : std_logic_vector(31 downto 0) := X"00000000"; --virtuelle aktuelle koordinate signal tb_YAout : std_logic_vector(31 downto 0) := X"00000000"; signal tb_ZAout : std_logic_vector(31 downto 0) := X"00000000"; signal tb_ITPmod : std_logic_vector(2 downto 0) := "000"; --ITP für Status Meldung an CPU signal tb_oAXdif : std_logic_vector(95 downto 0) := (others => '0'); --Sollwertdiff(16Bit) von inv.Transfer und Lin signal tb_oImpLk : std_logic := '1'; --impulse von xyz itp signal tb_enditp : std_logic := '0'; -- ende von Kontur:=0 (enditp-) signal tb_itprun : std_logic := '0'; -- =1:interpolator läuft,aktuelle Sollwerte in oAXinkr(6x 32bit) signal tb_testdata : std_logic_vector(15 downto 0) := X"0000"; begin tb_nrst <= '0', '1' after 10 * clk_period; tb_clk <= not tb_clk after clk_period / 2 when simulation_run; main: process begin wait for 10 us; simulation_run <= false; wait; end process; dut: entity work.ITPModul port map ( nrst => tb_nrst, -- : in std_logic; clk => tb_clk, -- : in std_logic; XS => tb_XS, -- : in std_logic_vector(31 downto 0); -- Startpunkt Koordinate X YS => tb_YS, -- : in std_logic_vector(31 downto 0); -- Startpunkt Koordinate Y ZS => tb_ZS, -- : in std_logic_vector(31 downto 0); -- Startpunkt Koordinate Z XT => tb_XT, -- : in std_logic_vector(31 downto 0); -- Koordinate X relativ (XE-XS) YT => tb_YT, -- : in std_logic_vector(31 downto 0); -- Koordinate Y relativ (YE-YS) ZT => tb_ZT, -- : in std_logic_vector(31 downto 0); -- Koordinate Z relativ (ZE-ZS) pfrq => tb_pfrq, -- : in std_logic_vector(23 downto 0); --Bahn-Periode in anzahl CLK L1 => tb_L1, -- : in std_logic_vector(15 downto 0); -- länge Arm1 in mm L2 => tb_L2, -- : in std_logic_vector(15 downto 0); -- länge Arm2 in mm L3 => tb_L3, -- : in std_logic_vector(15 downto 0); -- länge Arm3 in mm ---------------------------------- Xlin => tb_Xlin, -- : in std_logic_vector(15 downto 0); -- Koord LinStz Ylin => tb_Ylin, -- : in std_logic_vector(15 downto 0); -- Max.Eingabe +/-327.67 ebene => tb_ebene, -- : in std_logic_vector(3 downto 0); --interpolationsebene für LinSatz Xactiv => tb_Xactiv, -- : in std_logic; Yactiv => tb_Yactiv, -- : in std_logic; celin => tb_celin, -- : in std_logic; ---start interpolation für linstz in einer ebene --------------------------------------------------- stopp => tb_stopp, -- : in std_logic; -- stop interpolation,(stopp+) nach Endlage RampRun => tb_RampRun, -- : in std_logic; -- rampe aktiv =1 strimp => tb_strimp, -- : in std_logic; -- start interpolation ce => tb_ce, -- : in std_logic; -- start interpolation von kreis oder XYZ Satz : InversTransf ------------------------------------------ calcok => tb_calcok, -- : out std_logic := '0'; -- signalisiert alle berechnungen sind fertig XAout => tb_XAout, -- : out std_logic_vector(31 downto 0) := X"00000000"; --virtuelle aktuelle koordinate YAout => tb_YAout, -- : out std_logic_vector(31 downto 0) := X"00000000"; ZAout => tb_ZAout, -- : out std_logic_vector(31 downto 0) := X"00000000"; ITPmod => tb_ITPmod, -- : out std_logic_vector(2 downto 0) := "000"; --ITP für Status Meldung an CPU oAXdif => tb_oAXdif, -- : out std_logic_vector(95 downto 0) := (others => '0'); --Sollwertdiff(16Bit) von inv.Transfer und Lin oImpLk => tb_oImpLk, -- : out std_logic := '1'; --impulse von xyz itp enditp => tb_enditp, -- : out std_logic := '0'; -- ende von Kontur:=0 (enditp-) itprun => tb_itprun, -- : out std_logic := '0'; -- =1:interpolator läuft,aktuelle Sollwerte in oAXinkr(6x 32bit) testdata => tb_testdata -- : out std_logic_vector(15 downto 0) := X"0000" ); end architecture testbench;