Skip to content

Commit

Permalink
[otbn] rename OTBN objdump Python script
Browse files Browse the repository at this point in the history
In order to be bazelified, which is required in order to build the mask
ROM with bazel, all Python scripts must end in a ".py" extension.

Signed-off-by: Timothy Trippel <ttrippel@google.com>
  • Loading branch information
timothytrippel authored and mcy committed Apr 21, 2022
1 parent efe736b commit 248f893
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions doc/ug/otbn_sw.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ hw/ip/otbn/util/otbn_ld.py -o foo foo0.o foo1.o foo2.o

### Objdump

To disassemble OTBN code, use `otbn-objdump`, which can be found at `hw/ip/otbn/util/otbn-objdump`.
To disassemble OTBN code, use `otbn_objdump.py`, which can be found at `hw/ip/otbn/util/otbn_objdump.py`.
This wraps `riscv32-unknown-elf-objdump`, but correctly disassembles OTBN instructions when run with the `-d` flag.

To disassemble the ELF binary linked in the previous section, run
```shell
hw/ip/otbn/util/otbn-objdump -d foo
hw/ip/otbn/util/otbn_objdump.py -d foo
```
2 changes: 1 addition & 1 deletion hw/ip/otbn/doc/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ The toolchain wraps a RV32 GCC toolchain and supports many of its features.
The following tools are available:
* `otbn_as.py`: The OTBN assembler.
* `otbn_ld.py`: The OTBN linker.
* `otbn-objdump`: objdump for OTBN.
* `otbn_objdump.py`: objdump for OTBN.

Other tools from the RV32 toolchain can be used directly, such as objcopy.

Expand Down
2 changes: 1 addition & 1 deletion hw/ip/otbn/util/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $(build-dir) $(lint-build-dir):
mkdir -p $@

pylibs := $(wildcard shared/*.py docs/*.py)
pyscripts := yaml_to_doc.py otbn_as.py otbn_ld.py otbn-objdump
pyscripts := yaml_to_doc.py otbn_as.py otbn_ld.py otbn_objdump.py

lint-stamps := $(foreach s,$(pyscripts),$(lint-build-dir)/$(s).stamp)
$(lint-build-dir)/%.stamp: % $(pylibs) | $(lint-build-dir)
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions hw/ip/otbn/util/shared/operand.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class OperandType:
- Encoded value
The string representation is the string that you expect to see in an
assembly listing (either fed into otbn_as.py, or generated by otbn-objdump).
The encoded value is the non-negative integer value that is encoded in the
bits of the instruction.
assembly listing (either fed into otbn_as.py, or generated by
otbn_objdump.py). The encoded value is the non-negative integer value that
is encoded in the bits of the instruction.
The operand value is the notional value of the operand. This might be a
signed value (represented 2's complement in the encoded value). It might be
Expand Down

0 comments on commit 248f893

Please sign in to comment.