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

Subversion Repositories open_hitter

[/] [open_hitter/] [trunk/] [bench/] [vhdl/] [hitter_wrapper.vhd] - Blame information for rev 10

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

Line No. Rev Author Line
1 3 stvhawes
--////////////////////////////////////////////////////////////////////
2
--//                                                              ////
3
--// hitter_wrapper.vhd                                           ////
4
--//                                                              ////
5
--// This file is part of the open_hitter opencores effort.       ////
6
--// <http://www.opencores.org/cores/open_hitter/>                ////
7
--//                                                              ////
8
--// Module Description:                                          ////
9
--// Simulation program (non-synthesizable)                       ////
10
--// Drives auto regression tests via NSEW button actions and     ////
11
--// NSEW LED reporting                                           ////
12
--// target env: ghdl <attrib required>                           ////
13
--//                                                              ////
14
--// To Do:                                                       ////
15
--//    #LOTS                                                     ////
16
--//                                                              ////
17
--// Author(s):                                                   ////
18
--// - Stephen Hawes                                              ////
19
--//                                                              ////
20
--////////////////////////////////////////////////////////////////////
21
--//                                                              ////
22
--// Copyright (C) 2015 Stephen Hawes and OPENCORES.ORG           ////
23
--//                                                              ////
24
--// This source file may be used and distributed without         ////
25
--// restriction provided that this copyright statement is not    ////
26
--// removed from the file and that any derivative work contains  ////
27
--// the original copyright notice and the associated disclaimer. ////
28
--//                                                              ////
29
--// This source file is free software; you can redistribute it   ////
30
--// and/or modify it under the terms of the GNU Lesser General   ////
31
--// Public License as published by the Free Software Foundation; ////
32
--// either version 2.1 of the License, or (at your option) any   ////
33
--// later version.                                               ////
34
--//                                                              ////
35
--// This source is distributed in the hope that it will be       ////
36
--// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
37
--// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
38
--// PURPOSE. See the GNU Lesser General Public License for more  ////
39
--// details.                                                     ////
40
--//                                                              ////
41
--// You should have received a copy of the GNU Lesser General    ////
42
--// Public License along with this source; if not, download it   ////
43
--// from <http://www.opencores.org/lgpl.shtml>                   ////
44
--//                                                              ////
45
--////////////////////////////////////////////////////////////////////
46
--//
47
--// \$Id\$  TAKE OUT THE \'s and this comment in order to get this to work
48
--//
49
--// CVS Revision History
50
--//
51
--// \$Log\$  TAKE OUT THE \'s and this comment in order to get this to work
52
--//
53 2 stvhawes
library ieee;
54 3 stvhawes
use ieee.std_logic_1164.all;
55
use std.textio.all; --  Imports the standard textio package.
56 2 stvhawes
 
57 3 stvhawes
     entity hitter_wrapper is
58
     end hitter_wrapper;
59
 
60
     architecture behaviour of hitter_wrapper is
61
        component hitter_sim
62
           port( RX_CLK: in std_logic;
63
                 PUSH_BUTTONS_5BITS_TRI_I: in std_logic_vector(4 downto 0);
64
                 LEDS_POSITIONS_TRI_O: out std_logic_vector(4 downto 0)
65
           );
66
        end component;
67
        for hitter_sim_0: hitter_sim use entity work.hitter_sim;
68
        signal RX_CLK: std_logic;
69
        signal PUSH_BUTTONS_5BITS_TRI_I: std_logic_vector(4 downto 0);
70
        signal LEDS_POSITIONS_TRI_O: std_logic_vector(4 downto 0);
71
     begin
72
        hitter_sim_0: hitter_sim port map (
73
                         RX_CLK => RX_CLK,
74
                         PUSH_BUTTONS_5BITS_TRI_I => PUSH_BUTTONS_5BITS_TRI_I,
75
                         LEDS_POSITIONS_TRI_O => LEDS_POSITIONS_TRI_O );
76
        process
77
           variable l : line;
78
           variable counted : integer;
79
        begin
80
           write (l, String'("Exercising hitter_sim"));
81
           writeline (output, l);
82 2 stvhawes
 
83 3 stvhawes
           RX_CLK <= '0';
84
           wait for 1 ns;
85 2 stvhawes
 
86 3 stvhawes
           for counted in 0 to 30 loop
87
              -- Instruct:
88 2 stvhawes
 
89 3 stvhawes
              if (counted = 2) then
90
                 PUSH_BUTTONS_5BITS_TRI_I <= std_logic_vector'("11111");
91
              else
92
                 PUSH_BUTTONS_5BITS_TRI_I <= std_logic_vector'("00000");
93
              end if;
94 2 stvhawes
 
95 3 stvhawes
              RX_CLK <= '1';
96
              wait for 1 ns;
97 2 stvhawes
 
98 3 stvhawes
              -- Report:
99
              write (l, String'("Count:"));
100
              write(l, counted);
101
              write (l, String'(" LEDs: "));
102
              for i in LEDS_POSITIONS_TRI_O'range loop
103
                 case LEDS_POSITIONS_TRI_O(i) is
104
                    when '1' => write(l, character'('1'));
105
                    when others => write(l, character'('0'));
106
                 end case;
107
              end loop;
108
              writeline(output, l);
109
 
110
              -- Reset:
111
              RX_CLK <= '0';
112
              wait for 1 ns;
113
           end loop;
114
 
115
           write (l, String'("Done hitter_sim"));
116
           writeline (output, l);
117
           wait;
118
        end process;
119
     end behaviour;
120
 

powered by: WebSVN 2.1.0

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