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

Subversion Repositories mips_fault_tolerant

[/] [mips_fault_tolerant/] [trunk/] [test_benchs/] [main_tst.vhd] - Blame information for rev 57

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

Line No. Rev Author Line
1 50 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
                        sel_top : in  std_logic;
48
                        Err : OUT  std_logic;
49
                        pass : out std_logic;
50
         Bus_r : out std_logic_vector(31 downto 0)
51
        );
52
    END COMPONENT;
53
 
54
   --Inputs
55
   signal Clk : std_logic := '0';
56
   signal Rst,sel_top,pass : std_logic := '0';
57
        signal vector_on : std_logic_vector(2 downto 0) := "000";
58
        --signal rs_t,rt_t,rd_t : std_logic_vector(4 downto 0) := "00000";
59
   signal Bus_r : std_logic_vector(31 downto 0);
60
        --Outputs
61
   signal Err : std_logic:= '0';
62
 
63
   -- Clock period definitions
64
   constant Clk_period : time := 10 ns;
65
 
66
BEGIN
67
 
68
        -- Instantiate the Unit Under Test (UUT)
69
   uut: main PORT MAP (
70
          Clk => Clk,
71
          Rst => Rst,
72
                         vector_on => vector_on,
73
                         sel_top => sel_top,
74
                         Err => Err,
75
                         pass => pass,
76
                         Bus_r => Bus_r
77
                      );
78
 
79
   -- Clock process definitions
80
   Clk_process :process
81
   begin
82
                Clk <= '0';
83
                wait for Clk_period/2;
84
                Clk <= '1';
85
                wait for Clk_period/2;
86
   end process;
87
 
88
 
89
   -- Stimulus process
90
   stim_proc: process
91
   begin
92
      -- hold reset state for 100 ns.
93
 
94
      wait for 100 ns;
95
           -- insert stimulus here
96
                rst <= '1';
97
                sel_top <= '1';
98
                wait for Clk_period;
99
                rst <= '0';
100
                wait for Clk_period*64;
101
                sel_top <= '0';
102
                wait for Clk_period;
103
                -- initialize vectors
104
                rst <= '0';
105
      vector_on <= "001";
106
 
107
      wait for Clk_period;
108
                rst <= '0';
109
      vector_on <= "011";
110
                wait for Clk_period;
111
                rst <= '0';
112
      vector_on <= "101";
113
                wait for Clk_period;
114
                rst <= '0';
115
      vector_on <= "111";
116
                wait for Clk_period;
117
                rst <= '0';
118
                vector_on <= "000";
119
                wait for 10 ns;
120
                --cpu start
121
                rst <= '1';
122
 
123
 
124
      -- insert stimulus here
125
      wait for 2080 ns;
126
      --program_on <= '1';
127
                wait for Clk_period*3; --fib begin
128
      wait for 2040 ns;
129
                wait;
130
   end process;
131
 
132
END;

powered by: WebSVN 2.1.0

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