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

Subversion Repositories xucpu

[/] [xucpu/] [trunk/] [tb/] [system_sim.vhdl] - Blame information for rev 24

Go to most recent revision | 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
-- Uncomment the following library declaration if using
24
-- arithmetic functions with Signed or Unsigned values
25
--USE ieee.numeric_std.ALL;
26
 
27
ENTITY system_sim IS
28
END system_sim;
29
 
30
ARCHITECTURE behavior OF system_sim IS
31
 
32
  -- Component Declaration for the Unit Under Test (UUT)
33
 
34
  COMPONENT system
35
    PORT(
36
      clock     : IN  STD_LOGIC;
37
      reset     : IN  STD_LOGIC;
38
      led_out   : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
39
      switch_in : IN  STD_LOGIC_VECTOR(7 DOWNTO 0);
40
      pushb_in  : IN  STD_LOGIC_VECTOR(4 DOWNTO 0)
41
      );
42
  END COMPONENT;
43
 
44
 
45
  --Inputs
46
  SIGNAL clock     : STD_LOGIC                    := '0';
47
  SIGNAL reset     : STD_LOGIC                    := '0';
48
  SIGNAL switch_in : STD_LOGIC_VECTOR(7 DOWNTO 0) := (OTHERS => '0');
49
  SIGNAL pushb_in  : STD_LOGIC_VECTOR(4 DOWNTO 0) := (OTHERS => '0');
50
 
51
  --Outputs
52
  SIGNAL led_out : STD_LOGIC_VECTOR(7 DOWNTO 0);
53
 
54
  -- Clock period definitions
55
  -- Main clock on the board is 100 MHz
56
  CONSTANT clock_period : TIME := 10 ns;
57
 
58
BEGIN
59
 
60
  -- Instantiate the Unit Under Test (UUT)
61
  uut : system PORT MAP (
62
    clock     => clock,
63
    reset     => reset,
64
    led_out   => led_out,
65
    switch_in => switch_in,
66
    pushb_in  => pushb_in
67
    );
68
 
69
  -- Clock process definitions
70
  clock_process : PROCESS
71
  BEGIN
72
    clock <= '0';
73
    WAIT FOR clock_period/2;
74
    clock <= '1';
75
    WAIT FOR clock_period/2;
76
  END PROCESS;
77
 
78
 
79
  -- Stimulus process
80
  stim_proc : PROCESS
81
  BEGIN
82
    -- hold reset state for 100 ns.
83
    WAIT FOR 50 ns;
84
    reset <= '1';
85
 
86
    WAIT FOR clock_period*5;
87
    reset <= '0';
88
 
89
    -- insert stimulus here 
90
 
91
    WAIT;
92
  END PROCESS;
93
 
94
END;

powered by: WebSVN 2.1.0

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