#! /bin/bash RISCV_OPC_FILE=$1 RISCV_FEATURE_DIR=$2 function gen_csr_xml () { bitsize=$1 cat < EOF grep "^DECLARE_CSR(" ${RISCV_OPC_FILE} \ | sed -e "s!DECLARE_CSR(\(.*\), .*! !" echo "" } gen_csr_xml 32 > ${RISCV_FEATURE_DIR}/32bit-csr.xml gen_csr_xml 64 > ${RISCV_FEATURE_DIR}/64bit-csr.xml