1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -14,8 +14,11 | |||||
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 |
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------- |
|
18 | ------------------------------------------------------------------------------- | |
|
19 | -- Author : Martin Morlot | |||
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | -----------------------------------------------------------------------------*/ | |||
19 | #ifndef APB_CNA_DRIVER_H |
|
22 | #ifndef APB_CNA_DRIVER_H | |
20 | #define APB_CNA_DRIVER_H |
|
23 | #define APB_CNA_DRIVER_H | |
21 |
|
24 | |||
@@ -28,10 +31,11 | |||||
28 | T Y P E S D E F |
|
31 | T Y P E S D E F | |
29 | ====================================================*/ |
|
32 | ====================================================*/ | |
30 |
|
33 | |||
|
34 | /** Structure repr�sentant le registre du CNA */ | |||
31 | struct DAC_Driver |
|
35 | struct DAC_Driver | |
32 | { |
|
36 | { | |
33 | int configReg; |
|
37 | int configReg; /**< Registre de configuration: Flag Ready [1] ; Flag Enable [0] */ | |
34 | int dataReg; |
|
38 | int dataReg; /**< Registre de donn�e sur 16 bits */ | |
35 | }; |
|
39 | }; | |
36 |
|
40 | |||
37 | typedef struct DAC_Driver DAC_Device; |
|
41 | typedef struct DAC_Driver DAC_Device; | |
@@ -40,12 +44,15 typedef struct DAC_Driver DAC_Device; | |||||
40 | F U N C T I O N S |
|
44 | F U N C T I O N S | |
41 | ====================================================*/ |
|
45 | ====================================================*/ | |
42 |
|
46 | |||
|
47 | /** Ouvre l'acc� au CNA */ | |||
43 | DAC_Device* DacOpen(int count); |
|
48 | DAC_Device* DacOpen(int count); | |
44 |
|
49 | |||
45 | //DAC_Device* DacClose(int count); |
|
50 | //DAC_Device* DacClose(int count); | |
46 |
|
51 | |||
|
52 | /** Les donn�es sont lus a partir d'un tableau pour obtenir le signal de CAL (10Khz + 625hz) */ | |||
47 | int DacTable(); |
|
53 | int DacTable(); | |
48 |
|
54 | |||
|
55 | /** Les donn�es sont entr�e par l'utilisateur, la conversion se fait a chaque nouvelle donn�e */ | |||
49 | int DacConst(); |
|
56 | int DacConst(); | |
50 |
|
57 | |||
51 |
|
58 |
@@ -16,6 +16,9 | |||||
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | -------------------------------------------------------------------------------*/ |
|
18 | -------------------------------------------------------------------------------*/ | |
|
19 | /*-- Author : Alexis Jeandet | |||
|
20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr | |||
|
21 | ----------------------------------------------------------------------------*/ | |||
19 | #ifndef APB_LCD_DRIVER_H |
|
22 | #ifndef APB_LCD_DRIVER_H | |
20 | #define APB_LCD_DRIVER_H |
|
23 | #define APB_LCD_DRIVER_H | |
21 |
|
24 |
@@ -16,6 +16,9 | |||||
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | -------------------------------------------------------------------------------*/ |
|
18 | -------------------------------------------------------------------------------*/ | |
|
19 | /*-- Author : Alexis Jeandet | |||
|
20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr | |||
|
21 | ----------------------------------------------------------------------------*/ | |||
19 | #ifndef LPP_APB_FUNCTIONS_H |
|
22 | #ifndef LPP_APB_FUNCTIONS_H | |
20 | #define LPP_APB_FUNCTIONS_H |
|
23 | #define LPP_APB_FUNCTIONS_H | |
21 |
|
24 |
@@ -14,8 +14,11 | |||||
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 |
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------- |
|
18 | ------------------------------------------------------------------------------- | |
|
19 | -- Author : Martin Morlot | |||
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | -----------------------------------------------------------------------------*/ | |||
19 | #include "apb_dac_Driver.h" |
|
22 | #include "apb_dac_Driver.h" | |
20 | #include "lpp_apb_functions.h" |
|
23 | #include "lpp_apb_functions.h" | |
21 | #include <stdio.h> |
|
24 | #include <stdio.h> |
@@ -14,8 +14,11 | |||||
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 |
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------- |
|
18 | ------------------------------------------------------------------------------- | |
|
19 | -- Author : Martin Morlot | |||
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | -----------------------------------------------------------------------------*/ | |||
19 | #ifndef APB_CNA_DRIVER_H |
|
22 | #ifndef APB_CNA_DRIVER_H | |
20 | #define APB_CNA_DRIVER_H |
|
23 | #define APB_CNA_DRIVER_H | |
21 |
|
24 | |||
@@ -28,10 +31,11 | |||||
28 | T Y P E S D E F |
|
31 | T Y P E S D E F | |
29 | ====================================================*/ |
|
32 | ====================================================*/ | |
30 |
|
33 | |||
|
34 | /** Structure repr�sentant le registre du CNA */ | |||
31 | struct DAC_Driver |
|
35 | struct DAC_Driver | |
32 | { |
|
36 | { | |
33 | int configReg; |
|
37 | int configReg; /**< Registre de configuration: Flag Ready [1] ; Flag Enable [0] */ | |
34 | int dataReg; |
|
38 | int dataReg; /**< Registre de donn�e sur 16 bits */ | |
35 | }; |
|
39 | }; | |
36 |
|
40 | |||
37 | typedef struct DAC_Driver DAC_Device; |
|
41 | typedef struct DAC_Driver DAC_Device; | |
@@ -40,12 +44,15 typedef struct DAC_Driver DAC_Device; | |||||
40 | F U N C T I O N S |
|
44 | F U N C T I O N S | |
41 | ====================================================*/ |
|
45 | ====================================================*/ | |
42 |
|
46 | |||
|
47 | /** Ouvre l'acc� au CNA */ | |||
43 | DAC_Device* DacOpen(int count); |
|
48 | DAC_Device* DacOpen(int count); | |
44 |
|
49 | |||
45 | //DAC_Device* DacClose(int count); |
|
50 | //DAC_Device* DacClose(int count); | |
46 |
|
51 | |||
|
52 | /** Les donn�es sont lus a partir d'un tableau pour obtenir le signal de CAL (10Khz + 625hz) */ | |||
47 | int DacTable(); |
|
53 | int DacTable(); | |
48 |
|
54 | |||
|
55 | /** Les donn�es sont entr�e par l'utilisateur, la conversion se fait a chaque nouvelle donn�e */ | |||
49 | int DacConst(); |
|
56 | int DacConst(); | |
50 |
|
57 | |||
51 |
|
58 |
@@ -1,5 +1,3 | |||||
1 | amba_lcd_16x2_ctrlr.vhd |
|
|||
2 | apb_lcd_ctrlr.vhd |
|
|||
3 | FRAME_CLK.vhd |
|
1 | FRAME_CLK.vhd | |
4 | LCD_16x2_CFG.vhd |
|
2 | LCD_16x2_CFG.vhd | |
5 | LCD_16x2_DRVR.vhd |
|
3 | LCD_16x2_DRVR.vhd | |
@@ -7,3 +5,5 LCD_16x2_ENGINE.vhd | |||||
7 | LCD_2x16_DRIVER.vhd |
|
5 | LCD_2x16_DRIVER.vhd | |
8 | LCD_CLK_GENERATOR.vhd |
|
6 | LCD_CLK_GENERATOR.vhd | |
9 | Top_LCD.vhd |
|
7 | Top_LCD.vhd | |
|
8 | amba_lcd_16x2_ctrlr.vhd | |||
|
9 | apb_lcd_ctrlr.vhd |
@@ -1,12 +1,12 | |||||
1 | APB_IIR_CEL.vhd |
|
1 | APB_IIR_CEL.vhd | |
|
2 | FILTER.vhd | |||
|
3 | FILTER_RAM_CTRLR.vhd | |||
2 | FILTERcfg.vhd |
|
4 | FILTERcfg.vhd | |
3 | FilterCTRLR.vhd |
|
5 | FilterCTRLR.vhd | |
4 | FILTER_RAM_CTRLR.vhd |
|
|||
5 | FILTER.vhd |
|
|||
6 | IIR_CEL_CTRLR.vhd |
|
6 | IIR_CEL_CTRLR.vhd | |
7 | IIR_CEL_FILTER.vhd |
|
7 | IIR_CEL_FILTER.vhd | |
8 | iir_filter.vhd |
|
8 | RAM.vhd | |
9 | RAM_CEL.vhd |
|
9 | RAM_CEL.vhd | |
10 | RAM_CTRLR2.vhd |
|
10 | RAM_CTRLR2.vhd | |
11 | RAM.vhd |
|
|||
12 | Top_Filtre_IIR.vhd |
|
11 | Top_Filtre_IIR.vhd | |
|
12 | iir_filter.vhd |
@@ -1,14 +1,14 | |||||
1 | Adder.vhd |
|
|||
2 | ADDRcntr.vhd |
|
1 | ADDRcntr.vhd | |
3 | ALU.vhd |
|
2 | ALU.vhd | |
|
3 | Adder.vhd | |||
4 | Clk_divider.vhd |
|
4 | Clk_divider.vhd | |
5 | general_purpose.vhd |
|
5 | MAC.vhd | |
6 | MAC_CONTROLER.vhd |
|
6 | MAC_CONTROLER.vhd | |
7 | MAC_MUX2.vhd |
|
|||
8 | MAC_MUX.vhd |
|
7 | MAC_MUX.vhd | |
|
8 | MAC_MUX2.vhd | |||
9 | MAC_REG.vhd |
|
9 | MAC_REG.vhd | |
10 |
M |
|
10 | MUX2.vhd | |
11 | Multiplier.vhd |
|
11 | Multiplier.vhd | |
12 | MUX2.vhd |
|
|||
13 | REG.vhd |
|
12 | REG.vhd | |
14 | Shifter.vhd |
|
13 | Shifter.vhd | |
|
14 | general_purpose.vhd |
@@ -15,7 +15,10 | |||||
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------ |
|
18 | ------------------------------------------------------------------------------ | |
|
19 | -- Author : Martin Morlot | |||
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | ------------------------------------------------------------------------------ | |||
19 | library ieee; |
|
22 | library ieee; | |
20 | use ieee.std_logic_1164.all; |
|
23 | use ieee.std_logic_1164.all; | |
21 | --use ieee.numeric_std.all; |
|
24 | --use ieee.numeric_std.all; | |
@@ -24,6 +27,7 use grlib.amba.all; | |||||
24 | use grlib.stdlib.all; |
|
27 | use grlib.stdlib.all; | |
25 | use grlib.devices.all; |
|
28 | use grlib.devices.all; | |
26 | library lpp; |
|
29 | library lpp; | |
|
30 | use lpp.apb_devices_list.all; | |||
27 | use lpp.lpp_amba.all; |
|
31 | use lpp.lpp_amba.all; | |
28 |
|
32 | |||
29 |
|
33 |
@@ -27,6 +27,7 use grlib.amba.all; | |||||
27 | use grlib.stdlib.all; |
|
27 | use grlib.stdlib.all; | |
28 | use grlib.devices.all; |
|
28 | use grlib.devices.all; | |
29 | library lpp; |
|
29 | library lpp; | |
|
30 | use lpp.apb_devices_list.all; | |||
30 | use lpp.lpp_amba.all; |
|
31 | use lpp.lpp_amba.all; | |
31 |
|
32 | |||
32 |
|
33 |
@@ -1,6 +1,4 | |||||
|
1 | APB_MULTI_DIODE.vhd | |||
|
2 | APB_SIMPLE_DIODE.vhd | |||
1 | apb_devices_list.vhd |
|
3 | apb_devices_list.vhd | |
2 | APB_MULTI_DIODE.vhd |
|
|||
3 | APB_MULTI_DIODE.vhd.orig |
|
|||
4 | APB_SIMPLE_DIODE.vhd |
|
|||
5 | APB_SIMPLE_DIODE.vhd.orig |
|
|||
6 | lpp_amba.vhd |
|
4 | lpp_amba.vhd |
@@ -1,23 +1,24 | |||||
1 | ------------------------------------------------------------------------------ |
|
1 | ------------------------------------------------------------------------------ | |
2 | -- This file is a part of the LPP VHDL IP LIBRARY |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS |
|
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 3 of the License, or |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------ |
|
18 | ------------------------------------------------------------------------------ | |
19 | -- APB_CNA.vhd |
|
19 | -- Author : Martin Morlot | |
20 |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | ||
|
21 | ------------------------------------------------------------------------------ | |||
21 | library ieee; |
|
22 | library ieee; | |
22 | use ieee.std_logic_1164.all; |
|
23 | use ieee.std_logic_1164.all; | |
23 | library grlib; |
|
24 | library grlib; | |
@@ -29,6 +30,7 use lpp.lpp_amba.all; | |||||
29 | use lpp.apb_devices_list.all; |
|
30 | use lpp.apb_devices_list.all; | |
30 | use lpp.lpp_cna.all; |
|
31 | use lpp.lpp_cna.all; | |
31 |
|
32 | |||
|
33 | --! Driver APB, va faire le lien entre l'IP VHDL du convertisseur et le bus Amba | |||
32 |
|
34 | |||
33 | entity APB_CNA is |
|
35 | entity APB_CNA is | |
34 | generic ( |
|
36 | generic ( | |
@@ -38,16 +40,18 entity APB_CNA is | |||||
38 | pirq : integer := 0; |
|
40 | pirq : integer := 0; | |
39 | abits : integer := 8); |
|
41 | abits : integer := 8); | |
40 | port ( |
|
42 | port ( | |
41 | clk : in std_logic; |
|
43 | clk : in std_logic; --! Horloge du composant | |
42 | rst : in std_logic; |
|
44 | rst : in std_logic; --! Reset general du composant | |
43 | apbi : in apb_slv_in_type; |
|
45 | apbi : in apb_slv_in_type; --! Registre de gestion des entr�es du bus | |
44 | apbo : out apb_slv_out_type; |
|
46 | apbo : out apb_slv_out_type; --! Registre de gestion des sorties du bus | |
45 | SYNC : out std_logic; |
|
47 | SYNC : out std_logic; --! Signal de synchronisation du convertisseur | |
46 | SCLK : out std_logic; |
|
48 | SCLK : out std_logic; --! Horloge systeme du convertisseur | |
47 | DATA : out std_logic |
|
49 | DATA : out std_logic --! Donn�e num�rique s�rialis� | |
48 | ); |
|
50 | ); | |
49 | end APB_CNA; |
|
51 | end APB_CNA; | |
50 |
|
52 | |||
|
53 | --! @details Les deux registres (apbi,apbo) permettent de g�rer la communication sur le bus | |||
|
54 | --! et les sorties seront cabl�es vers le convertisseur. | |||
51 |
|
55 | |||
52 | architecture ar_APB_CNA of APB_CNA is |
|
56 | architecture ar_APB_CNA of APB_CNA is | |
53 |
|
57 |
@@ -1,42 +1,46 | |||||
1 | ------------------------------------------------------------------------------ |
|
1 | ------------------------------------------------------------------------------ | |
2 | -- This file is a part of the LPP VHDL IP LIBRARY |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS |
|
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 3 of the License, or |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------ |
|
18 | ------------------------------------------------------------------------------ | |
19 | -- CNA_TabloC.vhd |
|
19 | -- Author : Martin Morlot | |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | ------------------------------------------------------------------------------ | |||
20 | library IEEE; |
|
22 | library IEEE; | |
21 | use IEEE.std_logic_1164.all; |
|
23 | use IEEE.std_logic_1164.all; | |
22 | use IEEE.numeric_std.all; |
|
24 | use IEEE.numeric_std.all; | |
23 | use work.Convertisseur_config.all; |
|
25 | use work.Convertisseur_config.all; | |
24 |
|
26 | |||
|
27 | --! Programme du Convertisseur Num�rique/Analogique | |||
|
28 | ||||
25 | entity CNA_TabloC is |
|
29 | entity CNA_TabloC is | |
26 |
|
|
30 | port( | |
27 | clock : in std_logic; |
|
31 | clock : in std_logic; --! Horloge du composant | |
28 | rst : in std_logic; |
|
32 | rst : in std_logic; --! Reset general du composant | |
29 | enable : in std_logic; |
|
33 | enable : in std_logic; --! Autorise ou non l'utilisation du composant | |
30 | --bp : in std_logic; |
|
34 | Data_C : in std_logic_vector(15 downto 0); --! Donn�e Num�rique d'entr�e sur 16 bits | |
31 | Data_C : in std_logic_vector(15 downto 0); |
|
35 | SYNC : out std_logic; --! Signal de synchronisation du convertisseur | |
32 | SYNC : out std_logic; |
|
36 | SCLK : out std_logic; --! Horloge systeme du convertisseur | |
33 | SCLK : out std_logic; |
|
37 | flag_sd : out std_logic; --! Flag, signale la fin de la s�rialisation d'une donn�e | |
34 | --Rz : out std_logic; |
|
38 | Data : out std_logic --! Donn�e num�rique s�rialis� | |
35 | flag_sd : out std_logic; |
|
39 | ); | |
36 | Data : out std_logic |
|
|||
37 | ); |
|
|||
38 | end CNA_TabloC; |
|
40 | end CNA_TabloC; | |
39 |
|
41 | |||
|
42 | --! @details Un driver C va permettre de g�nerer un tableau de donn�es sur 16 bits, | |||
|
43 | --! qui seront s�rialis� pour �tre ensuite dirig�es vers le convertisseur. | |||
40 |
|
44 | |||
41 | architecture ar_CNA_TabloC of CNA_TabloC is |
|
45 | architecture ar_CNA_TabloC of CNA_TabloC is | |
42 |
|
46 | |||
@@ -50,11 +54,9 signal clk : std_logic; | |||||
50 | signal raz : std_logic; |
|
54 | signal raz : std_logic; | |
51 | signal s_SCLK : std_logic; |
|
55 | signal s_SCLK : std_logic; | |
52 | signal OKAI_send : std_logic; |
|
56 | signal OKAI_send : std_logic; | |
53 | --signal Data_int : std_logic_vector(15 downto 0); |
|
|||
54 |
|
57 | |||
55 | begin |
|
58 | begin | |
56 |
|
59 | |||
57 |
|
||||
58 | CLKINT_0 : CLKINT |
|
60 | CLKINT_0 : CLKINT | |
59 | port map(A => clock, Y => clk); |
|
61 | port map(A => clock, Y => clk); | |
60 |
|
62 | |||
@@ -75,11 +77,6 Serial : entity work.serialize | |||||
75 | port map (clk,raz,s_SCLK,Data_C,OKAI_send,flag_sd,Data); |
|
77 | port map (clk,raz,s_SCLK,Data_C,OKAI_send,flag_sd,Data); | |
76 |
|
78 | |||
77 |
|
79 | |||
78 | --Rz <= raz; |
|
|||
79 | SCLK <= s_SCLK; |
|
80 | SCLK <= s_SCLK; | |
80 |
|
81 | |||
81 | --with bp select |
|
|||
82 | -- Data_int <= X"9555" when '1', |
|
|||
83 | -- Data_C when others; |
|
|||
84 |
|
||||
85 | end ar_CNA_TabloC; No newline at end of file |
|
82 | end ar_CNA_TabloC; |
@@ -1,38 +1,30 | |||||
1 | ------------------------------------------------------------------------------ |
|
1 | ------------------------------------------------------------------------------ | |
2 | -- This file is a part of the LPP VHDL IP LIBRARY |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS |
|
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 3 of the License, or |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------ |
|
18 | ------------------------------------------------------------------------------ | |
19 | -- Convertisseur_config.vhd |
|
19 | -- Author : Martin Morlot | |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | ------------------------------------------------------------------------------ | |||
20 | library IEEE; |
|
22 | library IEEE; | |
21 | use IEEE.std_logic_1164.all; |
|
23 | use IEEE.std_logic_1164.all; | |
22 | use IEEE.numeric_std.all; |
|
24 | use IEEE.numeric_std.all; | |
23 |
|
25 | |||
24 | Package Convertisseur_config is |
|
26 | Package Convertisseur_config is | |
25 |
|
27 | |||
26 |
|
||||
27 | --===========================================================| |
|
|||
28 | --================= Valeurs Sinus 1Khz ======================| |
|
|||
29 | --===========================================================| |
|
|||
30 | type Tbl is array(natural range <>) of std_logic_vector(11 downto 0); |
|
|||
31 | constant Tablo : Tbl (0 to 49):= (X"800",X"901",X"9FD",X"AF2",X"BDB",X"CB4",X"D7A",X"E2A",X"EC1",X"F3D",X"F9C",X"FDC",X"FFC",X"FFC",X"FDC",X"F9C",X"F3D",X"EC1",X"E2A",X"D7A",X"CB4",X"BDB",X"AF2",X"9FD",X"901",X"800",X"6FF",X"603",X"50E",X"425",X"34C",X"286",X"1D6",X"13F",X"0C3",X"064",X"024",X"004",X"004",X"024",X"064",X"0C3",X"13F",X"1D6",X"286",X"34C",X"425",X"50E",X"603",X"6FF"); |
|
|||
32 |
|
||||
33 | --constant Tablo : Tbl (0 to 49):= (X"C00",X"C80",X"CFF",X"D79",X"DED",X"E5A",X"EBD",X"F15",X"F61",X"F9F",X"FCE",X"FEE",X"FFE",X"FFE",X"FEE",X"FCE",X"F9F",X"F61",X"F15",X"EBD",X"E5A",X"DED",X"D79",X"CFF",X"C80",X"C00",X"B80",X"B01",X"A87",X"A13",X"9A6",X"943",X"8EB",X"89F",X"861",X"832",X"812",X"802",X"802",X"812",X"832",X"861",X"89F",X"8EB",X"943",X"9A6",X"A13",X"A87",X"B01",X"B80"); |
|
|||
34 |
|
||||
35 |
|
||||
36 | --===========================================================| |
|
28 | --===========================================================| | |
37 | --============= Fr�quence de s�rialisation ==================| |
|
29 | --============= Fr�quence de s�rialisation ==================| | |
38 | --===========================================================| |
|
30 | --===========================================================| |
@@ -1,58 +1,56 | |||||
1 | ------------------------------------------------------------------------------ |
|
1 | ------------------------------------------------------------------------------ | |
2 | -- This file is a part of the LPP VHDL IP LIBRARY |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS |
|
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 3 of the License, or |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------ |
|
18 | ------------------------------------------------------------------------------ | |
19 | -- Gene_SYNC.vhd |
|
19 | -- Author : Martin Morlot | |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | ------------------------------------------------------------------------------ | |||
20 | library IEEE; |
|
22 | library IEEE; | |
21 | use IEEE.std_logic_1164.all; |
|
23 | use IEEE.std_logic_1164.all; | |
22 | use IEEE.numeric_std.all; |
|
24 | use IEEE.numeric_std.all; | |
23 |
|
25 | |||
24 | entity Gene_SYNC is |
|
26 | --! Programme qui va permettre de g�n�rer le signal SYNC | |
25 |
|
27 | |||
26 | port( |
|
28 | entity Gene_SYNC is | |
27 | SCLK,raz : in std_logic; |
|
29 | port( | |
28 | enable : in std_logic; |
|
30 | SCLK,raz : in std_logic; --! Horloge systeme et Reset du composant | |
29 | -- Sysclk : in std_logic; |
|
31 | enable : in std_logic; --! Autorise ou non l'utilisation du composant | |
30 | OKAI_send : out std_logic; |
|
32 | OKAI_send : out std_logic; --! Flag, Autorise l'envoi (s�rialisation) d'une nouvelle donn�e | |
31 | SYNC : out std_logic |
|
33 | SYNC : out std_logic --! Signal de synchronisation du convertisseur g�n�r� | |
32 | ); |
|
34 | ); | |
33 |
|
||||
34 | end Gene_SYNC; |
|
35 | end Gene_SYNC; | |
35 |
|
36 | |||
|
37 | --! @details NB: Ce programme est uniquement synchronis� sur l'horloge Systeme (sclk) | |||
36 |
|
38 | |||
37 | architecture ar_Gene_SYNC of Gene_SYNC is |
|
39 | architecture ar_Gene_SYNC of Gene_SYNC is | |
38 |
|
40 | |||
39 | --signal Sysclk_reg : std_logic; |
|
|||
40 | signal count : integer; |
|
41 | signal count : integer; | |
41 |
|
42 | |||
42 |
|
||||
43 | begin |
|
43 | begin | |
44 | process (SCLK,raz) |
|
44 | process (SCLK,raz) | |
45 | begin |
|
45 | begin | |
46 | if(raz='0')then |
|
46 | if(raz='0')then | |
47 | SYNC <= '0'; |
|
47 | SYNC <= '0'; | |
48 | -- Sysclk_reg <= '0'; |
|
|||
49 | count <= 14; |
|
48 | count <= 14; | |
50 | OKAI_send <= '0'; |
|
49 | OKAI_send <= '0'; | |
51 |
|
50 | |||
52 | elsif(SCLK' event and SCLK='1')then |
|
51 | elsif(SCLK' event and SCLK='1')then | |
53 | if(enable='1')then |
|
52 | if(enable='1')then | |
54 |
|
53 | |||
55 | -- Sysclk_reg <= Sysclk; |
|
|||
56 | if(count=15)then |
|
54 | if(count=15)then | |
57 | SYNC <= '1'; |
|
55 | SYNC <= '1'; | |
58 | count <= count+1; |
|
56 | count <= count+1; | |
@@ -64,8 +62,8 begin | |||||
64 | count <= count+1; |
|
62 | count <= count+1; | |
65 | OKAI_send <= '0'; |
|
63 | OKAI_send <= '0'; | |
66 | end if; |
|
64 | end if; | |
|
65 | ||||
67 | end if; |
|
66 | end if; | |
68 | end if; |
|
67 | end if; | |
69 |
|
|
68 | end process; | |
70 |
|
||||
71 | end ar_Gene_SYNC; No newline at end of file |
|
69 | end ar_Gene_SYNC; |
@@ -1,104 +1,107 | |||||
1 | ------------------------------------------------------------------------------ |
|
1 | ------------------------------------------------------------------------------ | |
2 | -- This file is a part of the LPP VHDL IP LIBRARY |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS |
|
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 3 of the License, or |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------ |
|
18 | ------------------------------------------------------------------------------ | |
19 | -- Serialize.vhd |
|
19 | -- Author : Martin Morlot | |
20 | library IEEE; |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |
21 | use IEEE.numeric_std.all; |
|
21 | ------------------------------------------------------------------------------ | |
22 | use IEEE.std_logic_1164.all; |
|
22 | library IEEE; | |
23 |
|
23 | use IEEE.numeric_std.all; | ||
24 | entity Serialize is |
|
24 | use IEEE.std_logic_1164.all; | |
25 |
|
25 | |||
26 | port( |
|
26 | --! Programme qui permet de s�rialiser un vecteur | |
27 | clk,raz : in std_logic; |
|
27 | ||
28 | sclk : in std_logic; |
|
28 | entity Serialize is | |
29 | vectin : in std_logic_vector(15 downto 0); |
|
29 | port( | |
30 | send : in std_logic; |
|
30 | clk,raz : in std_logic; --! Horloge et Reset du composant | |
31 | sended : out std_logic; |
|
31 | sclk : in std_logic; --! Horloge Systeme | |
32 | Data : out std_logic); |
|
32 | vectin : in std_logic_vector(15 downto 0); --! Vecteur d'entr�e | |
33 |
|
33 | send : in std_logic; --! Flag, Une nouvelle donn�e est pr�sente | ||
34 | end Serialize; |
|
34 | sended : out std_logic; --! Flag, La donn�e a �t� s�rialis�e | |
35 |
|
35 | Data : out std_logic --! Donn�e num�rique s�rialis� | ||
36 |
|
36 | ); | ||
37 | architecture ar_Serialize of Serialize is |
|
37 | end Serialize; | |
38 |
|
38 | |||
39 | type etat is (attente,serialize); |
|
39 | ||
40 | signal ect : etat; |
|
40 | architecture ar_Serialize of Serialize is | |
41 |
|
41 | |||
|
42 | type etat is (attente,serialize); | |||
|
43 | signal ect : etat; | |||
|
44 | ||||
42 | signal vector_int : std_logic_vector(16 downto 0); |
|
45 | signal vector_int : std_logic_vector(16 downto 0); | |
43 | signal vectin_reg : std_logic_vector(15 downto 0); |
|
46 | signal vectin_reg : std_logic_vector(15 downto 0); | |
44 | signal load : std_logic; |
|
47 | signal load : std_logic; | |
45 | signal N : integer range 0 to 16; |
|
48 | signal N : integer range 0 to 16; | |
46 | signal CPT_ended : std_logic:='0'; |
|
49 | signal CPT_ended : std_logic:='0'; | |
47 |
|
50 | |||
48 | begin |
|
51 | begin | |
49 | process(clk,raz) |
|
52 | process(clk,raz) | |
50 | begin |
|
53 | begin | |
51 | if(raz='0')then |
|
54 | if(raz='0')then | |
52 | ect <= attente; |
|
55 | ect <= attente; | |
53 | vectin_reg <= (others=> '0'); |
|
56 | vectin_reg <= (others=> '0'); | |
54 | load <= '0'; |
|
57 | load <= '0'; | |
55 | sended <= '1'; |
|
58 | sended <= '1'; | |
56 |
|
59 | |||
57 | elsif(clk'event and clk='1')then |
|
60 | elsif(clk'event and clk='1')then | |
58 | vectin_reg <= vectin; |
|
61 | vectin_reg <= vectin; | |
59 |
|
62 | |||
60 | case ect is |
|
63 | case ect is | |
61 | when attente => |
|
64 | when attente => | |
62 | if (send='1') then |
|
65 | if (send='1') then | |
63 | sended <= '0'; |
|
66 | sended <= '0'; | |
64 | load <= '1'; |
|
67 | load <= '1'; | |
65 | ect <= serialize; |
|
68 | ect <= serialize; | |
66 | else |
|
69 | else | |
67 | ect <= attente; |
|
70 | ect <= attente; | |
68 | end if; |
|
71 | end if; | |
69 |
|
72 | |||
70 | when serialize => |
|
73 | when serialize => | |
71 | load <= '0'; |
|
74 | load <= '0'; | |
72 | if(CPT_ended='1')then |
|
75 | if(CPT_ended='1')then | |
73 | ect <= attente; |
|
76 | ect <= attente; | |
74 | sended <= '1'; |
|
77 | sended <= '1'; | |
75 | end if; |
|
78 | end if; | |
76 |
|
79 | |||
77 | end case; |
|
80 | end case; | |
78 | end if; |
|
81 | end if; | |
79 | end process; |
|
82 | end process; | |
80 |
|
83 | |||
81 | process(sclk,load,raz) |
|
84 | process(sclk,load,raz) | |
82 | begin |
|
85 | begin | |
83 | if (raz='0')then |
|
86 | if (raz='0')then | |
84 | vector_int <= (others=> '0'); |
|
87 | vector_int <= (others=> '0'); | |
85 | N <= 16; |
|
88 | N <= 16; | |
86 | elsif(load='1')then |
|
89 | elsif(load='1')then | |
87 | vector_int <= vectin & '0'; |
|
90 | vector_int <= vectin & '0'; | |
88 | N <= 0; |
|
91 | N <= 0; | |
89 | elsif(sclk'event and sclk='1')then |
|
92 | elsif(sclk'event and sclk='1')then | |
90 | if (CPT_ended='0') then |
|
93 | if (CPT_ended='0') then | |
91 | vector_int <= vector_int(15 downto 0) & '0'; |
|
94 | vector_int <= vector_int(15 downto 0) & '0'; | |
92 | N <= N+1; |
|
95 | N <= N+1; | |
93 | end if; |
|
96 | end if; | |
94 | end if; |
|
97 | end if; | |
95 | end process; |
|
98 | end process; | |
96 |
|
99 | |||
97 | CPT_ended <= '1' when N = 16 else '0'; |
|
100 | CPT_ended <= '1' when N = 16 else '0'; | |
98 |
|
101 | |||
99 | with ect select |
|
102 | with ect select | |
100 | Data <= vector_int(16) when serialize, |
|
103 | Data <= vector_int(16) when serialize, | |
101 | '0' when others; |
|
104 | '0' when others; | |
102 |
|
105 | |||
103 | end ar_Serialize; |
|
106 | end ar_Serialize; | |
104 |
|
107 |
@@ -1,22 +1,24 | |||||
1 | ------------------------------------------------------------------------------ |
|
1 | ------------------------------------------------------------------------------ | |
2 | -- This file is a part of the LPP VHDL IP LIBRARY |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS |
|
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 3 of the License, or |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------ |
|
18 | ------------------------------------------------------------------------------ | |
19 | -- Systeme_Clock.vhd |
|
19 | -- Author : Martin Morlot | |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | ------------------------------------------------------------------------------ | |||
20 | library IEEE; |
|
22 | library IEEE; | |
21 | use IEEE.std_logic_1164.all; |
|
23 | use IEEE.std_logic_1164.all; | |
22 | use IEEE.numeric_std.all; |
|
24 | use IEEE.numeric_std.all; | |
@@ -24,14 +26,15 use IEEE.numeric_std.all; | |||||
24 | --! Programme qui va permetre de g�n�rer l'horloge systeme (sclk) |
|
26 | --! Programme qui va permetre de g�n�rer l'horloge systeme (sclk) | |
25 |
|
27 | |||
26 | entity Systeme_Clock is |
|
28 | entity Systeme_Clock is | |
27 | generic(N :integer := 695); --! G�n�rique contenant le r�sultat de la division clk/sclk |
|
29 | generic(N :integer := 695); --! G�n�rique contenant le r�sultat de la division clk/sclk | |
28 |
port( |
|
30 | port( | |
29 | clk, raz : in std_logic; --! Horloge et Reset globale |
|
31 | clk, raz : in std_logic; --! Horloge et Reset globale du composant | |
30 | sclk : out std_logic --! Horloge Systeme g�n�r�e |
|
32 | sclk : out std_logic --! Horloge Systeme g�n�r�e | |
31 | ); |
|
33 | ); | |
32 | end Systeme_Clock; |
|
34 | end Systeme_Clock; | |
33 |
|
35 | |||
34 | --! @details Fonctionne a base d'un compteur (countint) qui va permetre de diviser l'horloge N fois |
|
36 | --! @details Fonctionne a base d'un compteur (countint) qui va permetre de diviser l'horloge N fois | |
|
37 | ||||
35 | architecture ar_Systeme_Clock of Systeme_Clock is |
|
38 | architecture ar_Systeme_Clock of Systeme_Clock is | |
36 |
|
39 | |||
37 | signal clockint : std_logic; |
|
40 | signal clockint : std_logic; |
@@ -15,17 +15,19 | |||||
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------ |
|
18 | ------------------------------------------------------------------------------ | |
|
19 | -- Author : Martin Morlot | |||
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | ------------------------------------------------------------------------------ | |||
19 | library ieee; |
|
22 | library ieee; | |
20 | use ieee.std_logic_1164.all; |
|
23 | use ieee.std_logic_1164.all; | |
21 | library grlib; |
|
24 | library grlib; | |
22 | use grlib.amba.all; |
|
25 | use grlib.amba.all; | |
23 | -- pragma translate_off |
|
|||
24 | use std.textio.all; |
|
26 | use std.textio.all; | |
25 | -- pragma translate_on |
|
|||
26 | library lpp; |
|
27 | library lpp; | |
27 | use lpp.lpp_amba.all; |
|
28 | use lpp.lpp_amba.all; | |
28 |
|
29 | |||
|
30 | --! Package contenant tous les programmes qui forment le composant int�gr� dans le l�on | |||
29 |
|
31 | |||
30 | package lpp_cna is |
|
32 | package lpp_cna is | |
31 |
|
33 |
@@ -15,7 +15,10 | |||||
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 |
------------------------------------------------------------------------------ |
|
18 | ------------------------------------------------------------------------------ | |
|
19 | -- Author : Martin Morlot | |||
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | ------------------------------------------------------------------------------ | |||
19 | library ieee; |
|
22 | library ieee; | |
20 | use ieee.std_logic_1164.all; |
|
23 | use ieee.std_logic_1164.all; | |
21 | library grlib; |
|
24 | library grlib; | |
@@ -27,6 +30,8 use lpp.lpp_amba.all; | |||||
27 | use lpp.apb_devices_list.all; |
|
30 | use lpp.apb_devices_list.all; | |
28 | use lpp.lpp_uart.all; |
|
31 | use lpp.lpp_uart.all; | |
29 |
|
32 | |||
|
33 | --! Driver APB, va faire le lien entre l'IP VHDL de l'UART et le bus Amba | |||
|
34 | ||||
30 | entity APB_UART is |
|
35 | entity APB_UART is | |
31 | generic ( |
|
36 | generic ( | |
32 | pindex : integer := 0; |
|
37 | pindex : integer := 0; | |
@@ -36,12 +41,12 entity APB_UART is | |||||
36 | abits : integer := 8; |
|
41 | abits : integer := 8; | |
37 | Data_sz : integer := 8); |
|
42 | Data_sz : integer := 8); | |
38 | port ( |
|
43 | port ( | |
39 | clk : in std_logic; |
|
44 | clk : in std_logic; --! Horloge du composant | |
40 | rst : in std_logic; |
|
45 | rst : in std_logic; --! Reset general du composant | |
41 | apbi : in apb_slv_in_type; |
|
46 | apbi : in apb_slv_in_type; --! Registre de gestion des entr�es du bus | |
42 | apbo : out apb_slv_out_type; |
|
47 | apbo : out apb_slv_out_type; --! Registre de gestion des sorties du bus | |
43 | TXD : out std_logic; |
|
48 | TXD : out std_logic; --! Transmission s�rie, c�t� composant | |
44 | RXD : in std_logic |
|
49 | RXD : in std_logic --! Reception s�rie, c�t� composant | |
45 | ); |
|
50 | ); | |
46 | end APB_UART; |
|
51 | end APB_UART; | |
47 |
|
52 | |||
@@ -61,7 +66,7 signal Send : std_logic; | |||||
61 | signal Sended : std_logic; |
|
66 | signal Sended : std_logic; | |
62 |
|
67 | |||
63 | type UART_ctrlr_Reg is record |
|
68 | type UART_ctrlr_Reg is record | |
64 |
UART_Cfg : std_logic_vector( |
|
69 | UART_Cfg : std_logic_vector(2 downto 0); | |
65 | UART_Wdata : std_logic_vector(7 downto 0); |
|
70 | UART_Wdata : std_logic_vector(7 downto 0); | |
66 | UART_Rdata : std_logic_vector(7 downto 0); |
|
71 | UART_Rdata : std_logic_vector(7 downto 0); | |
67 | UART_BTrig : std_logic_vector(11 downto 0); |
|
72 | UART_BTrig : std_logic_vector(11 downto 0); | |
@@ -69,14 +74,15 end record; | |||||
69 |
|
74 | |||
70 | signal Rec : UART_ctrlr_Reg; |
|
75 | signal Rec : UART_ctrlr_Reg; | |
71 | signal Rdata : std_logic_vector(31 downto 0); |
|
76 | signal Rdata : std_logic_vector(31 downto 0); | |
|
77 | signal temp_ND : std_logic; | |||
72 |
|
78 | |||
73 | begin |
|
79 | begin | |
74 |
|
80 | |||
75 | Capture <= Rec.UART_Cfg(0); |
|
81 | Capture <= Rec.UART_Cfg(0); | |
76 | --ACK <= Rec.UART_Cfg(1); |
|
82 | --ACK <= Rec.UART_Cfg(1); | |
77 |
--Send <= Rec.UART_Cfg( |
|
83 | --Send <= Rec.UART_Cfg(1); | |
78 |
Rec.UART_Cfg( |
|
84 | Rec.UART_Cfg(1) <= Sended; | |
79 |
Rec.UART_Cfg( |
|
85 | Rec.UART_Cfg(2) <= NwData; | |
80 |
|
86 | |||
81 |
|
87 | |||
82 | COM0 : entity work.UART |
|
88 | COM0 : entity work.UART | |
@@ -90,41 +96,51 Rec.UART_Cfg(4) <= NwData; | |||||
90 | Rec.UART_Wdata <= (others => '0'); |
|
96 | Rec.UART_Wdata <= (others => '0'); | |
91 |
|
97 | |||
92 |
|
98 | |||
93 |
elsif(clk'event and clk='1')then |
|
99 | elsif(clk'event and clk='1')then | |
94 |
|
100 | temp_ND <= NwData; | ||
|
101 | if(NwData='1' and temp_ND='1')then | |||
|
102 | ACK <= '1'; | |||
|
103 | else | |||
|
104 | ACK <= '0'; | |||
|
105 | end if; | |||
95 |
|
106 | |||
96 | --APB Write OP |
|
107 | --APB Write OP | |
97 | if (apbi.psel(pindex) and apbi.penable and apbi.pwrite) = '1' then |
|
108 | if (apbi.psel(pindex) and apbi.penable and apbi.pwrite) = '1' then | |
98 | case apbi.paddr(7 downto 2) is |
|
109 | case apbi.paddr(7 downto 2) is | |
99 | when "000000" => |
|
110 | when "000000" => | |
100 |
Rec.UART_Cfg( |
|
111 | Rec.UART_Cfg(0) <= apbi.pwdata(0); | |
|
112 | --Rec.UART_Cfg(1) <= apbi.pwdata(4); | |||
101 | when "000001" => |
|
113 | when "000001" => | |
102 | Rec.UART_Wdata <= apbi.pwdata(7 downto 0); |
|
114 | Rec.UART_Wdata(7 downto 0) <= apbi.pwdata(7 downto 0); | |
103 |
|
|
115 | Send <= '1'; | |
104 | when others => |
|
116 | when others => | |
105 | null; |
|
117 | null; | |
106 | end case; |
|
118 | end case; | |
107 | else |
|
119 | else | |
108 |
|
|
120 | Send <= '0'; | |
109 | end if; |
|
121 | end if; | |
110 |
|
122 | |||
111 | --APB READ OP |
|
123 | --APB READ OP | |
112 | if (apbi.psel(pindex) and (not apbi.pwrite)) = '1' then |
|
124 | if (apbi.psel(pindex) and (not apbi.pwrite)) = '1' then | |
113 | case apbi.paddr(7 downto 2) is |
|
125 | case apbi.paddr(7 downto 2) is | |
114 | when "000000" => |
|
126 | when "000000" => | |
115 |
Rdata( |
|
127 | Rdata(3 downto 0) <= "000" & Rec.UART_Cfg(0); | |
116 |
Rdata( |
|
128 | Rdata(7 downto 4) <= "000" & Rec.UART_Cfg(1); | |
117 |
Rdata( |
|
129 | Rdata(11 downto 8) <= "000" & Rec.UART_Cfg(2); | |
|
130 | Rdata(19 downto 12) <= X"EE"; | |||
|
131 | Rdata(31 downto 20) <= Rec.UART_BTrig; | |||
118 | when "000001" => |
|
132 | when "000001" => | |
|
133 | Rdata(31 downto 8) <= X"EEEEEE"; | |||
119 |
|
|
134 | Rdata(7 downto 0) <= Rec.UART_Wdata; | |
120 | when "000010" => |
|
135 | when "000010" => | |
|
136 | Rdata(31 downto 8) <= X"EEEEEE"; | |||
121 | Rdata(7 downto 0) <= Rec.UART_Rdata; |
|
137 | Rdata(7 downto 0) <= Rec.UART_Rdata; | |
122 | Ack <= '1'; |
|
138 | --Ack <= '1'; | |
123 | when others => |
|
139 | when others => | |
124 | Rdata <= (others => '0'); |
|
140 | Rdata <= (others => '0'); | |
125 | end case; |
|
141 | end case; | |
126 | else |
|
142 | --else | |
127 | Ack <= '0'; |
|
143 | --Ack <= '0'; | |
128 | end if; |
|
144 | end if; | |
129 |
|
145 | |||
130 | end if; |
|
146 | end if; |
@@ -46,6 +46,7 architecture ar_Shift_REG of Shift_REG i | |||||
46 | signal REG : std_logic_vector(Data_sz-1 downto 0); |
|
46 | signal REG : std_logic_vector(Data_sz-1 downto 0); | |
47 | signal Serialized_int : std_logic; |
|
47 | signal Serialized_int : std_logic; | |
48 | signal Serialize_reg : std_logic; |
|
48 | signal Serialize_reg : std_logic; | |
|
49 | signal Serial_reg : std_logic; | |||
49 | signal CptBits : std_logic_vector(Data_sz-1 downto 0); |
|
50 | signal CptBits : std_logic_vector(Data_sz-1 downto 0); | |
50 | constant CptBits_trig : std_logic_vector(Data_sz-1 downto 0) := (others => '1'); |
|
51 | constant CptBits_trig : std_logic_vector(Data_sz-1 downto 0) := (others => '1'); | |
51 | signal CptBits_flag : std_logic; |
|
52 | signal CptBits_flag : std_logic; | |
@@ -61,14 +62,16 begin | |||||
61 | if reset = '0' then |
|
62 | if reset = '0' then | |
62 | Serialized_int <= '1'; |
|
63 | Serialized_int <= '1'; | |
63 | CptBits_flag_reg <= '0'; |
|
64 | CptBits_flag_reg <= '0'; | |
|
65 | Serial_reg <= '0'; | |||
64 | Q <= (others => '0'); |
|
66 | Q <= (others => '0'); | |
65 | elsif clk'event and clk = '1' then |
|
67 | elsif clk'event and clk = '1' then | |
66 | CptBits_flag_reg <= CptBits_flag; |
|
68 | CptBits_flag_reg <= CptBits_flag; | |
|
69 | Serial_reg <= Serialize; | |||
67 |
|
70 | |||
68 | if CptBits_flag = '1' and CptBits_flag_reg = '0' then |
|
71 | if CptBits_flag = '1' and CptBits_flag_reg = '0' then | |
69 | Serialized_int <= '1'; |
|
72 | Serialized_int <= '1'; | |
70 | Q <= REG; |
|
73 | Q <= REG; | |
71 |
elsif Serialize |
|
74 | elsif(Serial_reg='0' and Serialize='1')then | |
72 | Serialized_int <= '0'; |
|
75 | Serialized_int <= '0'; | |
73 | end if; |
|
76 | end if; | |
74 | end if; |
|
77 | end if; |
@@ -45,9 +45,9 port( | |||||
45 | ); |
|
45 | ); | |
46 | end entity; |
|
46 | end entity; | |
47 |
|
47 | |||
48 |
|
||||
49 | --! @details Gestion de la Reception/Transmission donc de la Vectorisation/Serialisation |
|
48 | --! @details Gestion de la Reception/Transmission donc de la Vectorisation/Serialisation | |
50 |
--! ainsi que la detection et le reglage de le frequence de transmission optimale sur le bus (Generateur de Bauds) |
|
49 | --! ainsi que la detection et le reglage de le frequence de transmission optimale sur le bus (Generateur de Bauds) | |
|
50 | ||||
51 | architecture ar_UART of UART is |
|
51 | architecture ar_UART of UART is | |
52 | signal Bclk : std_logic; |
|
52 | signal Bclk : std_logic; | |
53 |
|
53 |
General Comments 0
You need to be logged in to leave comments.
Login now