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

Subversion Repositories vhdl_wb_tb

[/] [vhdl_wb_tb/] [trunk/] [rtl/] [vhdl/] [core_top.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 sinx
---------------------------------------------------------------------- 
2
----                                                              ---- 
3
----  VHDL Wishbone TESTBENCH                                     ---- 
4
----                                                              ---- 
5
----  This file is part of the vhdl_wb_tb project                 ---- 
6
----  http://www.opencores.org/cores/vhdl_wb_tb/                  ---- 
7
----                                                              ---- 
8
----  This file contains the top functional module of the design  ----
9
----  under test. The top functional module will be enclosed by   ----
10
----  the top module for synthesis or the tb_top for simulation.  ---- 
11
----  The top module can contain some synthesis specific code,    ----
12
----  where the tb_top contains simulation specific code.          ----
13
----                                                              ---- 
14
----  To Do:                                                      ---- 
15
----   -                                                          ---- 
16
----                                                              ---- 
17
----  Author(s):                                                  ---- 
18
----      - Sinx, email@opencores.org               ---- 
19
----                                                              ---- 
20
----------------------------------------------------------------------
21
--    SVN information
22
--
23
--      $URL:  $
24
-- $Revision:  $
25
--     $Date:  $
26
--   $Author:  $
27
--       $Id:  $
28
--
29
---------------------------------------------------------------------- 
30
----                                                              ---- 
31
---- Copyright (C) 2018 Authors and OPENCORES.ORG                 ---- 
32
----                                                              ---- 
33
---- This source file may be used and distributed without         ---- 
34
---- restriction provided that this copyright statement is not    ---- 
35
---- removed from the file and that any derivative work contains  ---- 
36
---- the original copyright notice and the associated disclaimer. ---- 
37
----                                                              ---- 
38
---- This source file is free software; you can redistribute it   ---- 
39
---- and/or modify it under the terms of the GNU Lesser General   ---- 
40
---- Public License as published by the Free Software Foundation; ---- 
41
---- either version 2.1 of the License, or (at your option) any   ---- 
42
---- later version.                                               ---- 
43
----                                                              ---- 
44
---- This source is distributed in the hope that it will be       ---- 
45
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ---- 
46
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ---- 
47
---- PURPOSE.  See the GNU Lesser General Public License for more ---- 
48
---- details.                                                     ---- 
49
----                                                              ---- 
50
---- You should have received a copy of the GNU Lesser General    ---- 
51
---- Public License along with this source; if not, download it   ---- 
52
---- from http://www.opencores.org/lgpl.shtml                     ---- 
53
----                                                              ---- 
54
----------------------------------------------------------------------
55
 
56
-- library -----------------------------------------------------------
57
library ieee;
58
use ieee.std_logic_1164.all;
59
use ieee.numeric_std.all;
60
library work;
61
use work.convert_pkg.all;
62
use work.wishbone_pkg.all;
63
 
64
-- entity ------------------------------------------------------------
65
entity core_top is
66
  generic(
67
    g_number_of_in_signals          : natural := 1;
68
    g_number_of_out_signals         : natural := 1
69
    );
70
  port(
71
    clock_i                         : in std_logic;
72
    reset_i                         : in std_logic;
73
    signals_i                       : in std_logic_vector(g_number_of_in_signals-1 downto 0);
74
    signals_o                       : out std_logic_vector(g_number_of_out_signals-1 downto 0)
75
    );
76
end core_top;
77
 
78
--=architecture===============================================================
79
architecture rtl of core_top is
80
  --============================================================================
81
  -- signal declaration
82
  --============================================================================
83
  signal    shift_register_r   : std_logic_vector (g_number_of_out_signals-1 downto 0);
84
  signal    old_shift_clock_r  : std_logic := '0';
85
  --============================================================================
86
begin
87
  ------------------------------------------------------------------------------
88
  -- module instantiation
89
  ------------------------------------------------------------------------------
90
  proc_shift_register : process (all)
91
    begin
92
      if (reset_i = '1' ) then
93
        shift_register_r <= (others => '0');
94
      elsif (rising_edge(clock_i)) then
95
        old_shift_clock_r <= signals_i(1);
96
        if (signals_i(1) = '1' AND old_shift_clock_r= '0') then
97
          shift_register_r        <= shift_register_r(shift_register_r'left-1 downto 0) & signals_i(0);
98
        end if;
99
      end if;
100
    end process;
101
  ------------------------------------------------------------------------------
102
  signals_o <= shift_register_r;
103
  ------------------------------------------------------------------------------
104
  ------------------------------------------------------------------------------
105
  ------------------------------------------------------------------------------
106
  ------------------------------------------------------------------------------
107
--============================================================================
108
end rtl; --core_top
109
--============================================================================
110
-- end of file
111
--============================================================================

powered by: WebSVN 2.1.0

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