f3899f7895b47ed0d3a75b77acfe65677efdbdc3
[libreriscv.git] / openpower / Makefile
1 #!/usr/bin/make -f
2 .PHONY: tex clean upload pdf
3
4 pdf : simple_v_spec.pdf
5
6 ISA_DIR := ../../openpower-isa/openpower/isa
7 SOURCE_TEX := \
8 tex_out/remap.tex \
9 tex_out/remap_appendix.tex \
10 tex_out/bitmanip.tex tex_out/vector_ops.tex \
11 tex_out/sv.tex tex_out/svp64_appendix.tex \
12 tex_out/overview.tex tex_out/svp64.tex \
13 tex_out/executive_summary.tex \
14 tex_out/compliancy_levels.tex tex_out/svp64_quirks.tex \
15 tex_out/sprs.tex tex_out/opcode_regs_deduped.tex \
16 tex_out/normal.tex tex_out/ldst.tex \
17 tex_out/branches.tex tex_out/cr_ops.tex \
18 tex_out/setvl.tex tex_out/svstep.tex \
19 tex_out/mv_swizzle.tex tex_out/mv_vec.tex \
20 tex_out/pseudocode_simplev.tex \
21 tex_out/pseudocode_bitmanip.tex \
22 tex_out/cr_int_predication.tex \
23 tex_out/fcvt.tex tex_out/fclass.tex \
24 tex_out/int_fp_mv.tex tex_out/av_opcodes.tex \
25 tex_out/big_integer.tex \
26 tex_out/pseudocode_fixedshift.tex \
27 tex_out/pseudocode_bcd.tex tex_out/pseudocode_branch.tex \
28 tex_out/pseudocode_comparefixed.tex \
29 tex_out/pseudocode_condition.tex \
30 tex_out/pseudocode_svfparith.tex \
31 tex_out/pseudocode_fixedarith.tex \
32 tex_out/pseudocode_fixedload.tex \
33 tex_out/pseudocode_fixedlogical.tex \
34 tex_out/pseudocode_fixedstore.tex \
35 tex_out/pseudocode_fixedtrap.tex \
36 tex_out/pseudocode_sprset.tex \
37 tex_out/pseudocode_stringldst.tex \
38 tex_out/pseudocode_system.tex \
39 tex_out/pseudocode_fpload.tex tex_out/pseudocode_fpstore.tex \
40 tex_out/pseudocode_fpmove.tex tex_out/pseudocode_fparith.tex \
41 tex_out/pseudocode_fpcvt.tex \
42 tex_out/pseudocode_svfixedarith.tex \
43 tex_out/big_integer_analysis.tex \
44 tex_out/transcendentals.tex \
45 tex_out/atomics.tex \
46 tex_out/sv_analysis.tex \
47 tex_out/vector_isas.tex \
48 tex_out/comparison_table.tex \
49 tex_out/fields.tex
50
51 # Does this umbrella rule need to be modified?
52 tex: $(SOURCE_TEX)
53 mkdir -p tex_out
54
55 tex_out/sv_analysis.tex : sv/sv_analysis.mdwn mdwn_inline.py \
56 ../../openpower-isa/src/openpower/sv/sv_analysis.py
57 mkdir -p tex_out
58 ./mdwn_inline.py sv/sv_analysis.mdwn tex_out/sv_analysis.mdwn
59 pandoc -f markdown -t latex --top-level-division=section \
60 --filter pandoc_img.py \
61 -N -o tex_out/sv_analysis.tex tex_out/sv_analysis.mdwn
62
63 tex_out/comparison_table.tex : sv/comparison_table.mdwn texmunge.py
64 mkdir -p tex_out
65 pandoc -f markdown -t latex --top-level-division=section \
66 --filter pandoc_img.py \
67 -N -o tex_out/comparison_table_pre.tex sv/comparison_table.mdwn
68 ./texmunge.py tex_out/comparison_table_pre.tex tex_out/comparison_table.tex
69
70 tex_out/vector_isas.tex : sv/vector_isa_comparison.mdwn
71 mkdir -p tex_out
72 pandoc -f markdown -t latex --top-level-division=section \
73 --filter pandoc_img.py \
74 -N -o tex_out/vector_isas.tex sv/vector_isa_comparison.mdwn
75
76 tex_out/big_integer_analysis.tex : sv/biginteger/analysis.mdwn
77 mkdir -p tex_out
78 pandoc -f markdown -t latex --top-level-division=section \
79 --filter pandoc_img.py \
80 -N -o tex_out/big_integer_analysis.tex sv/biginteger/analysis.mdwn
81
82 tex_out/pseudocode_fixedlogical.tex : $(ISA_DIR)/fixedlogical.mdwn
83 mkdir -p tex_out
84 pandoc -f markdown -t latex --top-level-division=section \
85 --filter pandoc_img.py \
86 -N -o tex_out/pseudocode_fixedlogical.tex \
87 $(ISA_DIR)/fixedlogical.mdwn
88
89 tex_out/pseudocode_fixedarith.tex : $(ISA_DIR)/fixedarith.mdwn
90 mkdir -p tex_out
91 pandoc -f markdown -t latex --top-level-division=section \
92 --filter pandoc_img.py \
93 -N -o tex_out/pseudocode_fixedarith.tex \
94 $(ISA_DIR)/fixedarith.mdwn
95
96 tex_out/pseudocode_svfixedarith.tex : $(ISA_DIR)/svfixedarith.mdwn
97 mkdir -p tex_out
98 pandoc -f markdown -t latex --top-level-division=section \
99 --filter pandoc_img.py \
100 -N -o tex_out/pseudocode_svfixedarith.tex \
101 $(ISA_DIR)/svfixedarith.mdwn
102
103 tex_out/pseudocode_svfparith.tex : $(ISA_DIR)/svfparith.mdwn
104 mkdir -p tex_out
105 pandoc -f markdown -t latex --top-level-division=section \
106 --filter pandoc_img.py \
107 -N -o tex_out/pseudocode_svfparith.tex \
108 $(ISA_DIR)/svfparith.mdwn
109
110 tex_out/sv.tex : sv.mdwn
111 mkdir -p tex_out
112 pandoc -f markdown -t latex --top-level-division=section \
113 --filter pandoc_img.py \
114 -N -o tex_out/sv.tex sv.mdwn
115
116 tex_out/overview.tex : sv/overview.mdwn
117 mkdir -p tex_out
118 pandoc -f markdown -t latex --top-level-division=section \
119 --filter pandoc_img.py \
120 -N -o tex_out/overview.tex sv/overview.mdwn
121
122 tex_out/svp64.tex : sv/svp64.mdwn
123 mkdir -p tex_out
124 pandoc -f markdown -t latex --top-level-division=section \
125 --filter pandoc_img.py \
126 -N -o tex_out/svp64.tex sv/svp64.mdwn
127
128 tex_out/compliancy_levels.tex : sv/compliancy_levels.mdwn
129 mkdir -p tex_out
130 pandoc -f markdown -t latex --top-level-division=section \
131 --filter pandoc_img.py \
132 -N -o tex_out/compliancy_levels.tex sv/compliancy_levels.mdwn
133
134 tex_out/svp64_quirks.tex : sv/svp64_quirks.mdwn
135 mkdir -p tex_out
136 pandoc -f markdown -t latex --top-level-division=section \
137 --filter pandoc_img.py \
138 -N -o tex_out/svp64_quirks.tex sv/svp64_quirks.mdwn
139
140 tex_out/sprs.tex : sv/sprs.mdwn
141 mkdir -p tex_out
142 pandoc -f markdown -t latex --top-level-division=section \
143 --filter pandoc_img.py \
144 -N -o tex_out/sprs.tex sv/sprs.mdwn
145
146 tex_out/opcode_regs_deduped.tex : opcode_regs_deduped.mdwn
147 mkdir -p tex_out
148 pandoc -f markdown -t latex --top-level-division=section \
149 --filter pandoc_img.py \
150 -N -o tex_out/opcode_regs_deduped.tex opcode_regs_deduped.mdwn
151
152 tex_out/normal.tex : sv/normal.mdwn
153 mkdir -p tex_out
154 pandoc -f markdown -t latex --top-level-division=section \
155 --filter pandoc_img.py \
156 -N -o tex_out/normal.tex sv/normal.mdwn
157
158 tex_out/ldst.tex : sv/ldst.mdwn
159 mkdir -p tex_out
160 pandoc -f markdown -t latex --top-level-division=section \
161 --filter pandoc_img.py \
162 -N -o tex_out/ldst.tex sv/ldst.mdwn
163
164 tex_out/branches.tex : sv/branches.mdwn
165 mkdir -p tex_out
166 pandoc -f markdown -t latex --top-level-division=section \
167 --filter pandoc_img.py \
168 -N -o tex_out/branches.tex sv/branches.mdwn
169
170 tex_out/cr_ops.tex : sv/cr_ops.mdwn
171 mkdir -p tex_out
172 pandoc -f markdown -t latex --top-level-division=section \
173 --filter pandoc_img.py \
174 -N -o tex_out/cr_ops.tex sv/cr_ops.mdwn
175
176 tex_out/setvl.tex : sv/setvl.mdwn
177 mkdir -p tex_out
178 pandoc -f markdown -t latex --top-level-division=section \
179 --filter pandoc_img.py \
180 -N -o tex_out/setvl.tex sv/setvl.mdwn
181
182 tex_out/svstep.tex : sv/svstep.mdwn
183 mkdir -p tex_out
184 pandoc -f markdown -t latex --top-level-division=section \
185 --filter pandoc_img.py \
186 -N -o tex_out/svstep.tex sv/svstep.mdwn
187
188 tex_out/mv_swizzle.tex : sv/mv.swizzle.mdwn
189 mkdir -p tex_out
190 pandoc -f markdown -t latex --top-level-division=section \
191 --filter pandoc_img.py \
192 -N -o tex_out/mv_swizzle.tex sv/mv.swizzle.mdwn
193
194 tex_out/fields.tex : sv/fields.mdwn mdwn_inline.py \
195 ../../openpower-isa/openpower/isatables/fields.text
196 mkdir -p tex_out
197 ./mdwn_inline.py sv/fields.mdwn tex_out/fields.mdwn
198 pandoc -f markdown -t latex --top-level-division=section \
199 --filter pandoc_img.py \
200 -N -o tex_out/fields.tex tex_out/fields.mdwn
201 sed -i 's/\\section{/\\section*{/g' tex_out/fields.tex
202
203 tex_out/mv_vec.tex : sv/mv.vec.mdwn
204 mkdir -p tex_out
205 pandoc -f markdown -t latex --top-level-division=section \
206 --filter pandoc_img.py \
207 -N -o tex_out/mv_vec.tex sv/mv.vec.mdwn
208
209 tex_out/pseudocode_simplev.tex : $(ISA_DIR)/simplev.mdwn
210 mkdir -p tex_out
211 pandoc -f markdown -t latex --top-level-division=section \
212 --filter pandoc_img.py \
213 -N -o tex_out/pseudocode_simplev.tex \
214 $(ISA_DIR)/simplev.mdwn
215
216 tex_out/pseudocode_bitmanip.tex : $(ISA_DIR)/bitmanip.mdwn
217 mkdir -p tex_out
218 pandoc -f markdown -t latex --top-level-division=section \
219 --filter pandoc_img.py \
220 -N -o tex_out/pseudocode_bitmanip.tex \
221 $(ISA_DIR)/bitmanip.mdwn
222
223 tex_out/cr_int_predication.tex : sv/cr_int_predication.mdwn
224 mkdir -p tex_out
225 pandoc -f markdown -t latex --top-level-division=section \
226 --filter pandoc_img.py \
227 -N -o tex_out/cr_int_predication.tex sv/cr_int_predication.mdwn
228
229 tex_out/fcvt.tex : sv/fcvt.mdwn
230 mkdir -p tex_out
231 pandoc -f markdown -t latex --top-level-division=section \
232 --filter pandoc_img.py \
233 -N -o tex_out/fcvt.tex sv/fcvt.mdwn
234
235 tex_out/fclass.tex : sv/fclass.mdwn
236 mkdir -p tex_out
237 pandoc -f markdown -t latex --top-level-division=section \
238 --filter pandoc_img.py \
239 -N -o tex_out/fclass.tex sv/fclass.mdwn
240
241 tex_out/int_fp_mv.tex : sv/int_fp_mv.mdwn
242 mkdir -p tex_out
243 pandoc -f markdown -t latex --top-level-division=section \
244 --filter pandoc_img.py \
245 -N -o tex_out/int_fp_mv.tex sv/int_fp_mv.mdwn
246
247 tex_out/av_opcodes.tex : sv/av_opcodes.mdwn
248 mkdir -p tex_out
249 pandoc -f markdown -t latex --top-level-division=section \
250 --filter pandoc_img.py \
251 -N -o tex_out/av_opcodes.tex sv/av_opcodes.mdwn
252
253 tex_out/big_integer.tex : sv/biginteger.mdwn
254 mkdir -p tex_out
255 pandoc -f markdown -t latex --top-level-division=section \
256 --filter pandoc_img.py \
257 -N -o tex_out/big_integer.tex sv/biginteger.mdwn
258
259 tex_out/pseudocode_fixedshift.tex : $(ISA_DIR)/fixedshift.mdwn
260 mkdir -p tex_out
261 pandoc -f markdown -t latex --top-level-division=section \
262 --filter pandoc_img.py \
263 -N -o tex_out/pseudocode_fixedshift.tex \
264 $(ISA_DIR)/fixedshift.mdwn
265
266 tex_out/atomics.tex: atomics.mdwn mdwn_inline.py \
267 ../../openpower-isa/src/openpower/sv/sv_analysis.py
268 mkdir -p tex_out
269 ./mdwn_inline.py atomics.mdwn tex_out/atomics.mdwn
270 pandoc -f markdown -t latex --top-level-division=section \
271 --filter pandoc_img.py \
272 -N -o tex_out/atomics.tex tex_out/atomics.mdwn
273
274 tex_out/transcendentals.tex: transcendentals.mdwn power_trans_ops.mdwn \
275 mdwn_inline.py
276 mkdir -p tex_out
277 ./mdwn_inline.py transcendentals.mdwn tex_out/transcendentals.mdwn
278 pandoc -f markdown -t latex --top-level-division=section \
279 --filter pandoc_img.py \
280 -N -o tex_out/transcendentals.tex tex_out/transcendentals.mdwn
281
282 tex_out/executive_summary.tex: sv/executive_summary.mdwn mdwn_inline.py
283 mkdir -p tex_out
284 ./mdwn_inline.py sv/executive_summary.mdwn tex_out/executive_summary.mdwn
285 pandoc -f markdown -t latex --top-level-division=section \
286 --filter pandoc_img.py \
287 -N -o tex_out/executive_summary.tex tex_out/executive_summary.mdwn
288
289 tex_out/svp64_appendix.tex: sv/svp64/appendix.mdwn mdwn_inline.py \
290 sv/preduce.py
291 mkdir -p tex_out
292 ./mdwn_inline.py sv/svp64/appendix.mdwn tex_out/appendix.mdwn
293 pandoc -f markdown -t latex --top-level-division=section \
294 --filter pandoc_img.py \
295 -N -o tex_out/svp64_appendix.tex tex_out/appendix.mdwn
296
297 tex_out/vector_ops.tex: sv/vector_ops.mdwn mdwn_inline.py sv/bmask.py
298 mkdir -p tex_out
299 ./mdwn_inline.py sv/vector_ops.mdwn tex_out/vector_ops.mdwn
300 pandoc -f markdown -t latex --top-level-division=section \
301 --filter pandoc_img.py \
302 -N -o tex_out/vector_ops.tex tex_out/vector_ops.mdwn
303
304 tex_out/remap_appendix.tex: sv/remap/appendix.mdwn mdwn_inline.py sv/remap.py \
305 sv/remapyield.py sv/remap_fft_yield.py
306 mkdir -p tex_out
307 ./mdwn_inline.py sv/remap/appendix.mdwn tex_out/remap_appendix.mdwn
308 pandoc -f markdown -t latex --top-level-division=section \
309 --filter pandoc_img.py \
310 -N -o tex_out/remap_appendix.tex tex_out/remap_appendix.mdwn
311
312 tex_out/remap.tex: sv/remap.mdwn mdwn_inline.py
313 mkdir -p tex_out
314 ./mdwn_inline.py sv/remap.mdwn tex_out/remap.mdwn
315 pandoc -f markdown -t latex --top-level-division=section \
316 --filter pandoc_img.py \
317 -N -o tex_out/remap.tex tex_out/remap.mdwn
318
319 tex_out/bitmanip.tex: sv/bitmanip.mdwn pandoc_img.py mdwn_inline.py \
320 sv/draft_opcode_tables.mdwn \
321 ../../nmigen-gf/gf_reference/pack_poly.py \
322 ../../nmigen-gf/gf_reference/clmul.py \
323 ../../nmigen-gf/gf_reference/clmulh.py \
324 ../../nmigen-gf/gf_reference/clmulr.py \
325 ../../nmigen-gf/gf_reference/cldivrem.py \
326 ../../nmigen-gf/gf_reference/decode_reducing_polynomial.py \
327 ../../nmigen-gf/gf_reference/gfbredpoly.py \
328 ../../nmigen-gf/gf_reference/gfbmul.py \
329 ../../nmigen-gf/gf_reference/gfbmadd.py \
330 ../../nmigen-gf/gf_reference/gfbinv.py \
331 ../../nmigen-gf/gf_reference/gfpadd.py \
332 ../../nmigen-gf/gf_reference/gfpsub.py \
333 ../../nmigen-gf/gf_reference/gfpmul.py \
334 ../../nmigen-gf/gf_reference/gfpinv.py \
335 ../../nmigen-gf/gf_reference/gfpmadd.py \
336 ../../nmigen-gf/gf_reference/gfpmsub.py \
337 ../../nmigen-gf/gf_reference/gfpmsubr.py
338 mkdir -p tex_out
339 ./mdwn_inline.py sv/bitmanip.mdwn tex_out/bitmanip.mdwn
340 pandoc -f markdown -t latex --top-level-division=section \
341 --filter pandoc_img.py \
342 -N -o tex_out/bitmanip.tex tex_out/bitmanip.mdwn
343
344 tex_out/pseudocode_bcd.tex : $(ISA_DIR)/bcd.mdwn
345 mkdir -p tex_out
346 pandoc -f markdown -t latex --top-level-division=section \
347 --filter pandoc_img.py \
348 -N -o tex_out/pseudocode_bcd.tex \
349 $(ISA_DIR)/bcd.mdwn
350
351 tex_out/pseudocode_branch.tex : $(ISA_DIR)/branch.mdwn
352 mkdir -p tex_out
353 pandoc -f markdown -t latex --top-level-division=section \
354 --filter pandoc_img.py \
355 -N -o tex_out/pseudocode_branch.tex \
356 $(ISA_DIR)/branch.mdwn
357
358 tex_out/pseudocode_comparefixed.tex : $(ISA_DIR)/comparefixed.mdwn
359 mkdir -p tex_out
360 pandoc -f markdown -t latex --top-level-division=section \
361 --filter pandoc_img.py \
362 -N -o tex_out/pseudocode_comparefixed.tex \
363 $(ISA_DIR)/comparefixed.mdwn
364
365 tex_out/pseudocode_condition.tex : $(ISA_DIR)/condition.mdwn
366 mkdir -p tex_out
367 pandoc -f markdown -t latex --top-level-division=section \
368 --filter pandoc_img.py \
369 -N -o tex_out/pseudocode_condition.tex \
370 $(ISA_DIR)/condition.mdwn
371
372 tex_out/pseudocode_fixedload.tex : $(ISA_DIR)/fixedload.mdwn
373 mkdir -p tex_out
374 pandoc -f markdown -t latex --top-level-division=section \
375 --filter pandoc_img.py \
376 -N -o tex_out/pseudocode_fixedload.tex \
377 $(ISA_DIR)/fixedload.mdwn
378
379 tex_out/pseudocode_fixedstore.tex : $(ISA_DIR)/fixedstore.mdwn
380 mkdir -p tex_out
381 pandoc -f markdown -t latex --top-level-division=section \
382 --filter pandoc_img.py \
383 -N -o tex_out/pseudocode_fixedstore.tex \
384 $(ISA_DIR)/fixedstore.mdwn
385
386 tex_out/pseudocode_fixedtrap.tex : $(ISA_DIR)/fixedtrap.mdwn
387 mkdir -p tex_out
388 pandoc -f markdown -t latex --top-level-division=section \
389 --filter pandoc_img.py \
390 -N -o tex_out/pseudocode_fixedtrap.tex \
391 $(ISA_DIR)/fixedtrap.mdwn
392
393 tex_out/pseudocode_sprset.tex : $(ISA_DIR)/sprset.mdwn
394 mkdir -p tex_out
395 pandoc -f markdown -t latex --top-level-division=section \
396 --filter pandoc_img.py \
397 -N -o tex_out/pseudocode_sprset.tex \
398 $(ISA_DIR)/sprset.mdwn
399
400 tex_out/pseudocode_stringldst.tex : $(ISA_DIR)/stringldst.mdwn
401 mkdir -p tex_out
402 pandoc -f markdown -t latex --top-level-division=section \
403 --filter pandoc_img.py \
404 -N -o tex_out/pseudocode_stringldst.tex \
405 $(ISA_DIR)/stringldst.mdwn
406
407 tex_out/pseudocode_system.tex : $(ISA_DIR)/system.mdwn
408 mkdir -p tex_out
409 pandoc -f markdown -t latex --top-level-division=section \
410 --filter pandoc_img.py \
411 -N -o tex_out/pseudocode_system.tex \
412 $(ISA_DIR)/system.mdwn
413
414 tex_out/pseudocode_fpload.tex : $(ISA_DIR)/fpload.mdwn
415 mkdir -p tex_out
416 pandoc -f markdown -t latex --top-level-division=section \
417 --filter pandoc_img.py \
418 -N -o tex_out/pseudocode_fpload.tex \
419 $(ISA_DIR)/fpload.mdwn
420
421 tex_out/pseudocode_fpstore.tex : $(ISA_DIR)/fpstore.mdwn
422 mkdir -p tex_out
423 pandoc -f markdown -t latex --top-level-division=section \
424 --filter pandoc_img.py \
425 -N -o tex_out/pseudocode_fpstore.tex \
426 $(ISA_DIR)/fpstore.mdwn
427
428 tex_out/pseudocode_fpmove.tex : $(ISA_DIR)/fpmove.mdwn
429 mkdir -p tex_out
430 pandoc -f markdown -t latex --top-level-division=section \
431 --filter pandoc_img.py \
432 -N -o tex_out/pseudocode_fpmove.tex \
433 $(ISA_DIR)/fpmove.mdwn
434
435 tex_out/pseudocode_fparith.tex : $(ISA_DIR)/fparith.mdwn
436 mkdir -p tex_out
437 pandoc -f markdown -t latex --top-level-division=section \
438 --filter pandoc_img.py \
439 -N -o tex_out/pseudocode_fparith.tex \
440 $(ISA_DIR)/fparith.mdwn
441
442 tex_out/pseudocode_fpcvt.tex : $(ISA_DIR)/fpcvt.mdwn
443 mkdir -p tex_out
444 pandoc -f markdown -t latex --top-level-division=section \
445 --filter pandoc_img.py \
446 -N -o tex_out/pseudocode_fpcvt.tex \
447 $(ISA_DIR)/fpcvt.mdwn
448
449 simple_v_spec.pdf : $(SOURCE_TEX) simple_v_spec.tex
450 # clean up old files to make it more reproducable
451 rm -vfr simple_v_spec.aux simple_v_spec.log simple_v_spec.pdf \
452 simple_v_spec.out simple_v_spec.toc simple_v_spec.bbl \
453 simple_v_spec.blg simple_v_spec.synctex.gz \
454 svp64-primer/summary.aux
455 # run pdflatex twice because the first run creates files needed to
456 # properly create the PDF outline by the second run
457 pdflatex -synctex=1 -interaction=nonstopmode simple_v_spec.tex
458 pdflatex -synctex=1 -interaction=nonstopmode simple_v_spec.tex
459 bibtex simple_v_spec.aux
460
461 upload : pdf
462 rsync -HPavz simple_v_spec.pdf libre-soc.org:
463 ssh libre-soc.org 'cp simple_v_spec.pdf /var/www/ftp.libre-riscv.org'
464
465 clean:
466 rm -fr tex_out simple_v_spec.aux simple_v_spec.log simple_v_spec.pdf \
467 simple_v_spec.out simple_v_spec.toc simple_v_spec.bbl \
468 simple_v_spec.blg simple_v_spec.synctex.gz \
469 svp64-primer/summary.aux