From 19456142940a8dc0e663cc2bdd836c2ea483b176 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 4 Aug 2023 15:54:16 -0700 Subject: [PATCH] RISC-V: Various small fixes to the SAIL preamble in the ISA reference - Add reserved_otypes constant to make cap_max_otype clearer. - Add MAX and caps_per_cache_line to fix some undefined references. - Add spacing and indentation for C(), X(), and F() to be more consistent with other definitions in the preamble. --- chap-isaref-riscv.tex | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/chap-isaref-riscv.tex b/chap-isaref-riscv.tex index 5fa2297d..2d08aa7b 100644 --- a/chap-isaref-riscv.tex +++ b/chap-isaref-riscv.tex @@ -61,8 +61,12 @@ \section{Constant Definitions} \sailRISCVtypecapOtypeWidth{} \phantomsection\label{sailRISCVzcapzymaxzyotype} +\sailRISCVletreservedOtypes{} \sailRISCVletcapMaxOtype{} +\phantomsection\label{sailRISCVzcapszyperzycachezyline} +\sailRISCVtypecapsPerCacheLine{} + \section{Function Definitions} This section contains descriptions of convenience functions used by the Sail code featured in this chapter. @@ -80,6 +84,7 @@ \subsection*{Functions for integer and bit vector manipulation} \sailRISCVval{bool\_to\_bits} \sailRISCVval{truncate} \sailRISCVval{pow2} +\sailRISCVval{MAX} % The following are overloads so we can't easily use the generated latex % Hacky hspace to get rid of unwanted hangindent @@ -117,32 +122,37 @@ \subsection*{Types used in function definitions} \sailRISCVval{capBitsToCapability} \sailRISCVval{capToBits} -\subsection*{Functions for reading and writing register and memory} +\subsection*{Functions for reading and writing registers and memory} -\arnote{TODO: document X() and C()} %\label{sailRISCVzC} \begin{lstlisting}[language=sail,label=sailRISCVzC] C(n) : regno -> Capability C(n) : (regno, Capability) -> unit \end{lstlisting} +\hspace{\parindent} The overloaded function \isail{C(n)} is used to read or write capability register \isail{n}. +\medskip \begin{lstlisting}[language=sail,label=sailRISCVzX] X(n) : regno -> xlenbits X(n) : (regno, xlenbits) -> unit \end{lstlisting} +\hspace{\parindent} The overloaded function \isail{X(n)} is used to read or write integer register \isail{n}. +\medskip \begin{lstlisting}[language=sail,label=sailRISCVzF] F(n) : regno -> xlenbits F(n) : (regno, xlenbits) -> unit \end{lstlisting} +\hspace{\parindent} The overloaded function \isail{F(n)} is used to read or write floating-point register \isail{n}. \medskip \sailRISCVval{memBitsToCapability} \sailRISCVval{capToMemBits} \sailRISCVval{int\_to\_cap} +\sailRISCVval{mem\_read\_cap} \medskip \sailRISCVval{get\_cheri\_mode\_cap\_addr}