source: firmware/FTM/Lightpulser_interface/Basic_Version/single_LP_Basic.vhd@ 11051

Last change on this file since 11051 was 10879, checked in by weitzel, 14 years ago
FTM: new light pulser interface, new timing constraint in .ucf file
File size: 2.7 KB
Line 
1----------------------------------------------------------------------------------
2-- Company: ETH Zurich, Institute for Particle Physics
3-- Engineer: Patrick Vogler
4--
5-- Create Date: March 2 2010
6-- Design Name:
7-- Module Name: FTM Lightpulser interface: single lightpulser
8-- Project Name:
9-- Target Devices:
10-- Tool versions:
11-- Description: generates the signals to control a single lightpulser
12--
13-- Dependencies:
14--
15-- Revision:
16-- Revision 0.01 - File Created
17-- Additional Comments:
18--
19--
20-- modifications:
21--
22--
23--
24-- modified: May 26 2011
25-- by Patrick Vogler
26-- "Lightpulser Basic Version"
27--
28-- modified: May 27 2011
29-- by Patrick Vogler
30--
31-- modified: May 27 2011
32-- by Patrick Vogler, Quirin Weitzel
33-- -> clean up
34----------------------------------------------------------------------------------
35----------------------------------------------------------------------------------
36
37library IEEE;
38use IEEE.STD_LOGIC_1164.ALL;
39use IEEE.STD_LOGIC_ARITH.ALL;
40use IEEE.STD_LOGIC_UNSIGNED.ALL;
41
42
43library ftm_definitions;
44USE ftm_definitions.ftm_array_types.all;
45USE ftm_definitions.ftm_constants.all;
46
47
48
49entity single_LP_Basic is
50 port(
51
52-- Clock
53-------------------------------------------------------------------------------
54 clk_50 : IN STD_LOGIC; -- 50 MHz system clock
55-- clk_250 : IN STD_LOGIC; -- 250 MHz system clock
56
57-- Lightpulser
58-------------------------------------------------------------------------------
59 LP_Pulse_out : out STD_LOGIC :='0'; --
60
61
62-- FPGA intern signals: Lightpulser brightness
63-------------------------------------------------------------------------------
64 LP_pulse_in : in std_logic -- trigger lightpulse
65
66-- LP_delay : in std_logic_vector (15 downto 0)
67 );
68end single_LP_Basic;
69
70architecture Behavioral of single_LP_Basic is
71
72signal LP_in_prev : STD_LOGIC := '0';
73signal Pulse_Flag : STD_LOGIC := '0';
74
75begin
76
77single_LP_Basic_proc: process (clk_50)
78
79variable Y : integer range 0 to FLD_PULSE_LENGTH_BASIC;
80
81begin
82
83 if rising_edge(clk_50) then
84 LP_in_prev <= LP_pulse_in;
85
86 if ((LP_pulse_in = '1') and (LP_in_prev = '0')) then
87 Pulse_Flag <= '1';
88 end if;
89
90 if (Pulse_Flag = '1') then
91 if (Y < FLD_PULSE_LENGTH_BASIC) then
92 Y := Y + 1;
93 LP_Pulse_out <= '1';
94 else
95 Y := 0;
96 LP_Pulse_out <= '0';
97 Pulse_Flag <= '0';
98 end if;
99 end if;
100
101 end if;
102
103end process single_LP_Basic_proc;
104
105end Behavioral;
Note: See TracBrowser for help on using the repository browser.