Add boxsim CLI: pure Python codec, netlist extraction, KiCad project generation
Replaces the bpj2ini.py prototype with a packaged tool. The A2F codec is now reimplemented in Python, so neither Boxsim.exe nor a CPU emulator is needed to decode a container; the emulator survives as a development-only oracle that the codec is differentially tested against. Verified: - 134 containers decode byte-identically to Boxsim's own decoder, 270 pre-2.0 files rejected by both implementations (tools/difftest.py --self-test) - Default.BPJ: 22 components, 14 nets, no dangling terminal - 22 of 22 parts resolve to library symbols; one series inferred from a sibling, two DC resistance deviations reported - ERC clean and the netlist KiCad extracts from the generated sheet is an identical partition to the one derived from the Boxsim grid - container build byte-identical to the host build - 32 tests passing, ruff clean Decode time went 69 s -> 14.5 s (binding emulator hooks to trap addresses) -> 1.6 s (pure Python). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
eb81ca61cb
commit
4737a5bae8
28 files changed
+4459
-122
No files matched your search
@@ -0,0 +1,41 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=68"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "boxsim"
|
||||
version = "0.1.0"
|
||||
description = "Read Boxsim loudspeaker projects and generate KiCad projects from their crossovers"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
license = { text = "MIT" }
|
||||
authors = [{ name = "Marco Grätsch", email = "magdev3.0@gmail.com" }]
|
||||
keywords = ["boxsim", "visaton", "kicad", "loudspeaker", "crossover"]
|
||||
dependencies = []
|
||||
|
||||
[project.optional-dependencies]
|
||||
# Development only: the reference decoder emulates Boxsim.exe to differentially
|
||||
# test the pure Python codec. Not needed to use the tool.
|
||||
oracle = ["unicorn>=2.0", "pefile>=2023.2.7"]
|
||||
dev = ["pytest>=8", "ruff>=0.6"]
|
||||
|
||||
[project.scripts]
|
||||
boxsim = "boxsim.cli:main"
|
||||
|
||||
[tool.setuptools]
|
||||
packages = ["boxsim"]
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
boxsim = ["data/*"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
addopts = "-q"
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 96
|
||||
target-version = "py311"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "W", "I", "UP", "B", "C4", "SIM"]
|
||||
ignore = ["E501"]
|
||||
Reference in new issue
Block a user