annotate gcc/config/avr/avr-devices.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1 /* Copyright (C) 2009-2020 Free Software Foundation, Inc.
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 Contributed by Anatoly Sokolov (aesok@post.ru)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 This file is part of GCC.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 the Free Software Foundation; either version 3, or (at your option)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 any later version.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 GNU General Public License for more details.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
111
kono
parents: 67
diff changeset
20 #ifndef IN_GEN_AVR_MMCU_TEXI
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21 #define IN_TARGET_CODE 1
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
22
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 #include "config.h"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 #include "system.h"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 #include "coretypes.h"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 #include "tm.h"
111
kono
parents: 67
diff changeset
27 #include "diagnostic.h"
kono
parents: 67
diff changeset
28 #endif /* IN_GEN_AVR_MMCU_TEXI */
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
111
kono
parents: 67
diff changeset
30 #include "avr-arch.h"
kono
parents: 67
diff changeset
31
kono
parents: 67
diff changeset
32 /* List of all known AVR MCU architectures.
kono
parents: 67
diff changeset
33 Order as of enum avr_arch from avr.h. */
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
111
kono
parents: 67
diff changeset
35 const avr_arch_t
kono
parents: 67
diff changeset
36 avr_arch_types[] =
kono
parents: 67
diff changeset
37 {
kono
parents: 67
diff changeset
38 /* unknown device specified */
kono
parents: 67
diff changeset
39 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, NULL, AVR_MMCU_DEFAULT },
kono
parents: 67
diff changeset
40 /*
kono
parents: 67
diff changeset
41 A M J LM E E E X R T d S FPO S O A
kono
parents: 67
diff changeset
42 S U M PO L L I M A I a t lMff F ff r
kono
parents: 67
diff changeset
43 M L P MV P P J E M N t a a s R s c
kono
parents: 67
diff changeset
44 XW M M M G P Y a r s e e h
kono
parents: 67
diff changeset
45 X P A D t h t t ID */
kono
parents: 67
diff changeset
46 { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "1", "avr1" },
kono
parents: 67
diff changeset
47 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "2", "avr2" },
kono
parents: 67
diff changeset
48 { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "25", "avr25" },
kono
parents: 67
diff changeset
49 { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "3", "avr3" },
kono
parents: 67
diff changeset
50 { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0x0060, 0, 32, "31", "avr31" },
kono
parents: 67
diff changeset
51 { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "35", "avr35" },
kono
parents: 67
diff changeset
52 { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "4", "avr4" },
kono
parents: 67
diff changeset
53 { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0x0060, 0, 32, "5", "avr5" },
kono
parents: 67
diff changeset
54 { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0x0060, 0, 32, "51", "avr51" },
kono
parents: 67
diff changeset
55 { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0x0060, 0, 32, "6", "avr6" },
kono
parents: 67
diff changeset
56
kono
parents: 67
diff changeset
57 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0x0040, 0x4000, 0, "100", "avrtiny" },
kono
parents: 67
diff changeset
58 { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0x2000, 0, 0, "102", "avrxmega2" },
kono
parents: 67
diff changeset
59 { 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0x2000, 0x8000, 0, "103", "avrxmega3" },
kono
parents: 67
diff changeset
60 { 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0x2000, 0, 0, "104", "avrxmega4" },
kono
parents: 67
diff changeset
61 { 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0x2000, 0, 0, "105", "avrxmega5" },
kono
parents: 67
diff changeset
62 { 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0x2000, 0, 0, "106", "avrxmega6" },
kono
parents: 67
diff changeset
63 { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0x2000, 0, 0, "107", "avrxmega7" }
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
111
kono
parents: 67
diff changeset
66 const avr_arch_info_t
kono
parents: 67
diff changeset
67 avr_texinfo[] =
kono
parents: 67
diff changeset
68 {
kono
parents: 67
diff changeset
69 { ARCH_AVR1,
kono
parents: 67
diff changeset
70 "This ISA is implemented by the minimal AVR core and supported "
kono
parents: 67
diff changeset
71 "for assembler only." },
kono
parents: 67
diff changeset
72 { ARCH_AVR2,
kono
parents: 67
diff changeset
73 "``Classic'' devices with up to 8@tie{}KiB of program memory." },
kono
parents: 67
diff changeset
74 { ARCH_AVR25,
kono
parents: 67
diff changeset
75 "``Classic'' devices with up to 8@tie{}KiB of program memory and with "
kono
parents: 67
diff changeset
76 "the @code{MOVW} instruction." },
kono
parents: 67
diff changeset
77 { ARCH_AVR3,
kono
parents: 67
diff changeset
78 "``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of "
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
79 "program memory." },
111
kono
parents: 67
diff changeset
80 { ARCH_AVR31,
kono
parents: 67
diff changeset
81 "``Classic'' devices with 128@tie{}KiB of program memory." },
kono
parents: 67
diff changeset
82 { ARCH_AVR35,
kono
parents: 67
diff changeset
83 "``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of "
kono
parents: 67
diff changeset
84 "program memory and with the @code{MOVW} instruction." },
kono
parents: 67
diff changeset
85 { ARCH_AVR4,
kono
parents: 67
diff changeset
86 "``Enhanced'' devices with up to 8@tie{}KiB of program memory." },
kono
parents: 67
diff changeset
87 { ARCH_AVR5,
kono
parents: 67
diff changeset
88 "``Enhanced'' devices with 16@tie{}KiB up to 64@tie{}KiB of "
kono
parents: 67
diff changeset
89 "program memory." },
kono
parents: 67
diff changeset
90 { ARCH_AVR51,
kono
parents: 67
diff changeset
91 "``Enhanced'' devices with 128@tie{}KiB of program memory." },
kono
parents: 67
diff changeset
92 { ARCH_AVR6,
kono
parents: 67
diff changeset
93 "``Enhanced'' devices with 3-byte PC, i.e.@: with more than 128@tie{}KiB "
kono
parents: 67
diff changeset
94 "of program memory." },
kono
parents: 67
diff changeset
95 { ARCH_AVRTINY,
kono
parents: 67
diff changeset
96 "``TINY'' Tiny core devices with 512@tie{}B up to 4@tie{}KiB of "
kono
parents: 67
diff changeset
97 "program memory." },
kono
parents: 67
diff changeset
98 { ARCH_AVRXMEGA2,
kono
parents: 67
diff changeset
99 "``XMEGA'' devices with more than 8@tie{}KiB and up to 64@tie{}KiB "
kono
parents: 67
diff changeset
100 "of program memory." },
kono
parents: 67
diff changeset
101 { ARCH_AVRXMEGA3,
kono
parents: 67
diff changeset
102 "``XMEGA'' devices with up to 64@tie{}KiB of combined program memory "
kono
parents: 67
diff changeset
103 "and RAM, and with program memory visible in the RAM address space." },
kono
parents: 67
diff changeset
104 { ARCH_AVRXMEGA4,
kono
parents: 67
diff changeset
105 "``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB "
kono
parents: 67
diff changeset
106 "of program memory." },
kono
parents: 67
diff changeset
107 { ARCH_AVRXMEGA5,
kono
parents: 67
diff changeset
108 "``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB "
kono
parents: 67
diff changeset
109 "of program memory and more than 64@tie{}KiB of RAM." },
kono
parents: 67
diff changeset
110 { ARCH_AVRXMEGA6,
kono
parents: 67
diff changeset
111 "``XMEGA'' devices with more than 128@tie{}KiB of program memory." },
kono
parents: 67
diff changeset
112 { ARCH_AVRXMEGA7,
kono
parents: 67
diff changeset
113 "``XMEGA'' devices with more than 128@tie{}KiB of program memory "
kono
parents: 67
diff changeset
114 "and more than 64@tie{}KiB of RAM." }
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116
111
kono
parents: 67
diff changeset
117 const avr_mcu_t
kono
parents: 67
diff changeset
118 avr_mcu_types[] =
kono
parents: 67
diff changeset
119 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
120 #define AVR_MCU(NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, FLASH_SIZE, PMOFF) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
121 { NAME, ARCH, DEV_ATTRIBUTE, MACRO, DATA_SEC, TEXT_SEC, FLASH_SIZE, PMOFF },
111
kono
parents: 67
diff changeset
122 #include "avr-mcus.def"
kono
parents: 67
diff changeset
123 #undef AVR_MCU
kono
parents: 67
diff changeset
124 /* End of list. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
125 { NULL, ARCH_UNKNOWN, AVR_ISA_NONE, NULL, 0, 0, 0, 0 }
111
kono
parents: 67
diff changeset
126 };
kono
parents: 67
diff changeset
127
kono
parents: 67
diff changeset
128
kono
parents: 67
diff changeset
129
kono
parents: 67
diff changeset
130
kono
parents: 67
diff changeset
131 #ifndef IN_GEN_AVR_MMCU_TEXI
kono
parents: 67
diff changeset
132
kono
parents: 67
diff changeset
133 static char*
kono
parents: 67
diff changeset
134 avr_archs_str (void)
kono
parents: 67
diff changeset
135 {
kono
parents: 67
diff changeset
136 char *archs = concat ("", NULL);
kono
parents: 67
diff changeset
137
kono
parents: 67
diff changeset
138 // Build of core architectures' names.
kono
parents: 67
diff changeset
139
kono
parents: 67
diff changeset
140 for (const avr_mcu_t *mcu = avr_mcu_types; mcu->name; mcu++)
kono
parents: 67
diff changeset
141 if (!mcu->macro)
kono
parents: 67
diff changeset
142 archs = concat (archs, " ", avr_arch_types[mcu->arch_id].name, NULL);
kono
parents: 67
diff changeset
143
kono
parents: 67
diff changeset
144 return archs;
kono
parents: 67
diff changeset
145 }
kono
parents: 67
diff changeset
146
kono
parents: 67
diff changeset
147
kono
parents: 67
diff changeset
148 void
kono
parents: 67
diff changeset
149 avr_inform_core_architectures (void)
kono
parents: 67
diff changeset
150 {
kono
parents: 67
diff changeset
151 char *archs = avr_archs_str ();
kono
parents: 67
diff changeset
152 inform (input_location, "supported core architectures:%s", archs);
kono
parents: 67
diff changeset
153 free (archs);
kono
parents: 67
diff changeset
154 }
kono
parents: 67
diff changeset
155
kono
parents: 67
diff changeset
156 #endif // IN_GEN_AVR_MMCU_TEXI