|
10 | 10 | from typing import Optional |
11 | 11 |
|
12 | 12 |
|
13 | | -from otfi import OTFI |
| 13 | +from target.communication.otfi import OTFI |
| 14 | +from target.communication.otfi_test import OTFITest |
14 | 15 |
|
15 | 16 |
|
16 | 17 | 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 | + |
17 | 27 | def __init__(self, target) -> None: |
18 | 28 | super().__init__(target, "Otbn") |
19 | 29 |
|
20 | 30 | def init(self, test: Optional[str] = "") -> None: |
21 | 31 | self.init_keymgr(test) |
22 | 32 | super().init(test) |
23 | 33 |
|
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 | | - |
78 | 34 | def init_keymgr(self, test: str) -> None: |
79 | 35 | """ Initialize the key manager on the chip. |
80 | 36 | Args: |
|
0 commit comments