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] - Diff between revs 2 and 4

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 2 Rev 4
---------------------------------------------------------------------- 
---------------------------------------------------------------------- 
----                                                              ---- 
----                                                              ---- 
----  VHDL Wishbone TESTBENCH                                     ---- 
----  VHDL Wishbone TESTBENCH                                     ---- 
----                                                              ---- 
----                                                              ---- 
----  This file is part of the vhdl_wb_tb project                 ---- 
----  This file is part of the vhdl_wb_tb project                 ---- 
----  http://www.opencores.org/cores/vhdl_wb_tb/                  ---- 
----  http://www.opencores.org/cores/vhdl_wb_tb/                  ---- 
----                                                              ---- 
----                                                              ---- 
----  This file contains the top functional module of the design  ----
----  This file contains the top functional module of the design  ----
----  under test. The top functional module will be enclosed by   ----
----  under test. The top functional module will be enclosed by   ----
----  the top module for synthesis or the tb_top for simulation.  ---- 
----  the top module for synthesis or the tb_top for simulation.  ---- 
----  The top module can contain some synthesis specific code,    ----
----  The top module can contain some synthesis specific code,    ----
----  where the tb_top contains simulation specific code.          ----
----  where the tb_top contains simulation specific code.          ----
----                                                              ---- 
----                                                              ---- 
----  To Do:                                                      ---- 
----  To Do:                                                      ---- 
----   -                                                          ---- 
----   -                                                          ---- 
----                                                              ---- 
----                                                              ---- 
----  Author(s):                                                  ---- 
----  Author(s):                                                  ---- 
----      - Sinx, email@opencores.org               ---- 
----      - Sinx, sinx@opencores.org                              ---- 
----                                                              ---- 
----                                                              ---- 
----------------------------------------------------------------------
----------------------------------------------------------------------
--    SVN information
----    SVN information
--
----
--      $URL:  $
----      $URL:  $
-- $Revision:  $
---- $Revision:  $
--     $Date:  $
----     $Date:  $
--   $Author:  $
----   $Author:  $
--       $Id:  $
----       $Id:  $
--
 
---------------------------------------------------------------------- 
---------------------------------------------------------------------- 
----                                                              ---- 
----                                                              ---- 
---- Copyright (C) 2018 Authors and OPENCORES.ORG                 ---- 
---- Copyright (C) 2018 Authors and OPENCORES.ORG                 ---- 
----                                                              ---- 
----                                                              ---- 
---- This source file may be used and distributed without         ---- 
---- This source file may be used and distributed without         ---- 
---- restriction provided that this copyright statement is not    ---- 
---- restriction provided that this copyright statement is not    ---- 
---- removed from the file and that any derivative work contains  ---- 
---- removed from the file and that any derivative work contains  ---- 
---- the original copyright notice and the associated disclaimer. ---- 
---- the original copyright notice and the associated disclaimer. ---- 
----                                                              ---- 
----                                                              ---- 
---- This source file is free software; you can redistribute it   ---- 
---- This source file is free software; you can redistribute it   ---- 
---- and/or modify it under the terms of the GNU Lesser General   ---- 
---- and/or modify it under the terms of the GNU Lesser General   ---- 
---- Public License as published by the Free Software Foundation; ---- 
---- Public License as published by the Free Software Foundation; ---- 
---- either version 2.1 of the License, or (at your option) any   ---- 
---- either version 2.1 of the License, or (at your option) any   ---- 
---- later version.                                               ---- 
---- later version.                                               ---- 
----                                                              ---- 
----                                                              ---- 
---- This source is distributed in the hope that it will be       ---- 
---- This source is distributed in the hope that it will be       ---- 
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ---- 
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ---- 
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ---- 
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ---- 
---- PURPOSE.  See the GNU Lesser General Public License for more ---- 
---- PURPOSE.  See the GNU Lesser General Public License for more ---- 
---- details.                                                     ---- 
---- details.                                                     ---- 
----                                                              ---- 
----                                                              ---- 
---- You should have received a copy of the GNU Lesser General    ---- 
---- You should have received a copy of the GNU Lesser General    ---- 
---- Public License along with this source; if not, download it   ---- 
---- Public License along with this source; if not, download it   ---- 
---- from http://www.opencores.org/lgpl.shtml                     ---- 
---- from http://www.opencores.org/lgpl.shtml                     ---- 
----                                                              ---- 
----                                                              ---- 
----------------------------------------------------------------------
----------------------------------------------------------------------
 
 
-- library -----------------------------------------------------------
-- library -----------------------------------------------------------
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.numeric_std.all;
library work;
library work;
use work.convert_pkg.all;
use work.convert_pkg.all;
use work.wishbone_pkg.all;
use work.wishbone_pkg.all;
 
 
-- entity ------------------------------------------------------------
-- entity ------------------------------------------------------------
entity core_top is
entity core_top is
  generic(
  generic(
    g_number_of_in_signals          : natural := 1;
    g_number_of_in_signals          : natural := 1;
    g_number_of_out_signals         : natural := 1
    g_number_of_out_signals         : natural := 1
    );
    );
  port(
  port(
    clock_i                         : in std_logic;
    clock_i                         : in std_logic;
    reset_i                         : in std_logic;
    reset_i                         : in std_logic;
    signals_i                       : in std_logic_vector(g_number_of_in_signals-1 downto 0);
    signals_i                       : in std_logic_vector(g_number_of_in_signals-1 downto 0);
    signals_o                       : out std_logic_vector(g_number_of_out_signals-1 downto 0)
    signals_o                       : out std_logic_vector(g_number_of_out_signals-1 downto 0)
    );
    );
end core_top;
end core_top;
 
 
--=architecture===============================================================
-- architecture ------------------------------------------------------
architecture rtl of core_top is
architecture rtl of core_top is
  --============================================================================
  ------------------------------------------------------------------------------
  -- signal declaration
  -- signal declaration
  --============================================================================
  ------------------------------------------------------------------------------
  signal    shift_register_r   : std_logic_vector (g_number_of_out_signals-1 downto 0);
  signal    shift_register_r   : std_logic_vector (g_number_of_out_signals-1 downto 0);
  signal    old_shift_clock_r  : std_logic := '0';
  signal    old_shift_clock_r  : std_logic := '0';
  --============================================================================
  ------------------------------------------------------------------------------
begin
begin
  ------------------------------------------------------------------------------
  ------------------------------------------------------------------------------
  -- module instantiation
  -- module instantiation
  ------------------------------------------------------------------------------
  ------------------------------------------------------------------------------
  proc_shift_register : process (all)
  proc_shift_register : process (all)
    begin
    begin
      if (reset_i = '1' ) then
      if (reset_i = '1' ) then
        shift_register_r <= (others => '0');
        shift_register_r <= (others => '0');
      elsif (rising_edge(clock_i)) then
      elsif (rising_edge(clock_i)) then
        old_shift_clock_r <= signals_i(1);
        old_shift_clock_r <= signals_i(1);
        if (signals_i(1) = '1' AND old_shift_clock_r= '0') then
        if (signals_i(1) = '1' AND old_shift_clock_r= '0') then
          shift_register_r        <= shift_register_r(shift_register_r'left-1 downto 0) & signals_i(0);
          shift_register_r        <= shift_register_r(shift_register_r'left-1 downto 0) & signals_i(0);
        end if;
        end if;
      end if;
      end if;
    end process;
    end process;
  ------------------------------------------------------------------------------
  ------------------------------------------------------------------------------
  signals_o <= shift_register_r;
  signals_o <= shift_register_r;
  ------------------------------------------------------------------------------
  ------------------------------------------------------------------------------
  ------------------------------------------------------------------------------
 
  ------------------------------------------------------------------------------
 
  ------------------------------------------------------------------------------
 
--============================================================================
 
end rtl; --core_top
 
--============================================================================
 
-- end of file
 
--============================================================================
 
 
 
 No newline at end of file
 No newline at end of file
 
end rtl;
 
----------------------------------------------------------------------
 
---- end of file                                                  ---- 
 
----------------------------------------------------------------------
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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