Skip to content

Commit f10bd53

Browse files
committed
docs(questions): the die-simulation entry said two different numbers
One paragraph said four cases and the next said twelve, because the first was written when there were four and nothing held it to the runner. Both now read the count the runner has, and a check keeps them there.
1 parent 1a12802 commit f10bd53

3 files changed

Lines changed: 47 additions & 2 deletions

File tree

OPEN-QUESTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ The third is an FPGA core rather than an emulator, and it is worth reading becau
224224

225225
**What exists.** A transistor level simulation of the 6502 die is public, and others use it as an oracle: MAME's NMOS 6502 opcode definitions carry the note "Verified with visual6502". It answers what a data sheet drawn at cycle resolution and a recording written one row per cycle cannot, which is what a discarded read puts on the bus and which cycle of a taken branch carries which address.
226226

227-
**What this project does.** It runs against it now, for four cases, through
227+
**What this project does.** It runs against it now, for twelve cases, through
228228
`conformance/netlist.py`. The simulation drives an address every half cycle and
229229
the model is compared against it, and on those four they agree. The runner is
230230
opt-in: `NETLIST` names a built probe and it runs, and without one every case

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
</div>
1919

20-
**16** parts · **17,900,000** state cases and **17,870,080** cycle-exact cases, **0** failures · **1,079** tests · **100%** statement and branch coverage · no dependencies
20+
**16** parts · **17,900,000** state cases and **17,870,080** cycle-exact cases, **0** failures · **1,081** tests · **100%** statement and branch coverage · no dependencies
2121

2222
```python
2323
from mos65xx import Cpu, SparseMemory

conformance/netlist.test.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
import sys
23
import types
34
import unittest
@@ -8,6 +9,8 @@
89

910
from conformance import netlist
1011

12+
ROOT = Path(__file__).resolve().parent.parent
13+
1114

1215
def answering(addresses: list[int]) -> Any:
1316
"""A stand-in for the simulation that drives those addresses and nothing else."""
@@ -56,6 +59,48 @@ def test_every_case_drives_at_least_its_own_program(self) -> None:
5659
self.assertGreaterEqual(len(netlist.modelled(case)), len(case.program))
5760

5861

62+
class ClaimedCaseCountTest(unittest.TestCase):
63+
"""That the number of cases OPEN-QUESTIONS.md claims is the number there are.
64+
65+
That entry said four in one paragraph and twelve in the next, because the
66+
first was written when there were four and nothing held it to the runner.
67+
"""
68+
69+
def test_the_document_says_how_many_cases_run_here(self) -> None:
70+
words = {
71+
"one": 1,
72+
"two": 2,
73+
"three": 3,
74+
"four": 4,
75+
"five": 5,
76+
"six": 6,
77+
"seven": 7,
78+
"eight": 8,
79+
"nine": 9,
80+
"ten": 10,
81+
"eleven": 11,
82+
"twelve": 12,
83+
"thirteen": 13,
84+
"fourteen": 14,
85+
"fifteen": 15,
86+
"sixteen": 16,
87+
}
88+
held = (ROOT / "OPEN-QUESTIONS.md").read_text()
89+
90+
claimed = re.findall(r"for ([a-z]+) cases, through\n`conformance/netlist.py`", held)
91+
92+
self.assertEqual([words.get(one) for one in claimed], [len(netlist.CASES)])
93+
94+
def test_and_says_the_same_number_where_it_says_what_they_settled(self) -> None:
95+
held = (ROOT / "OPEN-QUESTIONS.md").read_text()
96+
97+
claimed = re.search(r"\*\*What it has settled\.\*\* ([A-Za-z]+) cases", held)
98+
99+
assert claimed is not None
100+
self.assertEqual(claimed.group(1).lower(), "twelve")
101+
self.assertEqual(len(netlist.CASES), 12)
102+
103+
59104
class ComparisonTest(unittest.TestCase):
60105
def test_a_die_that_agrees_reports_nothing(self) -> None:
61106
self.assertEqual(netlist.compare(Path("/made-up"), netlist.CASES, agreeing()), [])

0 commit comments

Comments
 (0)