@@ -0,0 +1,67 | |||||
|
1 | ------------------------------------------------------------------------------ | |||
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |||
|
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |||
|
4 | -- | |||
|
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 | |||
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |||
|
8 | -- (at your option) any later version. | |||
|
9 | -- | |||
|
10 | -- This program is distributed in the hope that it will be useful, | |||
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
|
13 | -- GNU General Public License for more details. | |||
|
14 | -- | |||
|
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 | |||
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
|
18 | ------------------------------------------------------------------------------ | |||
|
19 | -- Author : Martin Morlot | |||
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |||
|
21 | ------------------------------------------------------------------------------ | |||
|
22 | library IEEE; | |||
|
23 | use IEEE.numeric_std.all; | |||
|
24 | use IEEE.std_logic_1164.all; | |||
|
25 | ||||
|
26 | entity ReadFifo_GEN is | |||
|
27 | port( | |||
|
28 | clk,raz : in std_logic; --! Horloge et Reset du composant | |||
|
29 | SYNC : in std_logic; | |||
|
30 | Readn : out std_logic | |||
|
31 | ); | |||
|
32 | end entity; | |||
|
33 | ||||
|
34 | ||||
|
35 | architecture ar_ReadFifo_GEN of ReadFifo_GEN is | |||
|
36 | ||||
|
37 | type etat is (eX,e0); | |||
|
38 | signal ect : etat; | |||
|
39 | ||||
|
40 | signal SYNC_reg : std_logic; | |||
|
41 | ||||
|
42 | begin | |||
|
43 | process(clk,raz) | |||
|
44 | begin | |||
|
45 | if(raz='0')then | |||
|
46 | ect <= eX; | |||
|
47 | Readn <= '1'; | |||
|
48 | ||||
|
49 | elsif(clk'event and clk='1')then | |||
|
50 | SYNC_reg <= SYNC; | |||
|
51 | ||||
|
52 | case ect is | |||
|
53 | when eX => | |||
|
54 | if (SYNC_reg='0' and SYNC='1') then | |||
|
55 | Readn <= '0'; | |||
|
56 | ect <= e0; | |||
|
57 | end if; | |||
|
58 | ||||
|
59 | when e0 => | |||
|
60 | Readn <= '1'; | |||
|
61 | ect <= eX; | |||
|
62 | ||||
|
63 | end case; | |||
|
64 | end if; | |||
|
65 | end process; | |||
|
66 | ||||
|
67 | end architecture; No newline at end of file |
@@ -0,0 +1,53 | |||||
|
1 | -- Bridge.vhd | |||
|
2 | library IEEE; | |||
|
3 | use IEEE.std_logic_1164.all; | |||
|
4 | use IEEE.numeric_std.all; | |||
|
5 | ||||
|
6 | entity Bridge is | |||
|
7 | port( | |||
|
8 | clk : in std_logic; | |||
|
9 | raz : in std_logic; | |||
|
10 | EmptyUp : in std_logic; | |||
|
11 | FullDwn : in std_logic; | |||
|
12 | WriteDwn : out std_logic; | |||
|
13 | ReadUp : out std_logic | |||
|
14 | ); | |||
|
15 | end entity; | |||
|
16 | ||||
|
17 | ||||
|
18 | architecture ar_Bridge of Bridge is | |||
|
19 | ||||
|
20 | type etat is (e0,e1); | |||
|
21 | signal ect : etat; | |||
|
22 | ||||
|
23 | begin | |||
|
24 | ||||
|
25 | process(clk,raz) | |||
|
26 | begin | |||
|
27 | if(raz='0')then | |||
|
28 | WriteDwn <= '1'; | |||
|
29 | ReadUp <= '1'; | |||
|
30 | ect <= e0; | |||
|
31 | ||||
|
32 | elsif(clk'event and clk='1')then | |||
|
33 | ||||
|
34 | case ect is | |||
|
35 | ||||
|
36 | when e0 => | |||
|
37 | WriteDwn <= '1'; | |||
|
38 | if(EmptyUp='0' and FullDwn='0')then | |||
|
39 | ReadUp <= '0'; | |||
|
40 | ect <= e1; | |||
|
41 | end if; | |||
|
42 | ||||
|
43 | when e1 => | |||
|
44 | ReadUp <= '1'; | |||
|
45 | WriteDwn <= '0'; | |||
|
46 | ect <= e0; | |||
|
47 | ||||
|
48 | end case; | |||
|
49 | ||||
|
50 | end if; | |||
|
51 | end process; | |||
|
52 | ||||
|
53 | end architecture; No newline at end of file |
@@ -1,53 +1,53 | |||||
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 | -- Author : Martin Morlot |
|
19 | -- Author : Martin Morlot | |
20 | -- Mail : martin.morlot@lpp.polytechnique.fr |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |
21 | -----------------------------------------------------------------------------*/ |
|
21 | -----------------------------------------------------------------------------*/ | |
22 | #include "lpp_apb_functions.h" |
|
22 | #include "lpp_apb_functions.h" | |
23 | #include "apb_fifo_Driver.h" |
|
23 | #include "apb_fifo_Driver.h" | |
24 | #include <stdio.h> |
|
24 | #include <stdio.h> | |
25 |
|
25 | |||
26 |
|
26 | |||
27 | FIFO_Device* openFIFO(int count) |
|
27 | FIFO_Device* openFIFO(int count) | |
28 | { |
|
28 | { | |
29 | FIFO_Device* fifo0; |
|
29 | FIFO_Device* fifo0; | |
30 | fifo0 = (FIFO_Device*) apbgetdevice(LPP_FIFO_PID,VENDOR_LPP,count); |
|
30 | fifo0 = (FIFO_Device*) apbgetdevice(LPP_FIFO_PID,VENDOR_LPP,count); | |
31 | return fifo0; |
|
31 | return fifo0; | |
32 | } |
|
32 | } | |
33 |
|
33 | |||
34 |
|
34 | |||
35 | int FillFifo(FIFO_Device* dev,int ID,int Tbl[],int count) |
|
35 | int FillFifo(FIFO_Device* dev,int ID,int Tbl[],int count) | |
36 | { |
|
36 | { | |
37 | int i=0; |
|
37 | int i=0; | |
38 | //int poub; |
|
38 | //int poub; | |
39 | //printf("%x\n",dev->FIFOreg[(2*0)+FIFO_Ctrl]); |
|
39 | //printf("%x\n",dev->FIFOreg[(2*0)+FIFO_Ctrl]); | |
40 | while(i<count) |
|
40 | while(i<=count) | |
41 | //while((dev->FIFOreg[(2*ID)+FIFO_Ctrl] & FIFO_Full) != FIFO_Full)// TANT QUE full a 0 ALORS |
|
41 | //while((dev->FIFOreg[(2*ID)+FIFO_Ctrl] & FIFO_Full) != FIFO_Full)// TANT QUE full a 0 ALORS | |
42 | { |
|
42 | { | |
43 | //printf("%x\n",dev->FIFOreg[(2*ID)+FIFO_Ctrl]); |
|
43 | //printf("%x\n",dev->FIFOreg[(2*ID)+FIFO_Ctrl]); | |
44 | //printf("%d\n",i); |
|
44 | //printf("%d\n",i); | |
45 | dev->FIFOreg[(2*ID)+FIFO_RWdata] = Tbl[i]; |
|
45 | dev->FIFOreg[(2*ID)+FIFO_RWdata] = Tbl[i]; | |
46 | i++; |
|
46 | i++; | |
47 | } |
|
47 | } | |
48 | //poub = dev->FIFOreg[(2*ID)+FIFO_RWdata]; |
|
48 | //poub = dev->FIFOreg[(2*ID)+FIFO_RWdata]; | |
49 | //dev->FIFOreg[(2*ID)+FIFO_RWdata] = Tbl[0]; |
|
49 | //dev->FIFOreg[(2*ID)+FIFO_RWdata] = Tbl[0]; | |
50 | //printf("END:%x\n",dev->FIFOreg[(2*ID)+FIFO_Ctrl]); |
|
50 | //printf("END:%x\n",dev->FIFOreg[(2*ID)+FIFO_Ctrl]); | |
51 | //while((dev->FIFOreg[(2*ID)+FIFO_Ctrl] & FIFO_Full) != FIFO_Full); // TANT QUE full a 0 RIEN |
|
51 | //while((dev->FIFOreg[(2*ID)+FIFO_Ctrl] & FIFO_Full) != FIFO_Full); // TANT QUE full a 0 RIEN | |
52 | return 0; |
|
52 | return 0; | |
53 | } |
|
53 | } |
@@ -1,125 +1,130 | |||||
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 | -- Author : Martin Morlot |
|
19 | -- Author : Martin Morlot | |
20 | -- Mail : martin.morlot@lpp.polytechnique.fr |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |
21 | ------------------------------------------------------------------------------ |
|
21 | ------------------------------------------------------------------------------ | |
22 | library ieee; |
|
22 | library ieee; | |
23 | use ieee.std_logic_1164.all; |
|
23 | use ieee.std_logic_1164.all; | |
24 | library grlib; |
|
24 | library grlib; | |
25 | use grlib.amba.all; |
|
25 | use grlib.amba.all; | |
26 | use grlib.stdlib.all; |
|
26 | use grlib.stdlib.all; | |
27 | use grlib.devices.all; |
|
27 | use grlib.devices.all; | |
28 | library lpp; |
|
28 | library lpp; | |
29 | use lpp.lpp_amba.all; |
|
29 | use lpp.lpp_amba.all; | |
30 | use lpp.apb_devices_list.all; |
|
30 | use lpp.apb_devices_list.all; | |
31 | use lpp.lpp_cna.all; |
|
31 | use lpp.lpp_cna.all; | |
32 |
|
32 | |||
33 | --! Driver APB, va faire le lien entre l'IP VHDL du convertisseur et le bus Amba |
|
33 | --! Driver APB, va faire le lien entre l'IP VHDL du convertisseur et le bus Amba | |
34 |
|
34 | |||
35 | entity APB_DAC is |
|
35 | entity APB_DAC is | |
36 | generic ( |
|
36 | generic ( | |
37 | pindex : integer := 0; |
|
37 | pindex : integer := 0; | |
38 | paddr : integer := 0; |
|
38 | paddr : integer := 0; | |
39 | pmask : integer := 16#fff#; |
|
39 | pmask : integer := 16#fff#; | |
40 | pirq : integer := 0; |
|
40 | pirq : integer := 0; | |
41 |
abits : integer := 8 |
|
41 | abits : integer := 8; | |
|
42 | cpt_serial : integer := 6); | |||
42 | port ( |
|
43 | port ( | |
43 | clk : in std_logic; --! Horloge du composant |
|
44 | clk : in std_logic; --! Horloge du composant | |
44 | rst : in std_logic; --! Reset general du composant |
|
45 | rst : in std_logic; --! Reset general du composant | |
45 | apbi : in apb_slv_in_type; --! Registre de gestion des entr�es du bus |
|
46 | apbi : in apb_slv_in_type; --! Registre de gestion des entr�es du bus | |
46 | apbo : out apb_slv_out_type; --! Registre de gestion des sorties du bus |
|
47 | apbo : out apb_slv_out_type; --! Registre de gestion des sorties du bus | |
|
48 | DataIN : in std_logic_vector(15 downto 0); | |||
47 | Cal_EN : out std_logic; --! Signal Enable du multiplex pour la CAL |
|
49 | Cal_EN : out std_logic; --! Signal Enable du multiplex pour la CAL | |
|
50 | Readn : out std_logic; | |||
48 | SYNC : out std_logic; --! Signal de synchronisation du convertisseur |
|
51 | SYNC : out std_logic; --! Signal de synchronisation du convertisseur | |
49 | SCLK : out std_logic; --! Horloge systeme du convertisseur |
|
52 | SCLK : out std_logic; --! Horloge systeme du convertisseur | |
50 | DATA : out std_logic --! Donn�e num�rique s�rialis� |
|
53 | DATA : out std_logic --! Donn�e num�rique s�rialis� | |
51 | ); |
|
54 | ); | |
52 | end entity; |
|
55 | end entity; | |
53 |
|
56 | |||
54 | --! @details Les deux registres (apbi,apbo) permettent de g�rer la communication sur le bus |
|
57 | --! @details Les deux registres (apbi,apbo) permettent de g�rer la communication sur le bus | |
55 | --! et les sorties seront cabl�es vers le convertisseur. |
|
58 | --! et les sorties seront cabl�es vers le convertisseur. | |
56 |
|
59 | |||
57 | architecture ar_APB_DAC of APB_DAC is |
|
60 | architecture ar_APB_DAC of APB_DAC is | |
58 |
|
61 | |||
59 | constant REVISION : integer := 1; |
|
62 | constant REVISION : integer := 1; | |
60 |
|
63 | |||
61 | constant pconfig : apb_config_type := ( |
|
64 | constant pconfig : apb_config_type := ( | |
62 | 0 => ahb_device_reg (VENDOR_LPP, LPP_CNA, 0, REVISION, 0), |
|
65 | 0 => ahb_device_reg (VENDOR_LPP, LPP_CNA, 0, REVISION, 0), | |
63 | 1 => apb_iobar(paddr, pmask)); |
|
66 | 1 => apb_iobar(paddr, pmask)); | |
64 |
|
67 | |||
65 | signal enable : std_logic; |
|
68 | signal enable : std_logic; | |
66 |
signal |
|
69 | signal Ready : std_logic; | |
67 |
|
70 | |||
68 | type DAC_ctrlr_Reg is record |
|
71 | type DAC_ctrlr_Reg is record | |
69 | DAC_Cfg : std_logic_vector(1 downto 0); |
|
72 | DAC_Cfg : std_logic_vector(1 downto 0); | |
70 | DAC_Data : std_logic_vector(15 downto 0); |
|
73 | -- DAC_Data : std_logic_vector(15 downto 0); | |
71 | end record; |
|
74 | end record; | |
72 |
|
75 | |||
73 | signal Rec : DAC_ctrlr_Reg; |
|
76 | signal Rec : DAC_ctrlr_Reg; | |
74 | signal Rdata : std_logic_vector(31 downto 0); |
|
77 | signal Rdata : std_logic_vector(31 downto 0); | |
75 |
|
78 | |||
76 | begin |
|
79 | begin | |
77 |
|
80 | |||
78 | enable <= Rec.DAC_Cfg(0); |
|
81 | enable <= Rec.DAC_Cfg(0); | |
79 |
Rec.DAC_Cfg(1) <= |
|
82 | Rec.DAC_Cfg(1) <= Ready; | |
80 |
|
83 | |||
81 | CONV0 : DacDriver |
|
84 | CONV0 : DacDriver | |
82 | port map(clk,rst,enable,Rec.CNA_Data,SYNC,SCLK,flag_sd,Data); |
|
85 | generic map (cpt_serial) | |
|
86 | port map(clk,rst,enable,DataIN,SYNC,SCLK,Readn,Ready,Data); | |||
|
87 | -- port map(clk,rst,enable,Rec.DAC_Data,SYNC,SCLK,Ready,Data); | |||
83 |
|
88 | |||
84 |
|
89 | |||
85 | process(rst,clk) |
|
90 | process(rst,clk) | |
86 | begin |
|
91 | begin | |
87 | if(rst='0')then |
|
92 | if(rst='0')then | |
88 | Rec.DAC_Data <= (others => '0'); |
|
93 | -- Rec.DAC_Data <= (others => '0'); | |
89 |
|
94 | |||
90 | elsif(clk'event and clk='1')then |
|
95 | elsif(clk'event and clk='1')then | |
91 |
|
96 | |||
92 |
|
97 | |||
93 | --APB Write OP |
|
98 | --APB Write OP | |
94 | if (apbi.psel(pindex) and apbi.penable and apbi.pwrite) = '1' then |
|
99 | if (apbi.psel(pindex) and apbi.penable and apbi.pwrite) = '1' then | |
95 | case apbi.paddr(abits-1 downto 2) is |
|
100 | case apbi.paddr(abits-1 downto 2) is | |
96 | when "000000" => |
|
101 | when "000000" => | |
97 | Rec.DAC_Cfg(0) <= apbi.pwdata(0); |
|
102 | Rec.DAC_Cfg(0) <= apbi.pwdata(0); | |
98 | when "000001" => |
|
103 | -- when "000001" => | |
99 | Rec.DAC_Data <= apbi.pwdata(15 downto 0); |
|
104 | -- Rec.DAC_Data <= apbi.pwdata(15 downto 0); | |
100 | when others => |
|
105 | when others => | |
101 | null; |
|
106 | null; | |
102 | end case; |
|
107 | end case; | |
103 | end if; |
|
108 | end if; | |
104 |
|
109 | |||
105 | --APB Read OP |
|
110 | --APB Read OP | |
106 | if (apbi.psel(pindex) and (not apbi.pwrite)) = '1' then |
|
111 | if (apbi.psel(pindex) and (not apbi.pwrite)) = '1' then | |
107 | case apbi.paddr(abits-1 downto 2) is |
|
112 | case apbi.paddr(abits-1 downto 2) is | |
108 | when "000000" => |
|
113 | when "000000" => | |
109 | Rdata(31 downto 2) <= X"ABCDEF5" & "00"; |
|
114 | Rdata(31 downto 2) <= X"ABCDEF5" & "00"; | |
110 | Rdata(1 downto 0) <= Rec.DAC_Cfg; |
|
115 | Rdata(1 downto 0) <= Rec.DAC_Cfg; | |
111 | when "000001" => |
|
116 | -- when "000001" => | |
112 | Rdata(31 downto 16) <= X"FD18"; |
|
117 | -- Rdata(31 downto 16) <= X"FD18"; | |
113 | Rdata(15 downto 0) <= Rec.DAC_Data; |
|
118 | -- Rdata(15 downto 0) <= Rec.DAC_Data; | |
114 | when others => |
|
119 | when others => | |
115 | Rdata <= (others => '0'); |
|
120 | Rdata <= (others => '0'); | |
116 | end case; |
|
121 | end case; | |
117 | end if; |
|
122 | end if; | |
118 |
|
123 | |||
119 | end if; |
|
124 | end if; | |
120 | apbo.pconfig <= pconfig; |
|
125 | apbo.pconfig <= pconfig; | |
121 | end process; |
|
126 | end process; | |
122 |
|
127 | |||
123 | apbo.prdata <= Rdata when apbi.penable = '1'; |
|
128 | apbo.prdata <= Rdata when apbi.penable = '1'; | |
124 | Cal_EN <= enable; |
|
129 | Cal_EN <= enable; | |
125 |
end architecture; |
|
130 | end architecture; No newline at end of file |
@@ -1,68 +1,71 | |||||
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 | -- Author : Martin Morlot |
|
19 | -- Author : Martin Morlot | |
20 | -- Mail : martin.morlot@lpp.polytechnique.fr |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |
21 | ------------------------------------------------------------------------------ |
|
21 | ------------------------------------------------------------------------------ | |
22 | library IEEE; |
|
22 | library IEEE; | |
23 | use IEEE.std_logic_1164.all; |
|
23 | use IEEE.std_logic_1164.all; | |
24 | use IEEE.numeric_std.all; |
|
24 | use IEEE.numeric_std.all; | |
25 | use work.Convertisseur_config.all; |
|
|||
26 | use lpp.lpp_cna.all; |
|
25 | use lpp.lpp_cna.all; | |
27 |
|
26 | |||
28 | --! Programme du Convertisseur Num�rique/Analogique |
|
27 | --! Programme du Convertisseur Num�rique/Analogique | |
29 |
|
28 | |||
30 | entity DacDriver is |
|
29 | entity DacDriver is | |
|
30 | generic(cpt_serial : integer := 6); --! G�n�rique contenant le r�sultat de la division clk/sclk !!! clk=25Mhz | |||
31 | port( |
|
31 | port( | |
32 | clk : in std_logic; --! Horloge du composant |
|
32 | clk : in std_logic; --! Horloge du composant | |
33 | rst : in std_logic; --! Reset general du composant |
|
33 | rst : in std_logic; --! Reset general du composant | |
34 | enable : in std_logic; --! Autorise ou non l'utilisation du composant |
|
34 | enable : in std_logic; --! Autorise ou non l'utilisation du composant | |
35 |
Data_ |
|
35 | Data_IN : in std_logic_vector(15 downto 0); --! Donn�e Num�rique d'entr�e sur 16 bits | |
36 | SYNC : out std_logic; --! Signal de synchronisation du convertisseur |
|
36 | SYNC : out std_logic; --! Signal de synchronisation du convertisseur | |
37 | SCLK : out std_logic; --! Horloge systeme du convertisseur |
|
37 | SCLK : out std_logic; --! Horloge systeme du convertisseur | |
38 | flag_sd : out std_logic; --! Flag, signale la fin de la s�rialisation d'une donn�e |
|
38 | Readn : out std_logic; | |
|
39 | Ready : out std_logic; --! Flag, signale la fin de la s�rialisation d'une donn�e | |||
39 | Data : out std_logic --! Donn�e num�rique s�rialis� |
|
40 | Data : out std_logic --! Donn�e num�rique s�rialis� | |
40 | ); |
|
41 | ); | |
41 | end entity; |
|
42 | end entity; | |
42 |
|
43 | |||
43 | --! @details Un driver C va permettre de g�nerer un tableau de donn�es sur 16 bits, |
|
44 | --! @details Un driver C va permettre de g�nerer un tableau de donn�es sur 16 bits, | |
44 | --! qui seront s�rialis� pour �tre ensuite dirig�es vers le convertisseur. |
|
45 | --! qui seront s�rialis� pour �tre ensuite dirig�es vers le convertisseur. | |
45 |
|
46 | |||
46 | architecture ar_DacDriver of DacDriver is |
|
47 | architecture ar_DacDriver of DacDriver is | |
47 |
|
48 | |||
48 | signal s_SCLK : std_logic; |
|
49 | signal s_SCLK : std_logic; | |
49 |
signal |
|
50 | signal Send : std_logic; | |
50 |
|
51 | |||
51 | begin |
|
52 | begin | |
52 |
|
53 | |||
53 | SystemCLK : Systeme_Clock |
|
54 | SystemCLK : Systeme_Clock | |
54 |
generic map ( |
|
55 | generic map (cpt_serial) | |
55 | port map (clk,rst,s_SCLK); |
|
56 | port map (clk,rst,s_SCLK); | |
56 |
|
57 | |||
57 |
|
58 | |||
58 | Signal_sync : Gene_SYNC |
|
59 | Signal_sync : Gene_SYNC | |
59 |
port map (s_SCLK,rst,enable, |
|
60 | port map (s_SCLK,rst,enable,Send,SYNC); | |
60 |
|
61 | |||
61 |
|
62 | |||
62 | Serial : serialize |
|
63 | Serial : serialize | |
63 |
port map (clk,rst,s_SCLK,Data_ |
|
64 | port map (clk,rst,s_SCLK,Data_IN,Send,Ready,Data); | |
64 |
|
65 | |||
|
66 | RenGEN : ReadFifo_GEN | |||
|
67 | port map (clk,rst,Send,Readn); | |||
65 |
|
68 | |||
66 | SCLK <= s_SCLK; |
|
69 | SCLK <= s_SCLK; | |
67 |
|
70 | |||
68 | end architecture; No newline at end of file |
|
71 | end architecture; |
@@ -1,69 +1,69 | |||||
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 | -- Author : Martin Morlot |
|
19 | -- Author : Martin Morlot | |
20 | -- Mail : martin.morlot@lpp.polytechnique.fr |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |
21 | ------------------------------------------------------------------------------ |
|
21 | ------------------------------------------------------------------------------ | |
22 | library IEEE; |
|
22 | library IEEE; | |
23 | use IEEE.std_logic_1164.all; |
|
23 | use IEEE.std_logic_1164.all; | |
24 | use IEEE.numeric_std.all; |
|
24 | use IEEE.numeric_std.all; | |
25 |
|
25 | |||
26 | --! Programme qui va permettre de g�n�rer le signal SYNC |
|
26 | --! Programme qui va permettre de g�n�rer le signal SYNC | |
27 |
|
27 | |||
28 | entity Gene_SYNC is |
|
28 | entity Gene_SYNC is | |
29 | port( |
|
29 | port( | |
30 | SCLK,raz : in std_logic; --! Horloge systeme et Reset du composant |
|
30 | SCLK,raz : in std_logic; --! Horloge systeme et Reset du composant | |
31 | enable : in std_logic; --! Autorise ou non l'utilisation du composant |
|
31 | enable : in std_logic; --! Autorise ou non l'utilisation du composant | |
32 |
|
|
32 | Send : out std_logic; --! Flag, Autorise l'envoi (s�rialisation) d'une nouvelle donn�e | |
33 | SYNC : out std_logic --! Signal de synchronisation du convertisseur g�n�r� |
|
33 | SYNC : out std_logic --! Signal de synchronisation du convertisseur g�n�r� | |
34 | ); |
|
34 | ); | |
35 | end Gene_SYNC; |
|
35 | end Gene_SYNC; | |
36 |
|
36 | |||
37 | --! @details NB: Ce programme est uniquement synchronis� sur l'horloge Systeme (sclk) |
|
37 | --! @details NB: Ce programme est uniquement synchronis� sur l'horloge Systeme (sclk) | |
38 |
|
38 | |||
39 | architecture ar_Gene_SYNC of Gene_SYNC is |
|
39 | architecture ar_Gene_SYNC of Gene_SYNC is | |
40 |
|
40 | |||
41 | signal count : integer; |
|
41 | signal count : integer; | |
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 | count <= 14; |
|
48 | count <= 14; | |
49 |
|
|
49 | Send <= '0'; | |
50 |
|
50 | |||
51 | elsif(SCLK' event and SCLK='1')then |
|
51 | elsif(SCLK' event and SCLK='1')then | |
52 | if(enable='1')then |
|
52 | if(enable='1')then | |
53 |
|
53 | |||
54 | if(count=15)then |
|
54 | if(count=15)then | |
55 | SYNC <= '1'; |
|
55 | SYNC <= '1'; | |
56 | count <= count+1; |
|
56 | count <= count+1; | |
57 | elsif(count=16)then |
|
57 | elsif(count=16)then | |
58 | count <= 0; |
|
58 | count <= 0; | |
59 | SYNC <= '0'; |
|
59 | SYNC <= '0'; | |
60 |
|
|
60 | Send <= '1'; | |
61 | else |
|
61 | else | |
62 | count <= count+1; |
|
62 | count <= count+1; | |
63 |
|
|
63 | Send <= '0'; | |
64 | end if; |
|
64 | end if; | |
65 |
|
65 | |||
66 | end if; |
|
66 | end if; | |
67 | end if; |
|
67 | end if; | |
68 | end process; |
|
68 | end process; | |
69 | end ar_Gene_SYNC; No newline at end of file |
|
69 | end ar_Gene_SYNC; |
@@ -1,96 +1,108 | |||||
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 | -- Author : Martin Morlot |
|
19 | -- Author : Martin Morlot | |
20 | -- Mail : martin.morlot@lpp.polytechnique.fr |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |
21 | ------------------------------------------------------------------------------ |
|
21 | ------------------------------------------------------------------------------ | |
22 | library ieee; |
|
22 | library ieee; | |
23 | use ieee.std_logic_1164.all; |
|
23 | use ieee.std_logic_1164.all; | |
24 | library grlib; |
|
24 | library grlib; | |
25 | use grlib.amba.all; |
|
25 | use grlib.amba.all; | |
26 | use std.textio.all; |
|
26 | use std.textio.all; | |
27 | library lpp; |
|
27 | library lpp; | |
28 | use lpp.lpp_amba.all; |
|
28 | use lpp.lpp_amba.all; | |
29 |
|
29 | |||
30 | --! Package contenant tous les programmes qui forment le composant int�gr� dans le l�on |
|
30 | --! Package contenant tous les programmes qui forment le composant int�gr� dans le l�on | |
31 |
|
31 | |||
32 | package lpp_cna is |
|
32 | package lpp_cna is | |
33 |
|
33 | |||
34 | component APB_DAC is |
|
34 | component APB_DAC is | |
35 | generic ( |
|
35 | generic ( | |
36 | pindex : integer := 0; |
|
36 | pindex : integer := 0; | |
37 | paddr : integer := 0; |
|
37 | paddr : integer := 0; | |
38 | pmask : integer := 16#fff#; |
|
38 | pmask : integer := 16#fff#; | |
39 | pirq : integer := 0; |
|
39 | pirq : integer := 0; | |
40 |
abits : integer := 8 |
|
40 | abits : integer := 8; | |
|
41 | cpt_serial : integer := 6); | |||
41 | port ( |
|
42 | port ( | |
42 | clk : in std_logic; |
|
43 | clk : in std_logic; | |
43 | rst : in std_logic; |
|
44 | rst : in std_logic; | |
44 | apbi : in apb_slv_in_type; |
|
45 | apbi : in apb_slv_in_type; | |
45 | apbo : out apb_slv_out_type; |
|
46 | apbo : out apb_slv_out_type; | |
46 | Cal_EN : out std_logic; |
|
47 | DataIN : in std_logic_vector(15 downto 0); | |
47 | SYNC : out std_logic; |
|
48 | Cal_EN : out std_logic; --! Signal Enable du multiplex pour la CAL | |
48 |
|
|
49 | Readn : out std_logic; | |
|
50 | SYNC : out std_logic; --! Signal de synchronisation du convertisseur | |||
|
51 | SCLK : out std_logic; --! Horloge systeme du convertisseur | |||
49 | DATA : out std_logic |
|
52 | DATA : out std_logic | |
50 | ); |
|
53 | ); | |
51 | end component; |
|
54 | end component; | |
52 |
|
55 | |||
53 |
|
56 | |||
54 | component DacDriver is |
|
57 | component DacDriver is | |
|
58 | generic(cpt_serial : integer := 6); --! G�n�rique contenant le r�sultat de la division clk/sclk !!! clk=25Mhz | |||
55 | port( |
|
59 | port( | |
56 | clk : in std_logic; |
|
60 | clk : in std_logic; | |
57 | rst : in std_logic; |
|
61 | rst : in std_logic; | |
58 | enable : in std_logic; |
|
62 | enable : in std_logic; | |
59 |
Data_ |
|
63 | Data_IN : in std_logic_vector(15 downto 0); --! Donn�e Num�rique d'entr�e sur 16 bits | |
60 | SYNC : out std_logic; |
|
64 | SYNC : out std_logic; --! Signal de synchronisation du convertisseur | |
61 | SCLK : out std_logic; |
|
65 | SCLK : out std_logic; --! Horloge systeme du convertisseur | |
62 |
|
|
66 | Readn : out std_logic; | |
|
67 | Ready : out std_logic; | |||
63 | Data : out std_logic |
|
68 | Data : out std_logic | |
64 | ); |
|
69 | ); | |
65 | end component; |
|
70 | end component; | |
66 |
|
71 | |||
67 |
|
72 | |||
68 | component Systeme_Clock is |
|
73 | component Systeme_Clock is | |
69 | generic(N :integer := 695); |
|
74 | generic(N :integer := 695); | |
70 | port( |
|
75 | port( | |
71 | clk, raz : in std_logic ; |
|
76 | clk, raz : in std_logic ; | |
72 |
cl |
|
77 | sclk : out std_logic); | |
73 | end component; |
|
78 | end component; | |
74 |
|
79 | |||
75 |
|
80 | |||
76 | component Gene_SYNC is |
|
81 | component Gene_SYNC is | |
77 | port( |
|
82 | port( | |
78 | clk,raz : in std_logic; |
|
83 | SCLK,raz : in std_logic; --! Horloge systeme et Reset du composant | |
79 | send : in std_logic; |
|
84 | enable : in std_logic; --! Autorise ou non l'utilisation du composant | |
80 | Sysclk : in std_logic; |
|
85 | Send : out std_logic; --! Flag, Autorise l'envoi (s�rialisation) d'une nouvelle donn�e | |
81 | OKAI_send : out std_logic; |
|
86 | SYNC : out std_logic); --! Signal de synchronisation du convertisseur g�n�r� | |
82 | SYNC : out std_logic); |
|
|||
83 | end component; |
|
87 | end component; | |
84 |
|
88 | |||
85 |
|
89 | |||
86 | component Serialize is |
|
90 | component Serialize is | |
87 | port( |
|
91 | port( | |
88 | clk,raz : in std_logic; |
|
92 | clk,raz : in std_logic; | |
89 | sclk : in std_logic; |
|
93 | sclk : in std_logic; | |
90 | vectin : in std_logic_vector(15 downto 0); |
|
94 | vectin : in std_logic_vector(15 downto 0); | |
91 | send : in std_logic; |
|
95 | send : in std_logic; | |
92 | sended : out std_logic; |
|
96 | sended : out std_logic; | |
93 | Data : out std_logic); |
|
97 | Data : out std_logic); | |
94 | end component; |
|
98 | end component; | |
95 |
|
99 | |||
96 | end; |
|
100 | component ReadFifo_GEN is | |
|
101 | port( | |||
|
102 | clk,raz : in std_logic; --! Horloge et Reset du composant | |||
|
103 | SYNC : in std_logic; | |||
|
104 | Readn : out std_logic | |||
|
105 | ); | |||
|
106 | end component; | |||
|
107 | ||||
|
108 | end; No newline at end of file |
@@ -1,186 +1,197 | |||||
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 | -- Author : Martin Morlot |
|
19 | -- Author : Martin Morlot | |
20 | -- Mail : martin.morlot@lpp.polytechnique.fr |
|
20 | -- Mail : martin.morlot@lpp.polytechnique.fr | |
21 | ------------------------------------------------------------------------------ |
|
21 | ------------------------------------------------------------------------------ | |
22 | library ieee; |
|
22 | library ieee; | |
23 | use ieee.std_logic_1164.all; |
|
23 | use ieee.std_logic_1164.all; | |
24 | library grlib; |
|
24 | library grlib; | |
25 | use grlib.amba.all; |
|
25 | use grlib.amba.all; | |
26 | use std.textio.all; |
|
26 | use std.textio.all; | |
27 | library lpp; |
|
27 | library lpp; | |
28 | use lpp.lpp_amba.all; |
|
28 | use lpp.lpp_amba.all; | |
29 | use lpp.iir_filter.all; |
|
29 | use lpp.iir_filter.all; | |
30 | library gaisler; |
|
30 | library gaisler; | |
31 | use gaisler.misc.all; |
|
31 | use gaisler.misc.all; | |
32 | use gaisler.memctrl.all; |
|
32 | use gaisler.memctrl.all; | |
33 | library techmap; |
|
33 | library techmap; | |
34 | use techmap.gencomp.all; |
|
34 | use techmap.gencomp.all; | |
35 |
|
35 | |||
36 | --! Package contenant tous les programmes qui forment le composant int�gr� dans le l�on |
|
36 | --! Package contenant tous les programmes qui forment le composant int�gr� dans le l�on | |
37 |
|
37 | |||
38 | package lpp_memory is |
|
38 | package lpp_memory is | |
39 |
|
39 | |||
40 | component APB_FIFO is |
|
40 | component APB_FIFO is | |
41 | generic ( |
|
41 | generic ( | |
42 | tech : integer := apa3; |
|
42 | tech : integer := apa3; | |
43 | pindex : integer := 0; |
|
43 | pindex : integer := 0; | |
44 | paddr : integer := 0; |
|
44 | paddr : integer := 0; | |
45 | pmask : integer := 16#fff#; |
|
45 | pmask : integer := 16#fff#; | |
46 | pirq : integer := 0; |
|
46 | pirq : integer := 0; | |
47 | abits : integer := 8; |
|
47 | abits : integer := 8; | |
48 | FifoCnt : integer := 2; |
|
48 | FifoCnt : integer := 2; | |
49 | Data_sz : integer := 16; |
|
49 | Data_sz : integer := 16; | |
50 | Addr_sz : integer := 9; |
|
50 | Addr_sz : integer := 9; | |
51 | Enable_ReUse : std_logic := '0'; |
|
51 | Enable_ReUse : std_logic := '0'; | |
52 | Mem_use : integer := use_RAM; |
|
52 | Mem_use : integer := use_RAM; | |
53 | R : integer := 1; |
|
53 | R : integer := 1; | |
54 | W : integer := 1 |
|
54 | W : integer := 1 | |
55 | ); |
|
55 | ); | |
56 | port ( |
|
56 | port ( | |
57 | clk : in std_logic; --! Horloge du composant |
|
57 | clk : in std_logic; --! Horloge du composant | |
58 | rst : in std_logic; --! Reset general du composant |
|
58 | rst : in std_logic; --! Reset general du composant | |
59 | rclk : in std_logic; |
|
59 | rclk : in std_logic; | |
60 | wclk : in std_logic; |
|
60 | wclk : in std_logic; | |
61 | ReUse : in std_logic_vector(FifoCnt-1 downto 0); |
|
61 | ReUse : in std_logic_vector(FifoCnt-1 downto 0); | |
62 | REN : in std_logic_vector(FifoCnt-1 downto 0); --! Instruction de lecture en m�moire |
|
62 | REN : in std_logic_vector(FifoCnt-1 downto 0); --! Instruction de lecture en m�moire | |
63 | WEN : in std_logic_vector(FifoCnt-1 downto 0); --! Instruction d'�criture en m�moire |
|
63 | WEN : in std_logic_vector(FifoCnt-1 downto 0); --! Instruction d'�criture en m�moire | |
64 | Empty : out std_logic_vector(FifoCnt-1 downto 0); --! Flag, M�moire vide |
|
64 | Empty : out std_logic_vector(FifoCnt-1 downto 0); --! Flag, M�moire vide | |
65 | Full : out std_logic_vector(FifoCnt-1 downto 0); --! Flag, M�moire pleine |
|
65 | Full : out std_logic_vector(FifoCnt-1 downto 0); --! Flag, M�moire pleine | |
66 | RDATA : out std_logic_vector((FifoCnt*Data_sz)-1 downto 0); --! Registre de donn�es en entr�e |
|
66 | RDATA : out std_logic_vector((FifoCnt*Data_sz)-1 downto 0); --! Registre de donn�es en entr�e | |
67 | WDATA : in std_logic_vector((FifoCnt*Data_sz)-1 downto 0); --! Registre de donn�es en sortie |
|
67 | WDATA : in std_logic_vector((FifoCnt*Data_sz)-1 downto 0); --! Registre de donn�es en sortie | |
68 | WADDR : out std_logic_vector((FifoCnt*Addr_sz)-1 downto 0); --! Registre d'addresse (�criture) |
|
68 | WADDR : out std_logic_vector((FifoCnt*Addr_sz)-1 downto 0); --! Registre d'addresse (�criture) | |
69 | RADDR : out std_logic_vector((FifoCnt*Addr_sz)-1 downto 0); --! Registre d'addresse (lecture) |
|
69 | RADDR : out std_logic_vector((FifoCnt*Addr_sz)-1 downto 0); --! Registre d'addresse (lecture) | |
70 | apbi : in apb_slv_in_type; --! Registre de gestion des entr�es du bus |
|
70 | apbi : in apb_slv_in_type; --! Registre de gestion des entr�es du bus | |
71 | apbo : out apb_slv_out_type --! Registre de gestion des sorties du bus |
|
71 | apbo : out apb_slv_out_type --! Registre de gestion des sorties du bus | |
72 | ); |
|
72 | ); | |
73 | end component; |
|
73 | end component; | |
74 |
|
74 | |||
75 | component FIFO_pipeline is |
|
75 | component FIFO_pipeline is | |
76 | generic( |
|
76 | generic( | |
77 | tech : integer := 0; |
|
77 | tech : integer := 0; | |
78 | Mem_use : integer := use_RAM; |
|
78 | Mem_use : integer := use_RAM; | |
79 | fifoCount : integer range 2 to 32 := 8; |
|
79 | fifoCount : integer range 2 to 32 := 8; | |
80 | DataSz : integer range 1 to 32 := 8; |
|
80 | DataSz : integer range 1 to 32 := 8; | |
81 | abits : integer range 2 to 12 := 8 |
|
81 | abits : integer range 2 to 12 := 8 | |
82 | ); |
|
82 | ); | |
83 | port( |
|
83 | port( | |
84 | rstn : in std_logic; |
|
84 | rstn : in std_logic; | |
85 | ReUse : in std_logic; |
|
85 | ReUse : in std_logic; | |
86 | rclk : in std_logic; |
|
86 | rclk : in std_logic; | |
87 | ren : in std_logic; |
|
87 | ren : in std_logic; | |
88 | rdata : out std_logic_vector(DataSz-1 downto 0); |
|
88 | rdata : out std_logic_vector(DataSz-1 downto 0); | |
89 | empty : out std_logic; |
|
89 | empty : out std_logic; | |
90 | raddr : out std_logic_vector(abits-1 downto 0); |
|
90 | raddr : out std_logic_vector(abits-1 downto 0); | |
91 | wclk : in std_logic; |
|
91 | wclk : in std_logic; | |
92 | wen : in std_logic; |
|
92 | wen : in std_logic; | |
93 | wdata : in std_logic_vector(DataSz-1 downto 0); |
|
93 | wdata : in std_logic_vector(DataSz-1 downto 0); | |
94 | full : out std_logic; |
|
94 | full : out std_logic; | |
95 | waddr : out std_logic_vector(abits-1 downto 0) |
|
95 | waddr : out std_logic_vector(abits-1 downto 0) | |
96 | ); |
|
96 | ); | |
97 | end component; |
|
97 | end component; | |
98 |
|
98 | |||
99 | component lpp_fifo is |
|
99 | component lpp_fifo is | |
100 | generic( |
|
100 | generic( | |
101 | tech : integer := 0; |
|
101 | tech : integer := 0; | |
102 | Mem_use : integer := use_RAM; |
|
102 | Mem_use : integer := use_RAM; | |
103 | Enable_ReUse : std_logic := '0'; |
|
103 | Enable_ReUse : std_logic := '0'; | |
104 | DataSz : integer range 1 to 32 := 8; |
|
104 | DataSz : integer range 1 to 32 := 8; | |
105 | AddrSz : integer range 2 to 12 := 8 |
|
105 | AddrSz : integer range 2 to 12 := 8 | |
106 | ); |
|
106 | ); | |
107 | port( |
|
107 | port( | |
108 | rstn : in std_logic; |
|
108 | rstn : in std_logic; | |
109 | ReUse : in std_logic; --27/01/12 |
|
109 | ReUse : in std_logic; --27/01/12 | |
110 | rclk : in std_logic; |
|
110 | rclk : in std_logic; | |
111 | ren : in std_logic; |
|
111 | ren : in std_logic; | |
112 | rdata : out std_logic_vector(DataSz-1 downto 0); |
|
112 | rdata : out std_logic_vector(DataSz-1 downto 0); | |
113 | empty : out std_logic; |
|
113 | empty : out std_logic; | |
114 | raddr : out std_logic_vector(AddrSz-1 downto 0); |
|
114 | raddr : out std_logic_vector(AddrSz-1 downto 0); | |
115 | wclk : in std_logic; |
|
115 | wclk : in std_logic; | |
116 | wen : in std_logic; |
|
116 | wen : in std_logic; | |
117 | wdata : in std_logic_vector(DataSz-1 downto 0); |
|
117 | wdata : in std_logic_vector(DataSz-1 downto 0); | |
118 | full : out std_logic; |
|
118 | full : out std_logic; | |
119 | waddr : out std_logic_vector(AddrSz-1 downto 0) |
|
119 | waddr : out std_logic_vector(AddrSz-1 downto 0) | |
120 | ); |
|
120 | ); | |
121 | end component; |
|
121 | end component; | |
122 |
|
122 | |||
123 |
|
123 | |||
124 | component lppFIFOxN is |
|
124 | component lppFIFOxN is | |
125 | generic( |
|
125 | generic( | |
126 | tech : integer := 0; |
|
126 | tech : integer := 0; | |
127 | Mem_use : integer := use_RAM; |
|
127 | Mem_use : integer := use_RAM; | |
128 | Data_sz : integer range 1 to 32 := 8; |
|
128 | Data_sz : integer range 1 to 32 := 8; | |
129 | Addr_sz : integer range 1 to 32 := 8; |
|
129 | Addr_sz : integer range 1 to 32 := 8; | |
130 | FifoCnt : integer := 1; |
|
130 | FifoCnt : integer := 1; | |
131 | Enable_ReUse : std_logic := '0' |
|
131 | Enable_ReUse : std_logic := '0' | |
132 | ); |
|
132 | ); | |
133 | port( |
|
133 | port( | |
134 | rstn : in std_logic; |
|
134 | rstn : in std_logic; | |
135 | wclk : in std_logic; |
|
135 | wclk : in std_logic; | |
136 | rclk : in std_logic; |
|
136 | rclk : in std_logic; | |
137 | ReUse : in std_logic_vector(FifoCnt-1 downto 0); |
|
137 | ReUse : in std_logic_vector(FifoCnt-1 downto 0); | |
138 | wen : in std_logic_vector(FifoCnt-1 downto 0); |
|
138 | wen : in std_logic_vector(FifoCnt-1 downto 0); | |
139 | ren : in std_logic_vector(FifoCnt-1 downto 0); |
|
139 | ren : in std_logic_vector(FifoCnt-1 downto 0); | |
140 | wdata : in std_logic_vector((FifoCnt*Data_sz)-1 downto 0); |
|
140 | wdata : in std_logic_vector((FifoCnt*Data_sz)-1 downto 0); | |
141 | rdata : out std_logic_vector((FifoCnt*Data_sz)-1 downto 0); |
|
141 | rdata : out std_logic_vector((FifoCnt*Data_sz)-1 downto 0); | |
142 | full : out std_logic_vector(FifoCnt-1 downto 0); |
|
142 | full : out std_logic_vector(FifoCnt-1 downto 0); | |
143 | empty : out std_logic_vector(FifoCnt-1 downto 0) |
|
143 | empty : out std_logic_vector(FifoCnt-1 downto 0) | |
144 | ); |
|
144 | ); | |
145 | end component; |
|
145 | end component; | |
146 |
|
146 | |||
147 | component FillFifo is |
|
147 | component FillFifo is | |
148 | generic( |
|
148 | generic( | |
149 | Data_sz : integer range 1 to 32 := 16; |
|
149 | Data_sz : integer range 1 to 32 := 16; | |
150 | Fifo_cnt : integer range 1 to 8 := 5 |
|
150 | Fifo_cnt : integer range 1 to 8 := 5 | |
151 | ); |
|
151 | ); | |
152 | port( |
|
152 | port( | |
153 | clk : in std_logic; |
|
153 | clk : in std_logic; | |
154 | raz : in std_logic; |
|
154 | raz : in std_logic; | |
155 | write : out std_logic_vector(Fifo_cnt-1 downto 0); |
|
155 | write : out std_logic_vector(Fifo_cnt-1 downto 0); | |
156 | reuse : out std_logic_vector(Fifo_cnt-1 downto 0); |
|
156 | reuse : out std_logic_vector(Fifo_cnt-1 downto 0); | |
157 | data : out std_logic_vector(Fifo_cnt*Data_sz-1 downto 0) |
|
157 | data : out std_logic_vector(Fifo_cnt*Data_sz-1 downto 0) | |
158 | ); |
|
158 | ); | |
159 | end component; |
|
159 | end component; | |
160 |
|
160 | |||
|
161 | component Bridge is | |||
|
162 | port( | |||
|
163 | clk : in std_logic; | |||
|
164 | raz : in std_logic; | |||
|
165 | EmptyUp : in std_logic; | |||
|
166 | FullDwn : in std_logic; | |||
|
167 | WriteDwn : out std_logic; | |||
|
168 | ReadUp : out std_logic | |||
|
169 | ); | |||
|
170 | end component; | |||
|
171 | ||||
161 | component ssram_plugin is |
|
172 | component ssram_plugin is | |
162 | generic (tech : integer := 0); |
|
173 | generic (tech : integer := 0); | |
163 | port |
|
174 | port | |
164 | ( |
|
175 | ( | |
165 | clk : in std_logic; |
|
176 | clk : in std_logic; | |
166 | mem_ctrlr_o : in memory_out_type; |
|
177 | mem_ctrlr_o : in memory_out_type; | |
167 | SSRAM_CLK : out std_logic; |
|
178 | SSRAM_CLK : out std_logic; | |
168 | nBWa : out std_logic; |
|
179 | nBWa : out std_logic; | |
169 | nBWb : out std_logic; |
|
180 | nBWb : out std_logic; | |
170 | nBWc : out std_logic; |
|
181 | nBWc : out std_logic; | |
171 | nBWd : out std_logic; |
|
182 | nBWd : out std_logic; | |
172 | nBWE : out std_logic; |
|
183 | nBWE : out std_logic; | |
173 | nADSC : out std_logic; |
|
184 | nADSC : out std_logic; | |
174 | nADSP : out std_logic; |
|
185 | nADSP : out std_logic; | |
175 | nADV : out std_logic; |
|
186 | nADV : out std_logic; | |
176 | nGW : out std_logic; |
|
187 | nGW : out std_logic; | |
177 | nCE1 : out std_logic; |
|
188 | nCE1 : out std_logic; | |
178 | CE2 : out std_logic; |
|
189 | CE2 : out std_logic; | |
179 | nCE3 : out std_logic; |
|
190 | nCE3 : out std_logic; | |
180 | nOE : out std_logic; |
|
191 | nOE : out std_logic; | |
181 | MODE : out std_logic; |
|
192 | MODE : out std_logic; | |
182 | ZZ : out std_logic |
|
193 | ZZ : out std_logic | |
183 | ); |
|
194 | ); | |
184 | end component; |
|
195 | end component; | |
185 |
|
196 | |||
186 | end; No newline at end of file |
|
197 | end; |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now