[otbn,doc] Get rid of "trailing-doc"
This was only used by JAL and JALR and the docs are equally
understandable if the text doesn't "trail". Get rid of the key and
simplify things a bit.
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/hw/ip/otbn/data/base-insns.yml b/hw/ip/otbn/data/base-insns.yml
index ad00d5c..2e101db 100644
--- a/hw/ip/otbn/data/base-insns.yml
+++ b/hw/ip/otbn/data/base-insns.yml
@@ -331,8 +331,9 @@
- grd
- *branch-offset-operand
straight-line: false
- trailing-doc: |
+ doc: |
The JAL instruction has the same behavior as in RV32I, jumping by the given offset and writing `PC+4` as a link address to the destination register.
+
OTBN has a hardware managed call stack, accessed through `x1`, which should be used when calling subroutines.
Do so by using `x1` as the link register: `jal x1, <offset>`.
encoding:
@@ -347,8 +348,9 @@
synopsis: Jump And Link Register
operands: [grd, grs1, offset]
straight-line: false
- trailing-doc: |
+ doc: |
The JALR instruction has the same behavior as in RV32I, jumping by `<grs1> + <offset>` and writing `PC+4` as a link address to the destination register.
+
OTBN has a hardware managed call stack, accessed through `x1`, which should be used when calling and returning from subroutines.
To return from a subroutine, use `jalr x0, x1, 0`.
This pops a link address from the call stack and branches to it.
diff --git a/hw/ip/otbn/data/insns.yml b/hw/ip/otbn/data/insns.yml
index 2d5d3d4..ac10931 100644
--- a/hw/ip/otbn/data/insns.yml
+++ b/hw/ip/otbn/data/insns.yml
@@ -56,11 +56,6 @@
# immediately after the mnemonic (with no space). Optional,
# defaults to false.
#
-# trailing-doc: Documentation that should appear after the syntax example but
-# before the operand table. Useful for things like alternative
-# assembly syntax, or deviations from the usual meaning of the
-# instruction. (optional)
-#
# literal-pseudo-op: This instruction is a pseudo-operation that expands into
# a list of underlying RISC-V operations, given as a list.
# Optional. Can't be specified with encoding or
diff --git a/hw/ip/otbn/util/shared/insn_yaml.py b/hw/ip/otbn/util/shared/insn_yaml.py
index a846ec9..fbe19d7 100644
--- a/hw/ip/otbn/util/shared/insn_yaml.py
+++ b/hw/ip/otbn/util/shared/insn_yaml.py
@@ -26,7 +26,7 @@
yd = check_keys(yml, 'instruction',
['mnemonic', 'operands'],
['group', 'rv32i', 'synopsis',
- 'syntax', 'doc', 'note', 'trailing-doc',
+ 'syntax', 'doc', 'note',
'encoding', 'glued-ops',
'literal-pseudo-op', 'python-pseudo-op', 'lsu',
'straight-line'])
@@ -85,7 +85,6 @@
self.synopsis = get_optional_str(yd, 'synopsis', what)
self.doc = get_optional_str(yd, 'doc', what)
self.note = get_optional_str(yd, 'note', what)
- self.trailing_doc = get_optional_str(yd, 'trailing-doc', what)
raw_syntax = get_optional_str(yd, 'syntax', what)
if raw_syntax is not None:
diff --git a/hw/ip/otbn/util/yaml_to_doc.py b/hw/ip/otbn/util/yaml_to_doc.py
index 613305d..e7ffa9a 100755
--- a/hw/ip/otbn/util/yaml_to_doc.py
+++ b/hw/ip/otbn/util/yaml_to_doc.py
@@ -275,13 +275,6 @@
if insn.rv32i:
parts.append('This instruction is defined in the RV32I instruction set.\n\n')
- # Show any trailing documentation (stuff that should come after the syntax
- # example but before the operand table).
- if insn.trailing_doc is not None:
- parts.append('\n')
- parts.append(insn.trailing_doc)
- parts.append('\n\n')
-
is_pseudo = insn.literal_pseudo_op or insn.python_pseudo_op
# If we have an encoding, match up encoding fields with operands