aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2022-05-02 14:20:35 -0700
committerAndrew Waterman <andrew@sifive.com>2022-05-02 14:20:35 -0700
commit36f37737b8241fca0e3a5a1d18555cb1d406cff8 (patch)
tree11f8479f434fee1da06be155edeff0528c7026b7 /Makefile
parent71ecf3563997ea9e7e15a3295aecfe773ad9c04e (diff)
parentbc92b799d9e96b53a0e57e738bff8f12e6e1fc2d (diff)
downloadriscv-opcodes-36f37737b8241fca0e3a5a1d18555cb1d406cff8.zip
riscv-opcodes-36f37737b8241fca0e3a5a1d18555cb1d406cff8.tar.gz
riscv-opcodes-36f37737b8241fca0e3a5a1d18555cb1d406cff8.tar.bz2
Merge branch 'migration-to-new-format' of https://github.com/incoresemi/riscv-opcodes into incoresemi-migration-to-new-formatincoresemi-migration-to-new-format
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile68
1 files changed, 39 insertions, 29 deletions
diff --git a/Makefile b/Makefile
index 723be38..b512dda 100644
--- a/Makefile
+++ b/Makefile
@@ -1,47 +1,57 @@
-SHELL := /bin/sh
-
+EXTENSIONS := "rv*" "unratified/rv*"
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
+default: everything
-install: encoding.out.h inst.chisel inst.spinalhdl instr-table.tex priv-instr-table.tex
+install: everything
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 >> $@
+.PHONY : everything
+everything:
+ @./parse.py -c -go -chisel -sverilog -rust -latex -spinalhdl $(EXTENSIONS)
-inst.chisel: $(ALL_OPCODES) parse_opcodes
- cat $(ALL_OPCODES) | ./parse_opcodes -chisel > $@
+.PHONY : encoding.out.h
+encoding.out.h:
+ @./parse.py -c $(EXTENSIONS)
-inst.spinalhdl: $(ALL_OPCODES) parse_opcodes
- cat $(ALL_OPCODES) | ./parse_opcodes -spinalhdl > $@
+.PHONY : inst.chisel
+inst.chisel:
+ @./parse.py -chisel $(EXTENSIONS)
-inst.go: $(ALL_REAL_ILEN32_OPCODES) parse_opcodes
- cat $(ALL_REAL_ILEN32_OPCODES) | ./parse_opcodes -go > $@
+.PHONY : inst.go
+inst.go:
+ @./parse.py -go $(EXTENSIONS)
-inst.rs: $(ALL_OPCODES) parse_opcodes
- cat $(ALL_OPCODES) | ./parse_opcodes -rust > $@
+.PHONY : latex
+latex:
+ @./parse.py -latex $(EXTENSIONS)
-inst.sverilog: $(ALL_OPCODES) parse_opcodes
- cat $(ALL_OPCODES) | ./parse_opcodes -sverilog > $@
+.PHONY : inst.sverilog
+inst.sverilog:
+ @./parse.py -sverilog $(EXTENSIONS)
-instr-table.tex: $(ALL_OPCODES) parse_opcodes
- cat $(ALL_OPCODES) | ./parse_opcodes -tex > $@
+.PHONY : inst.rs
+inst.rs:
+ @./parse.py -rust $(EXTENSIONS)
-priv-instr-table.tex: $(ALL_OPCODES) parse_opcodes
- cat $(ALL_OPCODES) | ./parse_opcodes -privtex > $@
+.PHONY : clean
+clean:
+ rm -f inst* priv-instr-table.tex encoding.out.h
.PHONY : install
+install: c
+ set -e; for FILE in $(INSTALL_HEADER_FILES); do cp -f encoding.out.h $$FILE; done
+
+.PHONY: instr-table.tex
+instr-table.tex: latex
+
+.PHONY: priv-instr-table.tex
+priv-instr-table.tex: latex
+
+.PHONY: inst.spinalhdl
+inst.spinalhdl:
+ @./parse.py -spinalhdl $(EXTENSIONS)