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

Subversion Repositories common_components

[/] [common_components/] [trunk/] [common_pipeline_sl.vhd] - Blame information for rev 3

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

Line No. Rev Author Line
1 3 danv
-------------------------------------------------------------------------------
2
--
3
-- Copyright (C) 2009
4
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
5
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
6
--
7
-- This program is free software: you can redistribute it and/or modify
8
-- it under the terms of the GNU General Public License as published by
9
-- the Free Software Foundation, either version 3 of the License, or
10
-- (at your option) any later version.
11
--
12
-- This program is distributed in the hope that it will be useful,
13
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
-- GNU General Public License for more details.
16
--
17
-- You should have received a copy of the GNU General Public License
18
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
--
20
-------------------------------------------------------------------------------
21
 
22
LIBRARY IEEE, common_pkg_lib;
23
USE IEEE.std_logic_1164.ALL;
24
USE IEEE.numeric_std.ALL;
25
USE common_pkg_lib.common_pkg.ALL;
26
 
27
ENTITY common_pipeline_sl IS
28
  GENERIC (
29
    g_pipeline       : NATURAL := 1;  -- 0 for wires, > 0 for registers, 
30
    g_reset_value    : NATURAL := 0;  -- 0 or 1, bit reset value,
31
    g_out_invert     : BOOLEAN := FALSE
32
  );
33
  PORT (
34
    rst     : IN  STD_LOGIC := '0';
35
    clk     : IN  STD_LOGIC;
36
    clken   : IN  STD_LOGIC := '1';
37
    in_clr  : IN  STD_LOGIC := '0';
38
    in_en   : IN  STD_LOGIC := '1';
39
    in_dat  : IN  STD_LOGIC;
40
    out_dat : OUT STD_LOGIC
41
  );
42
END common_pipeline_sl;
43
 
44
 
45
ARCHITECTURE str OF common_pipeline_sl IS
46
 
47
  SIGNAL in_dat_slv  : STD_LOGIC_VECTOR(0 DOWNTO 0);
48
  SIGNAL out_dat_slv  : STD_LOGIC_VECTOR(0 DOWNTO 0);
49
 
50
BEGIN
51
 
52
  in_dat_slv(0) <= in_dat WHEN g_out_invert=FALSE ELSE NOT in_dat;
53
  out_dat       <= out_dat_slv(0);
54
 
55
  u_sl : ENTITY work.common_pipeline
56
  GENERIC MAP (
57
    g_representation => "UNSIGNED",
58
    g_pipeline       => g_pipeline,
59
    g_reset_value    => sel_a_b(g_out_invert, 1-g_reset_value, g_reset_value),
60
    g_in_dat_w       => 1,
61
    g_out_dat_w      => 1
62
  )
63
  PORT MAP (
64
    rst     => rst,
65
    clk     => clk,
66
    clken   => clken,
67
    in_clr  => in_clr,
68
    in_en   => in_en,
69
    in_dat  => in_dat_slv,
70
    out_dat => out_dat_slv
71
  );
72
 
73
END str;

powered by: WebSVN 2.1.0

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