oep-client-python 0.0.6__tar.gz → 0.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/CHANGELOG.md +6 -0
  2. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/PKG-INFO +1 -1
  3. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/pyproject.toml +1 -1
  4. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/__init__.py +1 -1
  5. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/capture.py +7 -5
  6. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/interfaces.py +3 -4
  7. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/registry.py +2 -2
  8. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_capture.py +13 -0
  9. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/.gitignore +0 -0
  10. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/LICENSE +0 -0
  11. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/README.ja.md +0 -0
  12. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/README.md +0 -0
  13. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/__main__.py +0 -0
  14. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/arm.py +0 -0
  15. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/catalog.py +0 -0
  16. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/ch32_flash.py +0 -0
  17. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/cobs.py +0 -0
  18. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/config.py +0 -0
  19. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/console.py +0 -0
  20. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/core.py +0 -0
  21. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/decode.py +0 -0
  22. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/dump.py +0 -0
  23. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/endpoint.py +0 -0
  24. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/esp32_targets.py +0 -0
  25. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/fake.py +0 -0
  26. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/fake_serial.py +0 -0
  27. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/fake_serve.py +0 -0
  28. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/fixture.py +0 -0
  29. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/frames.py +0 -0
  30. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/hid_stream.py +0 -0
  31. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/host.py +0 -0
  32. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/link.py +0 -0
  33. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/message.py +0 -0
  34. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/names.py +0 -0
  35. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/riscv.py +0 -0
  36. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/rp2350.py +0 -0
  37. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/target.py +0 -0
  38. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/uiapduino.py +0 -0
  39. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/src/oep_client/usb_stream.py +0 -0
  40. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_capabilities.py +0 -0
  41. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_cobs.py +0 -0
  42. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_config.py +0 -0
  43. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_esp32_targets.py +0 -0
  44. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_fake_spec.py +0 -0
  45. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_flash_console.py +0 -0
  46. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_hid_stream.py +0 -0
  47. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_interfaces.py +0 -0
  48. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_link_host.py +0 -0
  49. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_link_serial.py +0 -0
  50. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_session.py +0 -0
  51. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_target_parts.py +0 -0
  52. {oep_client_python-0.0.6 → oep_client_python-0.0.7}/tests/test_usb_stream.py +0 -0
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.0.7
6
+ - (EN) `oep dump` names the wires' reset role (role 3) and no longer lists riscv-dm's clobbers (gone: the probe puts the registers back itself, oep-if-debug §4.5).
7
+ - (JA) `oep dump` は wire の reset の役(role 3)を名前で出し、riscv-dm の clobbers を出さなくなった(無くなった: probe が自分でレジスタを戻す、oep-if-debug §4.5)。
8
+ - (EN) `LogicCapture.to_sr` writes up to 16 channels (sigrok unitsize 2 above 8); it stopped at 8.
9
+ - (JA) `LogicCapture.to_sr` は 16 ch まで書く(8 ch を超えると sigrok の unitsize 2)。前は 8 ch まで。
10
+
5
11
  ## 0.0.6
6
12
  - (EN) No default reset line (oep-if-debug §3): `Wire.attach_under_reset(channel, ...)` needs its channel, and `Wire.reset_channels()` reads the ones the probe allows (describe role_channels, role reset). The fake takes only those, and not one a plan holds.
7
13
  - (JA) 既定の reset 線は無くなった(oep-if-debug §3): `Wire.attach_under_reset(channel, ...)` は channel が必須。probe が許す channel は `Wire.reset_channels()` で読む(describe の role_channels の role reset)。偽の probe はそれだけを受け、plan が持つ channel は断る。
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: oep-client-python
3
- Version: 0.0.6
3
+ Version: 0.0.7
4
4
  Summary: Open Embedded Probe (OEP) v1 host: serial / USB / TCP transports, the session rules, the standard interfaces, and a fake probe
5
5
  Project-URL: Homepage, https://github.com/Open-Embedded-Probe/oep-client-python
6
6
  Project-URL: Repository, https://github.com/Open-Embedded-Probe/oep-client-python
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "oep-client-python"
7
- version = "0.0.6"
7
+ version = "0.0.7"
8
8
  description = "Open Embedded Probe (OEP) v1 host: serial / USB / TCP transports, the session rules, the standard interfaces, and a fake probe"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "0.0.6"
5
+ __version__ = "0.0.7"
@@ -347,18 +347,20 @@ class LogicCapture(Interface):
347
347
  return [(data[(i * c.width + bit0) >> 3] >> ((i * c.width + bit0) & 7)) & 1 for i in range(n)]
348
348
 
349
349
  def to_sr(self, path: str, data: bytes, samples: int, names: list[str] | None = None) -> None:
350
- """A sigrok session file: one byte per sample, bit k = channel k (so up to 8 channels here)."""
350
+ """A sigrok session file: bit k of each sample = channel k, one byte per sample up to 8 channels, two (little
351
+ endian, sigrok's unitsize 2) up to 16."""
351
352
  c = self.config
352
353
  n_ch = len(c.positions)
353
- if n_ch > 8:
354
- raise ValueError("to_sr writes one byte per sample; more than 8 channels need unitsize 2")
354
+ unit = 1 if n_ch <= 8 else 2
355
+ if n_ch > 16:
356
+ raise ValueError("to_sr writes up to 16 channels")
355
357
  names = names or [f"D{k}" for k in range(n_ch)]
356
358
  chans = [self.channel(data, k, samples) for k in range(n_ch)]
357
- out = bytes(sum(chans[k][i] << k for k in range(n_ch)) for i in range(samples))
359
+ out = b"".join(sum(chans[k][i] << k for k in range(n_ch)).to_bytes(unit, "little") for i in range(samples))
358
360
  rate = c.rate.numerator // c.rate.denominator
359
361
  meta = ["[global]", "sigrok version=0.5.2", "", "[device 1]", "capturefile=logic-1",
360
362
  f"total probes={n_ch}", f"samplerate={rate} Hz", "total analog=0"]
361
- meta += [f"probe{k + 1}={nm}" for k, nm in enumerate(names)] + ["unitsize=1", ""]
363
+ meta += [f"probe{k + 1}={nm}" for k, nm in enumerate(names)] + [f"unitsize={unit}", ""]
362
364
  with zipfile.ZipFile(path, "w") as z:
363
365
  z.writestr("version", "2")
364
366
  z.writestr("metadata", "\n".join(meta))
@@ -71,15 +71,14 @@ KNOWN: dict[str, Known] = {
71
71
  0x46: ("label", _label), 0x47: ("resets on open", lambda v: "yes"),
72
72
  0x49: ("transport", _transport), 0x4A: ("OEP VID:PID", lambda v: "yes" if v[:1] == b"\x01" else "no")}),
73
73
  "oep.wire.rvswd": Known("scan, attach, detach over RVSWD (attach returns a connection)",
74
- roles={1: "SWDIO", 2: "SWCLK"}, tags={0x40: ("max connections", lambda v: str(v[0]))}),
74
+ roles={1: "SWDIO", 2: "SWCLK", 3: "reset"}, tags={0x40: ("max connections", lambda v: str(v[0]))}),
75
75
  "oep.wire.swio": Known("scan, attach, detach over SWIO, one wire (attach returns a connection)",
76
- roles={1: "SWIO"}, tags={0x40: ("max connections", lambda v: str(v[0]))}),
76
+ roles={1: "SWIO", 3: "reset"}, tags={0x40: ("max connections", lambda v: str(v[0]))}),
77
77
  "oep.wire.swd": Known("scan, attach, detach over ARM SWD", roles={1: "SWDIO", 2: "SWCLK"},
78
78
  tags={0x40: ("max connections", lambda v: str(v[0]))}),
79
79
  "oep.target.riscv-dm": Known(
80
80
  "RISC-V Debug Module over DMI: step lists, block read/write, run until halt, halt/resume",
81
- features={0: "block read/write", 1: "run until halt", 2: "reset", 3: "step"},
82
- tags={0x40: ("clobbers", lambda v: ", ".join(f"0x{r:04x}" for r in struct.unpack(f"<{len(v) // 2}H", v)))}),
81
+ features={0: "block read/write", 1: "run until halt", 2: "reset", 3: "step"}),
83
82
  "oep.target.arm-adi": Known("ARM Debug Interface: DP/AP transfer lists, block transfers"),
84
83
  "oep.target.console": Known(
85
84
  "console streams on a debug connection (position-addressed, marks)",
@@ -2,7 +2,7 @@
2
2
 
3
3
  from types import SimpleNamespace as _NS
4
4
 
5
- REGISTRY_HASH = "049bd156b4775990"
5
+ REGISTRY_HASH = "dd6d527421bb6206"
6
6
  SCHEMA = 1
7
7
  PROTOCOL_REVISION = 1
8
8
  CONFIRM_REQUEST_MAGIC = 'OEP?'
@@ -34,7 +34,7 @@ WIRE_SWD = _NS(name="oep.wire.swd", revision=1, op={"scan": 0x01, "attach": 0x02
34
34
  closed_tail={}, tlv={"describe": {"max_connections": 0x40}, "detach": {"force": 0x01}, "attach": {"max_speed": 0x01, "targetsel": 0x02, "pins": 0x03}}, event={}, enum={"connection_users": {"host_session": 0x01, "slot": 0x02}, "pin_role": {"swdio": 0x01, "swclk": 0x02}}, own={})
35
35
  INTERFACES["oep.wire.swd"] = WIRE_SWD
36
36
  TARGET_RISCV_DM = _NS(name="oep.target.riscv-dm", revision=1, op={"dmi": 0x01, "halt": 0x02, "resume": 0x03, "reset": 0x04, "read_block": 0x05, "write_block": 0x06, "run": 0x07, "step": 0x08}, lock_free={},
37
- closed_tail={}, tlv={"describe": {"clobbers": 0x40}, "reset": {"method": 0x01}}, event={}, enum={"dmi_step": {"write": 0x01, "read": 0x02, "poll_reads": 0x03, "wait_us": 0x04, "poll_us": 0x05}, "reset_mode": {"run": 0x00, "run_verified": 0x01, "halt_at_reset": 0x02}, "reset_method": {"probe_default": 0x00, "ndmreset": 0x01, "system_reset": 0x02}}, own={})
37
+ closed_tail={}, tlv={"describe": {}, "reset": {"method": 0x01}}, event={}, enum={"dmi_step": {"write": 0x01, "read": 0x02, "poll_reads": 0x03, "wait_us": 0x04, "poll_us": 0x05}, "reset_mode": {"run": 0x00, "run_verified": 0x01, "halt_at_reset": 0x02}, "reset_method": {"probe_default": 0x00, "ndmreset": 0x01, "system_reset": 0x02}}, own={})
38
38
  INTERFACES["oep.target.riscv-dm"] = TARGET_RISCV_DM
39
39
  TARGET_ARM_ADI = _NS(name="oep.target.arm-adi", revision=1, op={"transfer": 0x01, "read_block": 0x02, "write_block": 0x03}, lock_free={},
40
40
  closed_tail={}, tlv={}, event={}, enum={}, own={})
@@ -102,3 +102,16 @@ def test_read_spans_frames_without_the_header_leaking_into_the_data():
102
102
  hst._revisions[21] = 1
103
103
  lc = c.LogicCapture(hst)
104
104
  assert lc.read(100, 2500) == stream[100:2600]
105
+
106
+
107
+ def test_sigrok_file_takes_sixteen_channels_in_two_bytes(tmp_path):
108
+ import zipfile
109
+ lc = logic(16, list(range(16)))
110
+ lc.config.rate = Fraction(20_000_000)
111
+ samples = [0x8001, 0x0102]
112
+ path = tmp_path / "x.sr"
113
+ lc.to_sr(str(path), b"".join(v.to_bytes(2, "little") for v in samples), 2)
114
+ with zipfile.ZipFile(path) as z:
115
+ meta = z.read("metadata").decode()
116
+ assert "unitsize=2" in meta and "total probes=16" in meta and "samplerate=20000000 Hz" in meta
117
+ assert z.read("logic-1-1") == bytes([0x01, 0x80, 0x02, 0x01])