daq_header Package Body Reference

Functions used in DAQ modules. More...

List of all members.

Package >> daq_header

Functions

std_logic_vector  reverse_any_vector ( a: in std_logic_vector )
 bit reversal of any vector
integer  cnt_ones ( vec_in: in std_logic_vector(31 downto 0) )
 count bits equal '1'
std_logic  dec13 ( D: in std_logic_vector (2 downto 0) )
 1 out of 3 decoder
std_logic  dec23 ( DAT: in std_logic_vector (2 downto 0) )
 2 out of 3 decoder
std_logic  ris_pattern ( A: in std_logic_vector (3 downto 0) )
 pattern for rising edge
std_logic  ris_hole_pattern ( A: in std_logic_vector (3 downto 0) )
 pattern for rising edge hole
std_logic  fal_pattern ( A: in std_logic_vector (3 downto 0) )
 pattern for falling edge
std_logic  fal_hole_pattern ( A: in std_logic_vector (3 downto 0) )
 pattern for falling edge hole
std_logic  spike_suppress ( A: in std_logic_vector (2 downto 0) )
 pattern for spike suppression
std_logic  or_check_long ( B: in std_logic_vector (31 downto 0) )
 OR over all elements of a 32 bit vector.
std_logic  or_check ( B: in std_logic_vector (31 downto 0) )
 logical OR over vector with period of 8 bits
integer  lowest_zero ( b: in std_logic_vector (2 downto 0) )
 returns index in integer of the lowest zero in a 3 bit vector


Detailed Description

Functions used in DAQ modules.

Definition at line 69 of file daq_header.vhd.


Member Function Documentation

[Function]
integer cnt_ones ( vec_in in std_logic_vector(31 downto 0) )

count bits equal '1'

Definition at line 85 of file daq_header.vhd.

00085   function cnt_ones (vec_in : std_logic_vector(31 downto 0))
00086     return integer is
00087     variable cnt : integer range 0 to vec_in'length := 0;
00088   begin
00089     for i in 0 to (vec_in'length)-1 loop
00090       if vec_in(i) = '1' then
00091         cnt := cnt + 1;
00092       end if;
00093     end loop;  -- i
00094     return cnt;
00095   end cnt_ones;

[Function]
std_logic dec13 ( D in std_logic_vector (2 downto 0) )

1 out of 3 decoder

Definition at line 98 of file daq_header.vhd.

00098   function dec13 (D : std_logic_vector (2 downto 0))
00099     return std_logic is
00100     variable R                : std_logic := '0';
00101     variable a, b, c, e, f, g : std_logic := '0';
00102   begin
00103     a := D(2);
00104     b := D(1);
00105     c := D(0);
00106     g := not(a);
00107     e := not(b);
00108     f := not(c);
00109     if ((a and e and f) or (g and b and f) or (g and e and c)) = '1' then
00110       R := '1';
00111     else
00112       R := '0';
00113     end if;
00114     return R;
00115   end dec13;

[Function]
std_logic dec23 ( DAT in std_logic_vector (2 downto 0) )

2 out of 3 decoder

Definition at line 118 of file daq_header.vhd.

00118   function dec23 (DAT : std_logic_vector (2 downto 0))
00119     return std_logic is
00120     variable X                : std_logic := '0';
00121     variable a, b, c, e, f, g : std_logic := '0';
00122   begin
00123     a := DAT(2);
00124     b := DAT(1);
00125     c := DAT(0);
00126     g := not(a);
00127     e := not(b);
00128     f := not(c);
00129     X := (a and b and f) or (a and e and c) or (g and b and c);
00130     return X;
00131   end dec23;

[Function]
std_logic fal_hole_pattern ( A in std_logic_vector (3 downto 0) )

pattern for falling edge hole

Definition at line 155 of file daq_header.vhd.

00155   function fal_hole_pattern (A : std_logic_vector (3 downto 0))
00156     return std_logic is
00157   begin
00158     return (A(3) and (not A(2)) and A(1) and A(0));
00159   end fal_hole_pattern;

[Function]
std_logic fal_pattern ( A in std_logic_vector (3 downto 0) )

pattern for falling edge

Definition at line 148 of file daq_header.vhd.

00148   function fal_pattern (A : std_logic_vector (3 downto 0))
00149     return std_logic is
00150   begin
00151     return ((not A(0)) and (not A(1)) and A(2) and A(3));
00152   end fal_pattern;

[Function]
integer lowest_zero ( b in std_logic_vector (2 downto 0) )

returns index in integer of the lowest zero in a 3 bit vector

Definition at line 190 of file daq_header.vhd.

00190   function lowest_zero (b : std_logic_vector (2 downto 0))
00191     return integer is
00192     variable R : integer range 0 to 3 := 0;
00193   begin
00194     if b(0) = '0' then
00195       R := 0;
00196     elsif b(1) = '0' then
00197       R := 1;
00198     elsif b(2) = '0' then
00199       R := 2;
00200     else
00201       R := 3;
00202     end if;
00203     return R;
00204   end lowest_zero;

[Function]
std_logic or_check ( B in std_logic_vector (31 downto 0) )

logical OR over vector with period of 8 bits

Definition at line 180 of file daq_header.vhd.

00180   function or_check (B : std_logic_vector (31 downto 0))
00181     return std_logic is
00182     variable R : std_logic := '0';
00183   begin
00184     R := B(31) or B(30) or B(29) or B(28) or B(27) or B(26) or B(25) or B(24);
00185     return R;
00186   end or_check;

[Function]
std_logic or_check_long ( B in std_logic_vector (31 downto 0) )

OR over all elements of a 32 bit vector.

Definition at line 169 of file daq_header.vhd.

00169   function or_check_long (B : std_logic_vector (31 downto 0))
00170     return std_logic is
00171     variable R : std_logic := '0';
00172   begin
00173     R := B(31) or B(30) or B(29) or B(28) or B(27) or B(26) or B(25) or B(24) or B(23) or B(22) or B(21) or B(20)
00174          or B(19) or B(18) or B(17) or B(16) or B(15) or B(14) or B(13) or B(12) or B(11) or B(10) or B(9) or B(8)
00175          or B(7) or B(6) or B(5) or B(4) or B(3) or B(2) or B(1) or B(0);
00176     return R;
00177   end or_check_long;

[Function]
std_logic_vector reverse_any_vector ( a in std_logic_vector )

bit reversal of any vector

Definition at line 73 of file daq_header.vhd.

00073   function reverse_any_vector (a : in std_logic_vector)
00074     return std_logic_vector is
00075     variable result : std_logic_vector(a'range);
00076     alias aa        : std_logic_vector(a'reverse_range) is a;
00077   begin
00078     for i in aa'range loop
00079       result(i) := aa(i);
00080     end loop;
00081     return result;
00082   end reverse_any_vector;

[Function]
std_logic ris_hole_pattern ( A in std_logic_vector (3 downto 0) )

pattern for rising edge hole

Definition at line 141 of file daq_header.vhd.

00141   function ris_hole_pattern (A : std_logic_vector (3 downto 0))
00142     return std_logic is
00143   begin
00144     return (A(3) and A(2) and (not A(1)) and A(0));
00145   end ris_hole_pattern;

[Function]
std_logic ris_pattern ( A in std_logic_vector (3 downto 0) )

pattern for rising edge

Definition at line 134 of file daq_header.vhd.

00134   function ris_pattern (A : std_logic_vector (3 downto 0))
00135     return std_logic is
00136   begin
00137     return ((not A(3)) and (not A(2)) and A(1) and A(0));
00138   end ris_pattern;

[Function]
std_logic spike_suppress ( A in std_logic_vector (2 downto 0) )

pattern for spike suppression

Definition at line 162 of file daq_header.vhd.

00162   function spike_suppress (A : std_logic_vector (2 downto 0))
00163     return std_logic is
00164   begin
00165     return not ((not A(2)) and A(1) and (not A(0)));
00166   end spike_suppress;


The documentation for this class was generated from the following file:

Author: M.Niegl
Generated on Tue Nov 4 00:47:06 2008 for BCM-AAA by doxygen 1.5.7.1-20081012