##// END OF EJS Templates
Added an automated Devices ID and Vendor ID handler
Alexis -
r36:2c9e70f363a1 default
parent child
Show More
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
@@ -0,0 +1,9
1
2
3 /*===============================================================================
4
5 THIS FILE IS GENERATED BY A SCRIPT, DON'T TRY TO EDIT
6
7 TAKE A LOOK AT VHD_LIB/APB_DEVICES FOLDER TO ADD A DEVICE ID OR VENDOR ID
8
9 ===============================================================================*/
@@ -0,0 +1,3
1
2
3 end;
@@ -0,0 +1,18
1
2 --=================================================================================
3 --THIS FILE IS GENERATED BY A SCRIPT, DON'T TRY TO EDIT
4 --
5 --TAKE A LOOK AT VHD_LIB/APB_DEVICES FOLDER TO ADD A DEVICE ID OR VENDOR ID
6 --=================================================================================
7
8
9 library ieee;
10 use ieee.std_logic_1164.all;
11 library grlib;
12 use grlib.amba.all;
13 use std.textio.all;
14
15
16 package lpp_apb_devices is
17
18
@@ -0,0 +1,12
1 vendor VENDOR_LPP 19
2
3 device ROCKET_TM 1
4 device otherCore 2
5 device LPP_SIMPLE_DIODE 3
6 device LPP_MULTI_DIODE 4
7 device LPP_LCD_CTRLR 5
8 device LPP_UART 6
9 device LPP_CNA 7
10 device LPP_APB_ADC 8
11 device LPP_CHENILLARD 9
12 device LPP_IIR_CEL_FILTER 10
@@ -0,0 +1,77
1 echo "======================================================================================="
2 echo "---------------------------------------------------------------------------------------"
3 echo " LPP VHDL APB Devices List Updater "
4 echo " Copyright (C) 2010 Laboratory of Plasmas Physic. "
5 echo "======================================================================================="
6 echo '----------------------------------------------------------------------------------------
7 This file is a part of the LPP VHDL IP LIBRARY
8 Copyright (C) 2010, Laboratory of Plasmas Physic - CNRS
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 ----------------------------------------------------------------------------------------'
24 echo
25 echo
26 echo
27
28 LPP_PATCHPATH=`pwd -L`
29
30 cd $LPP_PATCHPATH/lib/lpp
31
32
33 VHDFileStart=$LPP_PATCHPATH/APB_DEVICES/VHDListSTART
34 VHDFileEnd=$LPP_PATCHPATH/APB_DEVICES/VHDListEND
35
36 CFileStart=$LPP_PATCHPATH/APB_DEVICES/CListSTART
37 CFileEnd=$LPP_PATCHPATH/APB_DEVICES/CListEND
38
39 ListFILE=$LPP_PATCHPATH/APB_DEVICES/apb_devices_list.txt
40
41 VHDListFILE=$LPP_PATCHPATH/lib/lpp/lpp_amba/apb_devices_list.vhd
42 CListFILE=$LPP_PATCHPATH/LPP_drivers/libsrc/AMBA/apb_devices_list.h
43
44
45 cat $VHDFileStart>$VHDListFILE
46 cat $CFileStart>$CListFILE
47
48 grep vendor $ListFILE | sed "s/vendor /constant /" | sed "s/.* /& : amba_vendor_type := 16#/" | sed "s/.*#*/&;/" >> $VHDListFILE
49 grep vendor $ListFILE | sed "s/vendor /#define /" | sed "s/.* /& 0x/" >> $CListFILE
50
51 echo " ">>$VHDListFILE
52 echo " ">>$CListFILE
53
54 grep device $ListFILE | sed "s/device /constant /" | sed "s/.* /& : amba_device_type := 16#/" | sed "s/.*#*/&;/" >> $VHDListFILE
55 grep device $ListFILE | sed "s/device /#define /" | sed "s/.* /& 0x/" >> $CListFILE
56
57 cat $VHDFileEnd>>$VHDListFILE
58 cat $CFileEnd>>$CListFILE
59
60 sh $(SCRIPTSDIR)/GPL_Patcher.sh vhd lib/lpp/lpp_amba/
61 sh $(SCRIPTSDIR)/GPL_Patcher.sh h LPP_drivers/libsrc/AMBA/
62
63 cd $LPP_PATCHPATH
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@@ -23,15 +23,7
23 #define APB_BASE_ADDRS 0x80000000
23 #define APB_BASE_ADDRS 0x80000000
24 #define APB_MAX_DEVICES 256
24 #define APB_MAX_DEVICES 256
25
25
26 #define VENDOR_LPP 0x19
26 #include "apb_devices_list.h"
27
28 #define ROCKET_TM 0x001
29 #define otherCore 0x002
30 #define LPP_SIMPLE_DIODE 0x003
31 #define LPP_MULTI_DIODE 0x004
32 #define LPP_LCD_CTRLR 0x005
33 #define LPP_UART_CTRLR 0x006
34 #define LPP_DAC_CTRLR 0x007
35
27
36 /** @todo implemente a descriptor structure for any APB device */
28 /** @todo implemente a descriptor structure for any APB device */
37
29
@@ -1,68 +1,68
1 #include "apb_dac_Driver.h"
1 #include "apb_dac_Driver.h"
2 #include "lpp_apb_functions.h"
2 #include "lpp_apb_functions.h"
3 #include <stdio.h>
3 #include <stdio.h>
4
4
5
5
6 DAC_Device* DacOpen(int count)
6 DAC_Device* DacOpen(int count)
7 {
7 {
8 DAC_Device* dac0;
8 DAC_Device* dac0;
9 dac0 = (DAC_Device*) apbgetdevice(LPP_DAC_CTRLR,VENDOR_LPP,count);
9 dac0 = (DAC_Device*) apbgetdevice(LPP_CNA,VENDOR_LPP,count);
10 dac0->configReg = DAC_enable;
10 dac0->configReg = DAC_enable;
11 return dac0;
11 return dac0;
12 }
12 }
13
13
14 /*
14 /*
15 DAC_Device* DacClose(int count)
15 DAC_Device* DacClose(int count)
16 {
16 {
17 DAC_Device* dac1;
17 DAC_Device* dac1;
18 dac1 = (DAC_Device*) apbgetdevice(LPP_DAC_CTRLR,VENDOR_LPP,count);
18 dac1 = (DAC_Device*) apbgetdevice(LPP_CNA,VENDOR_LPP,count);
19 dac1->configReg = DAC_disable;
19 dac1->configReg = DAC_disable;
20 return dac1;
20 return dac1;
21 }
21 }
22 */
22 */
23
23
24
24
25 int DacTable()
25 int DacTable()
26 {
26 {
27 int i;
27 int i;
28 DAC_Device* dac2;
28 DAC_Device* dac2;
29 int tablo[251] = {0x9555,0x1800,0x19AA,0x1B15,0x1C0A,0x1C66,0x1C1F,0x1B44,0x19FC,0x187F,0x170F,0x15EA,0x1542,0x1537,0x15CE,0x16F2,0x187A,0x1A2B,0x1BC2,0x1D04,0x1DBF,0x1DDB,0x1D56,0x1C49,0x1AE3,0x195F,0x1800,0x1700,0x168D,0x16BA,0x1785,0x18D0,0x1A69,0x1C12,0x1D8A,0x1E98,0x1F13,
29 int tablo[251] = {0x9555,0x1800,0x19AA,0x1B15,0x1C0A,0x1C66,0x1C1F,0x1B44,0x19FC,0x187F,0x170F,0x15EA,0x1542,0x1537,0x15CE,0x16F2,0x187A,0x1A2B,0x1BC2,0x1D04,0x1DBF,0x1DDB,0x1D56,0x1C49,0x1AE3,0x195F,0x1800,0x1700,0x168D,0x16BA,0x1785,0x18D0,0x1A69,0x1C12,0x1D8A,0x1E98,0x1F13,
30 0x1EEB,0x1E28,0x1CEC,0x1FFF,0x19E8,0x189F,0x17C8,0x1788,0x17EA,0x18E2,0x1A48,0x1BE7,0x1D7C,0x1ECA,0x1F9C,0x1FD2,0x1F64,0x1E66,0x1D00,0x1B6E,0x19EF,0x18C1,0x1817,0x180A,0x189D,0x19BA,0x1B33,0x1CCC,0x1E44,0x1F5F,0x1FEE,0x1FDC,0x1F2B,0x1DF6,0x1C6E,0x1AD1,0x1960,0x1855,0x17D9,0x1800,
30 0x1EEB,0x1E28,0x1CEC,0x1FFF,0x19E8,0x189F,0x17C8,0x1788,0x17EA,0x18E2,0x1A48,0x1BE7,0x1D7C,0x1ECA,0x1F9C,0x1FD2,0x1F64,0x1E66,0x1D00,0x1B6E,0x19EF,0x18C1,0x1817,0x180A,0x189D,0x19BA,0x1B33,0x1CCC,0x1E44,0x1F5F,0x1FEE,0x1FDC,0x1F2B,0x1DF6,0x1C6E,0x1AD1,0x1960,0x1855,0x17D9,0x1800,
31 0x18C1,0x19FD,0x1B80,0x1D0A,0x1E5C,0x1F3D,0x1F87,0x1F2E,0x1E3E,0x1CDA,0x1B39,0x199C,0x1842,0x1760,0x1717,0x1771,0x185D,0x19B1,0x1B36,0x1CAA,0x1DCF,0x1E73,0x1E79,0x1DDD,0x1CB4,0x1B2B,0x197C,0x17EA,0x16B1,0x15FF,0x15EE,0x167C,0x178F,0x18F7,0x1A78,0x1BCF,0x1CC4,0x1D2A,0x1CED,0x1C14,
31 0x18C1,0x19FD,0x1B80,0x1D0A,0x1E5C,0x1F3D,0x1F87,0x1F2E,0x1E3E,0x1CDA,0x1B39,0x199C,0x1842,0x1760,0x1717,0x1771,0x185D,0x19B1,0x1B36,0x1CAA,0x1DCF,0x1E73,0x1E79,0x1DDD,0x1CB4,0x1B2B,0x197C,0x17EA,0x16B1,0x15FF,0x15EE,0x167C,0x178F,0x18F7,0x1A78,0x1BCF,0x1CC4,0x1D2A,0x1CED,0x1C14,
32 0x1ABC,0x191A,0x176B,0x15F0,0x14E2,0x1467,0x1490,0x1552,0x1689,0x1800,0x1977,0x1AAE,0x1B70,0x1B99,0x1B1E,0x1A10,0x1895,0x16E6,0x1544,0x13EC,0x1313,0x12D6,0x133C,0x1431,0x1588,0x1709,0x1871,0x1984,0x1A12,0x1A01,0x194F,0x1816,0x1684,0x14D5,0x134C,0x1223,0x1187,0x118D,0x1231,0x1356,
32 0x1ABC,0x191A,0x176B,0x15F0,0x14E2,0x1467,0x1490,0x1552,0x1689,0x1800,0x1977,0x1AAE,0x1B70,0x1B99,0x1B1E,0x1A10,0x1895,0x16E6,0x1544,0x13EC,0x1313,0x12D6,0x133C,0x1431,0x1588,0x1709,0x1871,0x1984,0x1A12,0x1A01,0x194F,0x1816,0x1684,0x14D5,0x134C,0x1223,0x1187,0x118D,0x1231,0x1356,
33 0x14CA,0x164F,0x17A3,0x188F,0x18E9,0x18A0,0x17BE,0x1664,0x14C7,0x1326,0x11C2,0x10D2,0x1079,0x10C3,0x11A4,0x12F6,0x1480,0x1603,0x173F,0x1800,0x1827,0x17AB,0x16A0,0x152F,0x1392,0x120A,0x10D5,0x1024,0x1012,0x10A1,0x11BC,0x1334,0x14CD,0x1646,0x1763,0x17F6,0x17E9,0x173F,0x1611,0x1492,
33 0x14CA,0x164F,0x17A3,0x188F,0x18E9,0x18A0,0x17BE,0x1664,0x14C7,0x1326,0x11C2,0x10D2,0x1079,0x10C3,0x11A4,0x12F6,0x1480,0x1603,0x173F,0x1800,0x1827,0x17AB,0x16A0,0x152F,0x1392,0x120A,0x10D5,0x1024,0x1012,0x10A1,0x11BC,0x1334,0x14CD,0x1646,0x1763,0x17F6,0x17E9,0x173F,0x1611,0x1492,
34 0x1300,0x119A,0x109C,0x102E,0x1064,0x1136,0x1284,0x1419,0x15B8,0x171E,0x1816,0x1878,0x1838,0x1761,0x1618,0x1494,0x1314,0x11D8,0x1115,0x10ED,0x1168,0x1276,0x13EE,0x1597,0x1730,0x187B,0x1946,0x1973,0x1900,0x1800,0x16A1,0x151D,0x13B7,0x12AA,0x1225,0x1241,0x12FC,0x143E,0x15D5,0x1786,
34 0x1300,0x119A,0x109C,0x102E,0x1064,0x1136,0x1284,0x1419,0x15B8,0x171E,0x1816,0x1878,0x1838,0x1761,0x1618,0x1494,0x1314,0x11D8,0x1115,0x10ED,0x1168,0x1276,0x13EE,0x1597,0x1730,0x187B,0x1946,0x1973,0x1900,0x1800,0x16A1,0x151D,0x13B7,0x12AA,0x1225,0x1241,0x12FC,0x143E,0x15D5,0x1786,
35 0x190E,0x1A32,0x1AC9,0x1ABE,0x1A16,0x18F1,0x1781,0x1604,0x14BC,0x13E1,0x139A,0x13F6,0x14EB,0x1656};
35 0x190E,0x1A32,0x1AC9,0x1ABE,0x1A16,0x18F1,0x1781,0x1604,0x14BC,0x13E1,0x139A,0x13F6,0x14EB,0x1656};
36 dac2 = (DAC_Device*)0x80000800;
36 dac2 = (DAC_Device*)0x80000800;
37 dac2->configReg = DAC_enable;
37 dac2->configReg = DAC_enable;
38 dac2->dataReg = tablo[0];
38 dac2->dataReg = tablo[0];
39
39
40 while(1)
40 while(1)
41 {
41 {
42 for (i = 0 ; i < 251 ; i++)
42 for (i = 0 ; i < 251 ; i++)
43 {
43 {
44 while(!((dac2->configReg & DAC_ready) == DAC_ready));
44 while(!((dac2->configReg & DAC_ready) == DAC_ready));
45 dac2->dataReg = tablo[i];
45 dac2->dataReg = tablo[i];
46 while((dac2->configReg & DAC_ready) == DAC_ready);
46 while((dac2->configReg & DAC_ready) == DAC_ready);
47 }
47 }
48 }
48 }
49 return 0;
49 return 0;
50 }
50 }
51
51
52
52
53
53
54 int DacConst()
54 int DacConst()
55 {
55 {
56 DAC_Device* dac3;
56 DAC_Device* dac3;
57 int Value = 0x1FFF;
57 int Value = 0x1FFF;
58 dac3 = (DAC_Device*)0x80000800;
58 dac3 = (DAC_Device*)0x80000800;
59 dac3->configReg = DAC_enable;
59 dac3->configReg = DAC_enable;
60 while(1)
60 while(1)
61 {
61 {
62 printf("\nEntrer une valeur entre 4096 et 8191 : ");
62 printf("\nEntrer une valeur entre 4096 et 8191 : ");
63 scanf("%d",&Value);
63 scanf("%d",&Value);
64 dac3->dataReg = Value;
64 dac3->dataReg = Value;
65 }
65 }
66 return 0;
66 return 0;
67 }
67 }
68
68
@@ -35,9 +35,14 init: C-libs
35 sh $(SCRIPTSDIR)/vhdlsynPatcher.sh
35 sh $(SCRIPTSDIR)/vhdlsynPatcher.sh
36 sh $(SCRIPTSDIR)/makeDirs.sh lib/lpp
36 sh $(SCRIPTSDIR)/makeDirs.sh lib/lpp
37
37
38 C-libs:
38 C-libs:APB_devs
39 make -C LPP_drivers
39 make -C LPP_drivers
40
40
41
42 APB_devs:
43 sh $(SCRIPTSDIR)/APB_DEV_UPDATER.sh
44
45
41 Patch-GRLIB: init doc
46 Patch-GRLIB: init doc
42 sh $(SCRIPTSDIR)/patch.sh $(GRLIB)
47 sh $(SCRIPTSDIR)/patch.sh $(GRLIB)
43
48
@@ -61,7 +61,7 architecture AR_APB_IIR_CEL of APB_IIR_C
61 constant REVISION : integer := 1;
61 constant REVISION : integer := 1;
62
62
63 constant pconfig : apb_config_type := (
63 constant pconfig : apb_config_type := (
64 0 => ahb_device_reg (VENDOR_LPP, ROCKET_TM, 0, REVISION, 0),
64 0 => ahb_device_reg (VENDOR_LPP, LPP_IIR_CEL_FILTER, 0, REVISION, 0),
65 1 => apb_iobar(paddr, pmask));
65 1 => apb_iobar(paddr, pmask));
66
66
67
67
@@ -53,7 +53,7 architecture ar_lpp_apb_ad_conv of lpp_a
53 constant REVISION : integer := 1;
53 constant REVISION : integer := 1;
54
54
55 constant pconfig : apb_config_type := (
55 constant pconfig : apb_config_type := (
56 0 => ahb_device_reg (VENDOR_LPP, LPP_ADC_7688, 0, REVISION, 0),
56 0 => ahb_device_reg (VENDOR_LPP, LPP_APB_ADC, 0, REVISION, 0),
57 1 => apb_iobar(paddr, pmask));
57 1 => apb_iobar(paddr, pmask));
58
58
59 signal Rdata : std_logic_vector(31 downto 0);
59 signal Rdata : std_logic_vector(31 downto 0);
@@ -20,28 +20,12 library ieee;
20 use ieee.std_logic_1164.all;
20 use ieee.std_logic_1164.all;
21 library grlib;
21 library grlib;
22 use grlib.amba.all;
22 use grlib.amba.all;
23 -- pragma translate_off
24 use std.textio.all;
23 use std.textio.all;
25 -- pragma translate_on
26
24
27
25
28
26
29 package lpp_amba is
27 package lpp_amba is
30
28
31 constant VENDOR_LPP : amba_vendor_type := 16#19#;
32
33 -- LPP device ids
34
35 constant ROCKET_TM : amba_device_type := 16#001#;
36 constant otherCore : amba_device_type := 16#002#;
37 constant LPP_SIMPLE_DIODE : amba_device_type := 16#003#;
38 constant LPP_MULTI_DIODE : amba_device_type := 16#004#;
39 constant LPP_LCD_CTRLR : amba_device_type := 16#005#;
40 constant LPP_UART : amba_device_type := 16#006#;
41 constant LPP_CNA : amba_device_type := 16#007#;
42 constant LPP_ADC_7688 : amba_device_type := 16#008#;
43 constant LPP_CHENILLARD : amba_device_type := 16#009#;
44
45 component APB_CHENILLARD is
29 component APB_CHENILLARD is
46 generic (
30 generic (
47 pindex : integer := 0;
31 pindex : integer := 0;
@@ -60,7 +60,7 constant zeroVect : std_logic_ve
60 begin
60 begin
61
61
62
62
63 RDATA <= RDATA_int(8 downto 1);
63
64 WDATA_int <= '1' & WDATA & '0';
64 WDATA_int <= '1' & WDATA & '0';
65
65
66 BaudGenerator : BaudGen
66 BaudGenerator : BaudGen
@@ -90,6 +90,7 begin
90 end if;
90 end if;
91 if NwDat_int_reg = '0' and NwDat_int = '1' then
91 if NwDat_int_reg = '0' and NwDat_int = '1' then
92 NwDat <= '1';
92 NwDat <= '1';
93 RDATA <= RDATA_int(8 downto 1);
93 elsif ack = '1' then
94 elsif ack = '1' then
94 NwDat <= '0';
95 NwDat <= '0';
95 end if;
96 end if;
@@ -97,3 +98,6 begin
97 end process;
98 end process;
98
99
99 end ar_UART;
100 end ar_UART;
101
102
103
@@ -26,8 +26,5 echo
26 echo
26 echo
27
27
28
28
29
29 make -C doc/latex
30
30 cp doc/latex/refman.pdf ../../VHD_lib.pdf
31 cd doc/latex
32 make
33 cp refman.pdf ../../VHD_lib.pdf
@@ -34,7 +34,7 cd $LPP_PATCHPATH/lib/lpp
34
34
35 #find . -type d|grep ./>$LPP_PATCHPATH/lib/lpp/dirs.txt
35 #find . -type d|grep ./>$LPP_PATCHPATH/lib/lpp/dirs.txt
36
36
37 rm $LPP_PATCHPATH/lib/lpp/dirs.txt
37 rm -f $LPP_PATCHPATH/lib/lpp/dirs.txt
38
38
39 for folders in $(find . -type d|grep ./)
39 for folders in $(find . -type d|grep ./)
40 do
40 do
@@ -60,10 +60,10 if [ -d "$GRLIBPATH" ]; then
60
60
61 #CLEAN
61 #CLEAN
62 echo "CLEANING .."
62 echo "CLEANING .."
63 rm -v $1/lib/*.sh
63 rm -f -v $1/lib/*.sh
64 rm -v $1/lib/TODO
64 rm -f -v $1/lib/TODO
65 rm -v $1/lib/Makefile
65 rm -f -v $1/lib/Makefile
66 rm -v $1/lib/log.txt
66 rm -f -v $1/lib/log.txt
67 echo
67 echo
68 echo
68 echo
69 echo
69 echo
@@ -42,7 +42,7 echo
42
42
43 #CLEAN
43 #CLEAN
44 echo "CLEANING .."
44 echo "CLEANING .."
45 rm -v $1/boards/*.sh
45 rm -f -v $1/boards/*.sh
46 echo
46 echo
47 echo
47 echo
48 echo
48 echo
@@ -42,7 +42,7 echo
42
42
43 #CLEAN
43 #CLEAN
44 echo "CLEANING .."
44 echo "CLEANING .."
45 rm -v $1/designs/*.sh
45 rm -f -v $1/designs/*.sh
46 echo
46 echo
47 echo
47 echo
48 echo
48 echo
@@ -34,7 +34,7 echo
34
34
35 #COPY
35 #COPY
36 echo "Remove old lib Files..."
36 echo "Remove old lib Files..."
37 rm -R -v $1/lib/lpp
37 rm -f -R -v $1/lib/lpp
38 echo "Copy lib Files..."
38 echo "Copy lib Files..."
39 cp -R -v $LPP_LIBPATH/lib $1
39 cp -R -v $LPP_LIBPATH/lib $1
40 echo
40 echo
@@ -56,8 +56,8 echo
56
56
57 #CLEAN
57 #CLEAN
58 echo "CLEANING .."
58 echo "CLEANING .."
59 rm -v $1/lib/*.sh
59 rm -f -v $1/lib/*.sh
60 rm -v $1/lib/GPL_HEADER
60 rm -f -v $1/lib/GPL_HEADER
61 echo
61 echo
62 echo
62 echo
63 echo
63 echo
@@ -47,7 +47,7 case $1 in
47 echo "enter folder : $folders"
47 echo "enter folder : $folders"
48 files=$(ls $folders | grep .vhd | grep -i -v "test")
48 files=$(ls $folders | grep .vhd | grep -i -v "test")
49 echo "found $files"
49 echo "found $files"
50 rm $folders/vhdlsyn.txt
50 rm -f $folders/vhdlsyn.txt
51 for file in $files
51 for file in $files
52 do
52 do
53 echo "$file">>$folders/vhdlsyn.txt
53 echo "$file">>$folders/vhdlsyn.txt
General Comments 0
You need to be logged in to leave comments. Login now