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

Subversion Repositories xucpu

[/] [xucpu/] [trunk/] [tb/] [startup_sim.vhdl] - Blame information for rev 10

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 lcdsgmtr
-- Copyright 2015, Jürgen Defurne
2
--
3
-- This file is part of the Experimental Unstable CPU System.
4
--
5
-- The Experimental Unstable CPU System Is free software: you can redistribute
6
-- it and/or modify it under the terms of the GNU Lesser General Public License
7
-- as published by the Free Software Foundation, either version 3 of the
8
-- License, or (at your option) any later version.
9
--
10
-- The Experimental Unstable CPU System is distributed in the hope that it will
11
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
13
-- General Public License for more details.
14
--
15
-- You should have received a copy of the GNU Lesser General Public License
16
-- along with Experimental Unstable CPU System. If not, see
17
-- http://www.gnu.org/licenses/lgpl.txt.
18
 
19
 
20
LIBRARY ieee;
21
USE ieee.std_logic_1164.ALL;
22
 
23
ENTITY startup_sim IS
24
END startup_sim;
25
 
26
ARCHITECTURE behavior OF startup_sim IS
27
 
28
  -- Component Declaration for the Unit Under Test (UUT)
29
 
30
  COMPONENT system
31
    PORT(
32
      clock     : IN  STD_LOGIC;
33
      reset     : IN  STD_LOGIC;
34
      led_out   : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
35
      switch_in : IN  STD_LOGIC_VECTOR(7 DOWNTO 0);
36
      pushb_in  : IN  STD_LOGIC_VECTOR(4 DOWNTO 0)
37
      );
38
  END COMPONENT;
39
 
40
 
41
  --Inputs
42
  SIGNAL clock     : STD_LOGIC                    := '0';
43
  SIGNAL reset     : STD_LOGIC                    := '0';
44
  SIGNAL switch_in : STD_LOGIC_VECTOR(7 DOWNTO 0) := "10101101";
45
  SIGNAL pushb_in  : STD_LOGIC_VECTOR(4 DOWNTO 0) := "10101";
46
 
47
  --Outputs
48
  SIGNAL led_out : STD_LOGIC_VECTOR(7 DOWNTO 0);
49
 
50
  -- Clock period definitions
51
  -- 100 MHz input clock
52
  CONSTANT clock_period : TIME := 10 NS;
53
 
54
BEGIN
55
 
56
  -- Instantiate the Unit Under Test (UUT)
57
  uut : system PORT MAP (
58
    clock     => clock,
59
    reset     => reset,
60
    led_out   => led_out,
61
    switch_in => switch_in,
62
    pushb_in  => pushb_in
63
    );
64
 
65
  -- Clock process definitions
66
  clock_process : PROCESS
67
  BEGIN
68
    clock <= '0';
69
    WAIT FOR clock_period/2;
70
    clock <= '1';
71
    WAIT FOR clock_period/2;
72
  END PROCESS;
73
 
74
 
75
  -- Stimulus process
76
  stim_proc : PROCESS
77
  BEGIN
78
    -- Undefined state for 2.3 clock cycles
79
    WAIT FOR clock_period * 23 / 10;
80
 
81
    -- Hold reset state for 4 clock cycles
82
    reset <= '1';
83
    WAIT FOR clock_period * 4;
84
 
85
    reset <= '0';
86
    WAIT;
87
  END PROCESS;
88
 
89
END;

powered by: WebSVN 2.1.0

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