1 |
2 |
idiolatrie |
--------------------------------------------------------------------------------
|
2 |
|
|
-- EtherLab Common Package --
|
3 |
|
|
--------------------------------------------------------------------------------
|
4 |
|
|
-- Copyright (C)2012 Mathias Hörtnagl <mathias.hoertnagl@gmail.com> --
|
5 |
|
|
-- --
|
6 |
|
|
-- This program is free software: you can redistribute it and/or modify --
|
7 |
|
|
-- it under the terms of the GNU General Public License as published by --
|
8 |
|
|
-- the Free Software Foundation, either version 3 of the License, or --
|
9 |
|
|
-- (at your option) any later version. --
|
10 |
|
|
-- --
|
11 |
|
|
-- This program is distributed in the hope that it will be useful, --
|
12 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
|
13 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --
|
14 |
|
|
-- GNU General Public License for more details. --
|
15 |
|
|
-- --
|
16 |
|
|
-- You should have received a copy of the GNU General Public License --
|
17 |
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>. --
|
18 |
|
|
--------------------------------------------------------------------------------
|
19 |
|
|
library ieee;
|
20 |
|
|
use ieee.std_logic_1164.all;
|
21 |
|
|
use ieee.numeric_std.all;
|
22 |
|
|
|
23 |
|
|
package common is
|
24 |
|
|
|
25 |
|
|
-- Array for channel data.
|
26 |
|
|
type data_t is array(7 downto 0) of std_logic_vector(15 downto 0);
|
27 |
|
|
|
28 |
|
|
-- Channel constants.
|
29 |
|
|
constant CHANNEL_A : natural range 0 to 7 := 0;
|
30 |
|
|
constant CHANNEL_B : natural range 0 to 7 := 1;
|
31 |
|
|
constant CHANNEL_C : natural range 0 to 7 := 2;
|
32 |
|
|
constant CHANNEL_D : natural range 0 to 7 := 3;
|
33 |
|
|
constant CHANNEL_E : natural range 0 to 7 := 4;
|
34 |
|
|
constant CHANNEL_F : natural range 0 to 7 := 5;
|
35 |
|
|
constant CHANNEL_G : natural range 0 to 7 := 6;
|
36 |
|
|
constant CHANNEL_H : natural range 0 to 7 := 7;
|
37 |
|
|
|
38 |
|
|
-- Check, if channel flag is set.
|
39 |
|
|
function isSet(el_chnl : std_logic_vector; channel : natural) return boolean;
|
40 |
|
|
end common;
|
41 |
|
|
|
42 |
|
|
package body common is
|
43 |
|
|
|
44 |
|
|
-- Check, if channel flag is set.
|
45 |
|
|
function isSet(el_chnl : std_logic_vector; channel : natural)
|
46 |
|
|
return boolean is
|
47 |
|
|
begin
|
48 |
|
|
return (el_chnl(channel) = '1');
|
49 |
|
|
end;
|
50 |
|
|
end common;
|