OpenCores
URL https://opencores.org/ocsvn/uart_block/uart_block/trunk

Subversion Repositories uart_block

[/] [uart_block/] [trunk/] [hdl/] [iseProject/] [testDivisor.vhd] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 leonardoar
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   14:35:04 04/20/2012
6
-- Design Name:   
7
-- Module Name:   /home/laraujo/work/uartVHDLWishBone/testDivisor.vhd
8
-- Project Name:  uartVHDLWishBone
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: divisor
14
-- 
15
-- Dependencies:
16
-- 
17
-- Revision:
18
-- Revision 0.01 - File Created
19
-- Additional Comments:
20
--
21
-- Notes: 
22
-- This testbench has been automatically generated using types std_logic and
23
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
24
-- that these types always be used for the top-level I/O of a design in order
25
-- to guarantee that the testbench will bind correctly to the post-implementation 
26
-- simulation model.
27
--------------------------------------------------------------------------------
28
library IEEE;
29
use IEEE.STD_LOGIC_1164.ALL;
30
use IEEE.std_logic_arith.all;
31
 
32
-- Uncomment the following library declaration if using
33
-- arithmetic functions with Signed or Unsigned values
34
--USE ieee.numeric_std.ALL;
35
 
36
ENTITY testDivisor IS
37
END testDivisor;
38
 
39
ARCHITECTURE behavior OF testDivisor IS
40
 
41
    -- Component Declaration for the Unit Under Test (UUT)
42
 
43
    COMPONENT divisor
44
    PORT(
45
         rst : IN  std_logic;
46
         clk : IN  std_logic;
47
         quotient : OUT  std_logic_vector(31 downto 0);
48
         reminder : OUT  std_logic_vector(31 downto 0);
49
         numerator : IN  std_logic_vector(31 downto 0);
50
         divident : IN  std_logic_vector(31 downto 0);
51
         done : OUT  std_logic
52
        );
53
    END COMPONENT;
54
 
55
 
56
   --Inputs
57
   signal rst : std_logic := '0';
58
   signal clk : std_logic := '0';
59
   signal numerator : std_logic_vector(31 downto 0) := (others => '0');
60
   signal divident : std_logic_vector(31 downto 0) := (others => '0');
61
 
62
        --Outputs
63
   signal quotient : std_logic_vector(31 downto 0);
64
   signal reminder : std_logic_vector(31 downto 0);
65
   signal done : std_logic;
66
 
67
   -- Clock period definitions
68
   constant clk_period : time := 10 ns;
69
 
70
BEGIN
71
 
72
        -- Instantiate the Unit Under Test (UUT)
73
   uut: divisor PORT MAP (
74
          rst => rst,
75
          clk => clk,
76
          quotient => quotient,
77
          reminder => reminder,
78
          numerator => numerator,
79
          divident => divident,
80
          done => done
81
        );
82
 
83
   -- Clock process definitions
84
   clk_process :process
85
   begin
86
                clk <= '0';
87
                wait for clk_period/2;
88
                clk <= '1';
89
                wait for clk_period/2;
90
   end process;
91
 
92
 
93
   -- Stimulus process
94
   stim_proc: process
95
   begin
96
      -- hold reset state for 100 ns.
97
                rst <= '1';
98
                numerator <= conv_std_logic_vector(50000000, 32);
99
                divident <= conv_std_logic_vector(115200, 32);
100
      wait for 20 ns;
101
                rst <= '0';
102
 
103
      wait for clk_period*32;
104
 
105
      -- insert stimulus here 
106
 
107
      wait;
108
   end process;
109
 
110
END;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.