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

Subversion Repositories mipsr2000

[/] [mipsr2000/] [trunk/] [test_benchs/] [main_tst.vhd] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 46 jimi39
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:      Lazaridis Dimitris
4
--
5
-- Create Date:   19:35:47 06/27/2012
6
-- Design Name:   
7
-- Module Name:   C:/temp/MipsR2/main_tst.vhd
8
-- Project Name:  Mips
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: main
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
 
31
-- Uncomment the following library declaration if using
32
-- arithmetic functions with Signed or Unsigned values
33
--USE ieee.numeric_std.ALL;
34
 
35
ENTITY main_tst IS
36
END main_tst;
37
 
38
ARCHITECTURE behavior OF main_tst IS
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT main
43
    PORT(
44
         Clk : IN  std_logic;
45
         Rst : IN  std_logic;
46
                        vector_on : in std_logic_vector(2 downto 0);
47
                        Err : OUT  std_logic;
48
         Bus_r : out std_logic_vector(31 downto 0)
49
        );
50
    END COMPONENT;
51
 
52
   --Inputs
53
   signal Clk : std_logic := '0';
54
   signal Rst : std_logic := '0';
55
        signal vector_on : std_logic_vector(2 downto 0) := "000";
56
        --signal rs_t,rt_t,rd_t : std_logic_vector(4 downto 0) := "00000";
57
   signal Bus_r : std_logic_vector(31 downto 0);
58
        --Outputs
59
   signal Err : std_logic:= '0';
60
 
61
   -- Clock period definitions
62
   constant Clk_period : time := 10 ns;
63
 
64
BEGIN
65
 
66
        -- Instantiate the Unit Under Test (UUT)
67
   uut: main PORT MAP (
68
          Clk => Clk,
69
          Rst => Rst,
70
                         vector_on => vector_on,
71
                         Err => Err,
72
                         Bus_r => Bus_r
73
                      );
74
 
75
   -- Clock process definitions
76
   Clk_process :process
77
   begin
78
                Clk <= '0';
79
                wait for Clk_period/2;
80
                Clk <= '1';
81
                wait for Clk_period/2;
82
   end process;
83
 
84
 
85
   -- Stimulus process
86
   stim_proc: process
87
   begin
88
      -- hold reset state for 100 ns.
89
 
90
      wait for 100 ns;
91
           -- insert stimulus here
92
 
93
                rst <= '0';
94
      vector_on <= "001";
95
 
96
      wait for Clk_period;
97
                rst <= '0';
98
      vector_on <= "011";
99
                wait for Clk_period;
100
                rst <= '0';
101
      vector_on <= "101";
102
                wait for Clk_period;
103
                rst <= '0';
104
      vector_on <= "111";
105
                wait for Clk_period;
106
                rst <= '0';
107
                vector_on <= "000";
108
                wait for 10 ns;
109
 
110
                rst <= '1';
111
 
112
 
113
      -- insert stimulus here
114
      wait for 1440 ns;
115
      --program_on <= '1';
116
                wait for Clk_period*3; --fib begin
117
      wait for 1400 ns;
118
                wait;
119
   end process;
120
 
121
END;

powered by: WebSVN 2.1.0

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