00001 ------------------------------------------------------------------------------ 00002 -- This file is a part of the LPP VHDL IP LIBRARY 00003 -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS 00004 -- 00005 -- This program is free software; you can redistribute it and/or modify 00006 -- it under the terms of the GNU General Public License as published by 00007 -- the Free Software Foundation; either version 3 of the License, or 00008 -- (at your option) any later version. 00009 -- 00010 -- This program is distributed in the hope that it will be useful, 00011 -- but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 -- GNU General Public License for more details. 00014 -- 00015 -- You should have received a copy of the GNU General Public License 00016 -- along with this program; if not, write to the Free Software 00017 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 ------------------------------------------------------------------------------ 00019 -- Author : Martin Morlot 00020 -- Mail : martin.morlot@lpp.polytechnique.fr 00021 ------------------------------------------------------------------------------ 00022 library IEEE; 00023 use IEEE.std_logic_1164.all; 00024 use IEEE.numeric_std.all; 00025 00027 00028 entity Gene_SYNC is 00029 port( 00030 SCLK,raz : in std_logic; 00031 enable : in std_logic; 00032 OKAI_send : out std_logic; 00033 SYNC : out std_logic 00034 ); 00035 end Gene_SYNC; 00036 00038 00039 architecture ar_Gene_SYNC of Gene_SYNC is 00040 00041 signal count : integer; 00042 00043 begin 00044 process (SCLK,raz) 00045 begin 00046 if(raz='0')then 00047 SYNC <= '0'; 00048 count <= 14; 00049 OKAI_send <= '0'; 00050 00051 elsif(SCLK' event and SCLK='1')then 00052 if(enable='1')then 00053 00054 if(count=15)then 00055 SYNC <= '1'; 00056 count <= count+1; 00057 elsif(count=16)then 00058 count <= 0; 00059 SYNC <= '0'; 00060 OKAI_send <= '1'; 00061 else 00062 count <= count+1; 00063 OKAI_send <= '0'; 00064 end if; 00065 00066 end if; 00067 end if; 00068 end process; 00069 end ar_Gene_SYNC;
© Copyright 2011 LPP-CNRS | Design by Alexis Jeandet