Skip to content

Commit

Permalink
RISC-V: Various small fixes to the SAIL preamble in the ISA reference
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
bsdjhb committed Aug 7, 2023
1 parent 5a36f2f commit 1945614
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions chap-isaref-riscv.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 1945614

Please sign in to comment.