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

Subversion Repositories astron_multiplexer

[/] [astron_multiplexer/] [trunk/] [common_multiplexer.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 danv
-------------------------------------------------------------------------------
2
--
3
-- Copyright (C) 2012
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, common_components_lib;
23
USE IEEE.STD_LOGIC_1164.ALL;
24
USE common_pkg_lib.common_pkg.ALL;
25
 
26
-- Purpose: Assign one of g_nof_in input streams to the output based on in_sel input
27
-- Description: The input streams are concatenated into one SLV.
28
-- Remarks:
29
 
30
ENTITY common_multiplexer IS
31
  GENERIC (
32
    g_pipeline_in  : NATURAL := 0;
33
    g_pipeline_out : NATURAL := 0;
34
    g_nof_in       : NATURAL;
35
    g_dat_w        : NATURAL
36
 );
37
  PORT (
38
    clk         : IN  STD_LOGIC;
39
    rst         : IN  STD_LOGIC;
40
 
41
    in_sel      : IN  STD_LOGIC_VECTOR(ceil_log2(g_nof_in)-1 DOWNTO 0);
42
    in_dat      : IN  STD_LOGIC_VECTOR(g_nof_in*g_dat_w-1 DOWNTO 0);
43
    in_val      : IN  STD_LOGIC;
44
 
45
    out_dat     : OUT STD_LOGIC_VECTOR(g_dat_w-1 DOWNTO 0);
46
    out_val     : OUT STD_LOGIC
47
  );
48
END;
49
 
50
ARCHITECTURE str OF common_multiplexer IS
51
 
52
BEGIN
53
 
54
  u_select_symbol : ENTITY common_components_lib.common_select_symbol
55
  GENERIC MAP (
56
    g_pipeline_in  => g_pipeline_in,
57
    g_pipeline_out => g_pipeline_out,
58
    g_nof_symbols  => g_nof_in,
59
    g_symbol_w     => g_dat_w,
60
    g_sel_w        => ceil_log2(g_nof_in)
61
  )
62
  PORT MAP (
63
    rst        => rst,
64
    clk        => clk,
65
 
66
    in_data    => in_dat,
67
    in_val     => in_val,
68
 
69
    in_sel     => in_sel,
70
 
71
    out_symbol => out_dat,
72
    out_val    => out_val
73
  );
74
 
75
END str;

powered by: WebSVN 2.1.0

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