docs/system/gdb.rst: Add some more heading structure
[qemu/ar7.git] / target / hexagon / meson.build
blobbb0b4fb621df5caec297d2cfcedf33f2941f0dac
1 ##
2 ##  Copyright(c) 2020-2021 Qualcomm Innovation Center, Inc. All Rights Reserved.
3 ##
4 ##  This program is free software; you can redistribute it and/or modify
5 ##  it under the terms of the GNU General Public License as published by
6 ##  the Free Software Foundation; either version 2 of the License, or
7 ##  (at your option) any later version.
8 ##
9 ##  This program is distributed in the hope that it will be useful,
10 ##  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ##  GNU General Public License for more details.
14 ##  You should have received a copy of the GNU General Public License
15 ##  along with this program; if not, see <http://www.gnu.org/licenses/>.
18 hexagon_ss = ss.source_set()
20 hex_common_py = 'hex_common.py'
21 attribs_def = meson.current_source_dir() / 'attribs_def.h.inc'
22 gen_tcg_h = meson.current_source_dir() / 'gen_tcg.h'
25 #  Step 1
26 #  We use a C program to create semantics_generated.pyinc
28 gen_semantics = executable(
29     'gen_semantics',
30     'gen_semantics.c',
31     native: true, build_by_default: false)
33 semantics_generated = custom_target(
34     'semantics_generated.pyinc',
35     output: 'semantics_generated.pyinc',
36     command: [gen_semantics, '@OUTPUT@'],
38 hexagon_ss.add(semantics_generated)
41 # Step 2
42 # We use Python scripts to generate the following files
43 #     shortcode_generated.h.inc
44 #     helper_protos_generated.h.inc
45 #     tcg_funcs_generated.c.inc
46 #     tcg_func_table_generated.c.inc
47 #     helper_funcs_generated.c.inc
48 #     printinsn_generated.h.inc
49 #     op_regs_generated.h.inc
50 #     op_attribs_generated.h.inc
51 #     opcodes_def_generated.h.inc
53 shortcode_generated = custom_target(
54     'shortcode_generated.h.inc',
55     output: 'shortcode_generated.h.inc',
56     depends: [semantics_generated],
57     depend_files: [hex_common_py, attribs_def],
58     command: [python, files('gen_shortcode.py'), semantics_generated, attribs_def, '@OUTPUT@'],
60 hexagon_ss.add(shortcode_generated)
62 helper_protos_generated = custom_target(
63     'helper_protos_generated.h.inc',
64     output: 'helper_protos_generated.h.inc',
65     depends: [semantics_generated],
66     depend_files: [hex_common_py, attribs_def, gen_tcg_h],
67     command: [python, files('gen_helper_protos.py'), semantics_generated, attribs_def, gen_tcg_h, '@OUTPUT@'],
69 hexagon_ss.add(helper_protos_generated)
71 tcg_funcs_generated = custom_target(
72     'tcg_funcs_generated.c.inc',
73     output: 'tcg_funcs_generated.c.inc',
74     depends: [semantics_generated],
75     depend_files: [hex_common_py, attribs_def, gen_tcg_h],
76     command: [python, files('gen_tcg_funcs.py'), semantics_generated, attribs_def, gen_tcg_h, '@OUTPUT@'],
78 hexagon_ss.add(tcg_funcs_generated)
80 tcg_func_table_generated = custom_target(
81     'tcg_func_table_generated.c.inc',
82     output: 'tcg_func_table_generated.c.inc',
83     depends: [semantics_generated],
84     depend_files: [hex_common_py, attribs_def],
85     command: [python, files('gen_tcg_func_table.py'), semantics_generated, attribs_def, '@OUTPUT@'],
87 hexagon_ss.add(tcg_func_table_generated)
89 helper_funcs_generated = custom_target(
90     'helper_funcs_generated.c.inc',
91     output: 'helper_funcs_generated.c.inc',
92     depends: [semantics_generated],
93     depend_files: [hex_common_py, attribs_def, gen_tcg_h],
94     command: [python, files('gen_helper_funcs.py'), semantics_generated, attribs_def, gen_tcg_h, '@OUTPUT@'],
96 hexagon_ss.add(helper_funcs_generated)
98 printinsn_generated = custom_target(
99     'printinsn_generated.h.inc',
100     output: 'printinsn_generated.h.inc',
101     depends: [semantics_generated],
102     depend_files: [hex_common_py, attribs_def],
103     command: [python, files('gen_printinsn.py'), semantics_generated, attribs_def, '@OUTPUT@'],
105 hexagon_ss.add(printinsn_generated)
107 op_regs_generated = custom_target(
108     'op_regs_generated.h.inc',
109     output: 'op_regs_generated.h.inc',
110     depends: [semantics_generated],
111     depend_files: [hex_common_py, attribs_def],
112     command: [python, files('gen_op_regs.py'), semantics_generated, attribs_def, '@OUTPUT@'],
114 hexagon_ss.add(op_regs_generated)
116 op_attribs_generated = custom_target(
117     'op_attribs_generated.h.inc',
118     output: 'op_attribs_generated.h.inc',
119     depends: [semantics_generated],
120     depend_files: [hex_common_py, attribs_def],
121     command: [python, files('gen_op_attribs.py'), semantics_generated, attribs_def, '@OUTPUT@'],
123 hexagon_ss.add(op_attribs_generated)
125 opcodes_def_generated = custom_target(
126     'opcodes_def_generated.h.inc',
127     output: 'opcodes_def_generated.h.inc',
128     depends: [semantics_generated],
129     depend_files: [hex_common_py, attribs_def],
130     command: [python, files('gen_opcodes_def.py'), semantics_generated, attribs_def, '@OUTPUT@'],
132 hexagon_ss.add(opcodes_def_generated)
135 # Step 3
136 # We use a C program to create iset.py which is imported into dectree.py
137 # to create the decode tree
139 gen_dectree_import = executable(
140     'gen_dectree_import',
141     'gen_dectree_import.c', opcodes_def_generated, op_regs_generated,
142     native: true, build_by_default: false)
144 iset_py = custom_target(
145     'iset.py',
146     output: 'iset.py',
147     command: [gen_dectree_import, '@OUTPUT@'],
149 hexagon_ss.add(iset_py)
152 # Step 4
153 # We use the dectree.py script to generate the decode tree header file
155 dectree_generated = custom_target(
156     'dectree_generated.h.inc',
157     output: 'dectree_generated.h.inc',
158     depends: [iset_py],
159     command: ['env', 'PYTHONPATH=' + meson.current_build_dir(), files('dectree.py'), '@OUTPUT@'],
161 hexagon_ss.add(dectree_generated)
163 hexagon_ss.add(files(
164     'cpu.c',
165     'translate.c',
166     'op_helper.c',
167     'gdbstub.c',
168     'genptr.c',
169     'reg_fields.c',
170     'decode.c',
171     'iclass.c',
172     'opcodes.c',
173     'printinsn.c',
174     'arch.c',
175     'fma_emu.c',
176     'conv_emu.c',
179 target_arch += {'hexagon': hexagon_ss}