source: firmware/FAD/FACT_FAD_lib/hdl/trigger_counter_beha.vhd

Last change on this file was 11755, checked in by neise, 13 years ago
reinit of this svn repos .... it was all too messy deleted the old folders and restarted with FACT_FAD_lib only. (well and the testbenches)
File size: 1.1 KB
Line 
1--
2-- VHDL Architecture FACT_FAD_TB_lib.trigger_counter.beha
3--
4-- Created:
5-- by - FPGA_Developer.UNKNOWN (EEPC8)
6-- at - 14:36:14 10.02.2010
7--
8-- using Mentor Graphics HDL Designer(TM) 2008.1 (Build 17)
9--
10LIBRARY ieee;
11USE ieee.std_logic_1164.all;
12use ieee.std_logic_arith.all;
13use ieee.std_logic_unsigned.all;
14
15
16entity trigger_counter is
17 port(
18 trigger_id : out std_logic_vector(31 downto 0);
19 trigger : in std_logic;
20 reset : in std_logic;
21 clk : in std_logic
22 );
23
24end entity trigger_counter;
25
26architecture beha of trigger_counter is
27
28 signal trigger_sr : std_logic_vector (1 downto 0) := "00";
29 signal reset_sr : std_logic_vector (1 downto 0) := "00";
30 signal temp_id : integer := 0;
31
32begin
33
34 trigger_id <= conv_std_logic_vector(temp_id, 32);
35
36 trigger_incr_proc: process(clk)
37 begin
38 if rising_edge(clk) then
39 reset_sr <= reset_sr(0) & reset;
40 trigger_sr <= trigger_sr(0) & trigger;
41 if (trigger_sr = "01") then
42 temp_id <= temp_id + 1;
43 end if;
44 if (reset_sr = "01") then
45 temp_id <= 0;
46 end if;
47 end if;
48 end process trigger_incr_proc;
49
50end architecture beha;
51
Note: See TracBrowser for help on using the repository browser.