Skip to content

Commit fcde245

Browse files
committed
[fi] OTFIOtbn: Use OTFITest
1 parent 2c98c7d commit fcde245

File tree

1 file changed

+11
-55
lines changed

1 file changed

+11
-55
lines changed

target/communication/fi_otbn_commands.py

Lines changed: 11 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,71 +10,27 @@
1010
from typing import Optional
1111

1212

13-
from otfi import OTFI
13+
from target.communication.otfi import OTFI
14+
from target.communication.otfi_test import OTFITest
1415

1516

1617
class OTFIOtbn(OTFI):
18+
TESTS = [
19+
OTFITest("char_unrolled_reg_op_loop"),
20+
OTFITest("char_unrolled_dmem_op_loop"),
21+
OTFITest("char_hardware_reg_op_loop"),
22+
OTFITest("char_hardware_dmem_op_loop"),
23+
OTFITest("key_sideload"),
24+
OTFITest("load_integrity"),
25+
]
26+
1727
def __init__(self, target) -> None:
1828
super().__init__(target, "Otbn")
1929

2030
def init(self, test: Optional[str] = "") -> None:
2131
self.init_keymgr(test)
2232
super().init(test)
2333

24-
def otbn_char_unrolled_reg_op_loop(self) -> None:
25-
""" Starts the otbn.fi.char.unrolled.reg.op.loop test.
26-
"""
27-
# OtbnFi command.
28-
self._ujson_fi_cmd()
29-
# CharUnrolledRegOpLoop command.
30-
time.sleep(0.01)
31-
self.target.write(json.dumps("CharUnrolledRegOpLoop").encode("ascii"))
32-
33-
def otbn_char_unrolled_dmem_op_loop(self) -> None:
34-
""" Starts the otbn.fi.char.unrolled.dmem.op.loop test.
35-
"""
36-
# OtbnFi command.
37-
self._ujson_fi_cmd()
38-
# CharUnrolledDmemOpLoop command.
39-
time.sleep(0.01)
40-
self.target.write(json.dumps("CharUnrolledDmemOpLoop").encode("ascii"))
41-
42-
def otbn_char_hardware_reg_op_loop(self) -> None:
43-
""" Starts the otbn.fi.char.hardware.reg.op.loop test.
44-
"""
45-
# OtbnFi command.
46-
self._ujson_fi_cmd()
47-
# CharHardwareRegOpLoop command.
48-
time.sleep(0.01)
49-
self.target.write(json.dumps("CharHardwareRegOpLoop").encode("ascii"))
50-
51-
def otbn_char_hardware_dmem_op_loop(self) -> None:
52-
""" Starts the otbn.fi.char.hardware.dmem.op.loop test.
53-
"""
54-
# OtbnFi command.
55-
self._ujson_fi_cmd()
56-
# CharMemOpLoop command.
57-
time.sleep(0.01)
58-
self.target.write(json.dumps("CharHardwareDmemOpLoop").encode("ascii"))
59-
60-
def otbn_key_sideload(self) -> None:
61-
""" Starts the otbn.fi.key_sideload test.
62-
"""
63-
# OtbnFi command.
64-
self._ujson_fi_cmd()
65-
# KeySideload command.
66-
time.sleep(0.01)
67-
self.target.write(json.dumps("KeySideload").encode("ascii"))
68-
69-
def otbn_load_integrity(self) -> None:
70-
""" Starts the otbn.fi.load_integrity test.
71-
"""
72-
# OtbnFi command.
73-
self._ujson_fi_cmd()
74-
# LoadIntegrity command.
75-
time.sleep(0.01)
76-
self.target.write(json.dumps("LoadIntegrity").encode("ascii"))
77-
7834
def init_keymgr(self, test: str) -> None:
7935
""" Initialize the key manager on the chip.
8036
Args:

0 commit comments

Comments
 (0)