blob: 6354ecc5435e11e2431179d7dee04f923ca84305 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
SHELL := /bin/sh
ISASIM_H := ../riscv-isa-sim/riscv/encoding.h
PK_H := ../riscv-pk/machine/encoding.h
ENV_H := ../riscv-tests/env/encoding.h
OPENOCD_H := ../riscv-openocd/src/target/riscv/encoding.h
INSTALL_HEADER_FILES := $(ISASIM_H) $(PK_H) $(ENV_H) $(OPENOCD_H)
ALL_REAL_ILEN32_OPCODES := opcodes-rv32i opcodes-rv64i opcodes-rv32m opcodes-rv64m opcodes-rv32a opcodes-rv64a opcodes-rv32h opcodes-rv64h opcodes-rv32f opcodes-rv64f opcodes-rv32d opcodes-rv64d opcodes-rv32q opcodes-rv64q opcodes-rv32xbitmanip opcodes-rv64xbitmanip opcodes-system opcodes-svinval opcodes-rv32zfh opcodes-rv32d-zfh opcodes-rv32q-zfh opcodes-rv64zfh opcodes-rvzk opcodes-rv32zk opcodes-rv64zk opcodes-zicbo opcodes-rv32zba opcodes-rv32zbb opcodes-rv32zbc opcodes-rv32zbkb opcodes-rv32zbkx opcodes-rv32zbs opcodes-rv64zba opcodes-rv64zbb opcodes-rv64zbkb
ALL_REAL_OPCODES := $(ALL_REAL_ILEN32_OPCODES) opcodes-rvc opcodes-rv32c opcodes-rv64c opcodes-custom opcodes-rvv opcodes-rvp
ALL_OPCODES := opcodes-pseudo $(ALL_REAL_OPCODES) opcodes-rvv-pseudo
install: encoding.out.h inst.chisel instr-table.tex priv-instr-table.tex
set -e; for FILE in $(INSTALL_HEADER_FILES); do cp -f encoding.out.h $$FILE; done
encoding.out.h: $(ALL_OPCODES) parse_opcodes encoding.h
echo "/*" > $@
echo " * This file is auto-generated by running 'make' in" >> $@
echo " * https://github.com/riscv/riscv-opcodes (`git log -1 --format="format:%h"`)" >> $@
echo " */" >> $@
echo >> $@
cat encoding.h >> $@
cat $(ALL_OPCODES) | ./parse_opcodes -c >> $@
inst.chisel: $(ALL_OPCODES) parse_opcodes
cat $(ALL_OPCODES) | ./parse_opcodes -chisel > $@
inst.go: $(ALL_REAL_ILEN32_OPCODES) parse_opcodes
cat $(ALL_REAL_ILEN32_OPCODES) | ./parse_opcodes -go > $@
inst.rs: $(ALL_OPCODES) parse_opcodes
cat $(ALL_OPCODES) | ./parse_opcodes -rust > $@
inst.sverilog: $(ALL_OPCODES) parse_opcodes
cat $(ALL_OPCODES) | ./parse_opcodes -sverilog > $@
instr-table.tex: $(ALL_OPCODES) parse_opcodes
cat $(ALL_OPCODES) | ./parse_opcodes -tex > $@
priv-instr-table.tex: $(ALL_OPCODES) parse_opcodes
cat $(ALL_OPCODES) | ./parse_opcodes -privtex > $@
.PHONY : install
|