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 5

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

Line No. Rev Author Line
1 3 danv
-------------------------------------------------------------------------------
2
--
3 4 danv
-- Copyright 2020
4 3 danv
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
5
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
6 4 danv
-- 
7
-- Licensed under the Apache License, Version 2.0 (the "License");
8
-- you may not use this file except in compliance with the License.
9
-- You may obtain a copy of the License at
10
-- 
11
--     http://www.apache.org/licenses/LICENSE-2.0
12
-- 
13
-- Unless required by applicable law or agreed to in writing, software
14
-- distributed under the License is distributed on an "AS IS" BASIS,
15
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
-- See the License for the specific language governing permissions and
17
-- limitations under the License.
18 3 danv
--
19
-------------------------------------------------------------------------------
20
 
21
LIBRARY IEEE, common_pkg_lib;
22
USE IEEE.std_logic_1164.ALL;
23
USE IEEE.numeric_std.ALL;
24
USE common_pkg_lib.common_pkg.ALL;
25
 
26
ENTITY common_pipeline_sl IS
27
  GENERIC (
28
    g_pipeline       : NATURAL := 1;  -- 0 for wires, > 0 for registers, 
29
    g_reset_value    : NATURAL := 0;  -- 0 or 1, bit reset value,
30
    g_out_invert     : BOOLEAN := FALSE
31
  );
32
  PORT (
33
    rst     : IN  STD_LOGIC := '0';
34
    clk     : IN  STD_LOGIC;
35
    clken   : IN  STD_LOGIC := '1';
36
    in_clr  : IN  STD_LOGIC := '0';
37
    in_en   : IN  STD_LOGIC := '1';
38
    in_dat  : IN  STD_LOGIC;
39
    out_dat : OUT STD_LOGIC
40
  );
41
END common_pipeline_sl;
42
 
43
 
44
ARCHITECTURE str OF common_pipeline_sl IS
45
 
46
  SIGNAL in_dat_slv  : STD_LOGIC_VECTOR(0 DOWNTO 0);
47
  SIGNAL out_dat_slv  : STD_LOGIC_VECTOR(0 DOWNTO 0);
48
 
49
BEGIN
50
 
51
  in_dat_slv(0) <= in_dat WHEN g_out_invert=FALSE ELSE NOT in_dat;
52
  out_dat       <= out_dat_slv(0);
53
 
54
  u_sl : ENTITY work.common_pipeline
55
  GENERIC MAP (
56
    g_representation => "UNSIGNED",
57
    g_pipeline       => g_pipeline,
58
    g_reset_value    => sel_a_b(g_out_invert, 1-g_reset_value, g_reset_value),
59
    g_in_dat_w       => 1,
60
    g_out_dat_w      => 1
61
  )
62
  PORT MAP (
63
    rst     => rst,
64
    clk     => clk,
65
    clken   => clken,
66
    in_clr  => in_clr,
67
    in_en   => in_en,
68
    in_dat  => in_dat_slv,
69
    out_dat => out_dat_slv
70
  );
71
 
72
END str;

powered by: WebSVN 2.1.0

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