⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tb_write_coder.vhd

📁 FPGA与ARM EPI通信,控制16路步进电机和12路DC马达 VHDL编写的
💻 VHD
字号:
--------------------------------------------------------------------------------
-- Company: 
-- Engineer:
--
-- Create Date:   16:13:14 01/30/2013
-- Design Name:   
-- Module Name:   D:/FpgaProgram/G510-106T/G510_106T_add_201301301548/testbench/tb_write_coder.vhd
-- Project Name:  G510_106T_1_1
-- Target Device:  
-- Tool versions:  
-- Description:   
-- 
-- VHDL Test Bench Created by ISE for module: Write_coder
-- 
-- Dependencies:
-- 
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
-- Notes: 
-- This testbench has been automatically generated using types std_logic and
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
-- that these types always be used for the top-level I/O of a design in order
-- to guarantee that the testbench will bind correctly to the post-implementation 
-- simulation model.
--------------------------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
 
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--USE ieee.numeric_std.ALL;
 
ENTITY tb_write_coder IS
END tb_write_coder;
 
ARCHITECTURE behavior OF tb_write_coder IS 
 
    -- Component Declaration for the Unit Under Test (UUT)
 
    COMPONENT Write_coder
    PORT(
         Clk : IN  std_logic;
         Pid_Coder_a : IN  std_logic_vector(31 downto 0);
         Pid_Coder_b : IN  std_logic_vector(31 downto 0);
         Pid_Coder_c : IN  std_logic_vector(31 downto 0);
         Pid_Coder_d : IN  std_logic_vector(31 downto 0);
         Pid_Coder_e : IN  std_logic_vector(31 downto 0);
         Pid_Coder_f : IN  std_logic_vector(31 downto 0);
         Poa_fpga_wr : OUT  std_logic_vector(10 downto 0);
         Pod_decod : OUT  std_logic_vector(31 downto 0)
        );
    END COMPONENT;
    

   --Inputs
   signal Clk : std_logic := '0';
   signal Pid_Coder_a : std_logic_vector(31 downto 0) := (others => '0');
   signal Pid_Coder_b : std_logic_vector(31 downto 0) := (others => '0');
   signal Pid_Coder_c : std_logic_vector(31 downto 0) := (others => '0');
   signal Pid_Coder_d : std_logic_vector(31 downto 0) := (others => '0');
   signal Pid_Coder_e : std_logic_vector(31 downto 0) := (others => '0');
   signal Pid_Coder_f : std_logic_vector(31 downto 0) := (others => '0');

 	--Outputs
   signal Poa_fpga_wr : std_logic_vector(10 downto 0);
   signal Pod_decod : std_logic_vector(31 downto 0);

   -- Clock period definitions
   constant Clk_period : time := 10 ns;
 
BEGIN
 
	-- Instantiate the Unit Under Test (UUT)
   uut: Write_coder PORT MAP (
          Clk => Clk,
          Pid_Coder_a => Pid_Coder_a,
          Pid_Coder_b => Pid_Coder_b,
          Pid_Coder_c => Pid_Coder_c,
          Pid_Coder_d => Pid_Coder_d,
          Pid_Coder_e => Pid_Coder_e,
          Pid_Coder_f => Pid_Coder_f,
          Poa_fpga_wr => Poa_fpga_wr,
          Pod_decod => Pod_decod
        );

   -- Clock process definitions
   Clk_process :process
   begin
		Clk <= '0';
		wait for Clk_period/2;
		Clk <= '1';
		wait for Clk_period/2;
   end process;
 

   -- Stimulus process
   stim_proc: process
   begin		
      -- hold reset state for 100 ns.
      wait for 100 ns;	
		Pid_Coder_a <= x"53458987";
		Pid_Coder_b <= x"56547777";
		Pid_Coder_c <= x"88656666";
		Pid_Coder_d <= x"34565555";
		Pid_Coder_e <= x"08974444";
		Pid_Coder_f <= x"12343333";
      wait for Clk_period*10;
	
      -- insert stimulus here 

      wait;
   end process;

END;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -