From ed1fa07a89366d5472b222340d6f7ee6bd7f5dd8 Mon Sep 17 00:00:00 2001 From: tignear Date: Sun, 1 Nov 2026 07:40:33 +0900 Subject: [PATCH] ci(bench): add the E203 default hello workload Add HummingbirdV2-E203 hello to the daily RTLMeter comparison, report validation and dashboard. Resolve upstream default configuration defines, including #1 flip-flop delays, and require program.hex, the expected hello output and TEST_PASSED. Assertions and standard shared-variable semantics remain enabled; no upstream RTL modifications are applied. Bind workload options and image identities to published measurements and check the per-design success marker in one-clock negative controls. Provision the pinned descriptor reader in an isolated environment before the general script-test job runs its collector tests. Validation: 8 Python tests after reproducing the missing dependency in a clean environment; 68 focused CI/benchmark script tests; workflow YAML and shell syntax; and documentation build. E203 completed at 5,080 clocks in Celox two-state/four-state, Verilator two-state and xezim four-state; Celox state probes and one-clock controls passed. Local functional runs are not published performance measurements. Change-Id: Ibd4ee6f65c1b20fd86f6a7a4e5d281edcfa395d0 --- .github/workflows/ci.yml | 4 +- .github/workflows/rtlmeter-bench.yml | 6 +-- benchmarks/rtlmeter/manifest.json | 25 ++++++++- .../components/BenchmarkDashboard.vue | 10 ++-- docs/benchmarks/index.md | 2 +- docs/benchmarks/rtlmeter.md | 22 ++++---- docs/ja/benchmarks/index.md | 2 +- docs/ja/benchmarks/rtlmeter.md | 4 +- scripts/publish-rtlmeter-bench.mjs | 6 ++- scripts/rtlmeter-benchmark.test.mjs | 25 ++++++--- scripts/run-rtlmeter-bench.py | 20 ++++--- scripts/tests/test_rtlmeter_bench.py | 52 +++++++++++++++++++ 12 files changed, 142 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 768418755b4..4a5081ba774 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -224,7 +224,9 @@ jobs: bash scripts/tests/run-heliodor-bench-results.sh bash scripts/tests/run-heliodor-bench-gate.sh python3 -m unittest discover -s .updatecli/tests -v - PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s scripts/tests -p test_rtlmeter_bench.py -v + python3 -m venv "$RUNNER_TEMP/rtlmeter-tests" + "$RUNNER_TEMP/rtlmeter-tests/bin/python" -m pip install -r benchmarks/rtlmeter/requirements.txt + PYTHONDONTWRITEBYTECODE=1 "$RUNNER_TEMP/rtlmeter-tests/bin/python" -m unittest discover -s scripts/tests -p test_rtlmeter_bench.py -v # A new dependency edge can invalidate the NAPI exclusions or the # backend and frontend variants that pull requests narrow celox to. diff --git a/.github/workflows/rtlmeter-bench.yml b/.github/workflows/rtlmeter-bench.yml index 31b7201da1b..54f16ade5f3 100644 --- a/.github/workflows/rtlmeter-bench.yml +++ b/.github/workflows/rtlmeter-bench.yml @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: false matrix: - case: [e902, e906] + case: [e902, e906, e203] steps: - uses: actions/checkout@v7 - uses: actions/setup-python@v7 @@ -109,9 +109,9 @@ jobs: path: artifacts - name: Validate every report before publishing run: | - for case in e902 e906; do + for case in e902 e906 e203; do node scripts/publish-rtlmeter-bench.mjs "artifacts/rtlmeter-$case/result/results.json" "artifacts/rtlmeter-$case/host.txt" --validate-only done - for case in e902 e906; do + for case in e902 e906 e203; do node scripts/publish-rtlmeter-bench.mjs "artifacts/rtlmeter-$case/result/results.json" "artifacts/rtlmeter-$case/host.txt" done diff --git a/benchmarks/rtlmeter/manifest.json b/benchmarks/rtlmeter/manifest.json index 91f25586722..9e3d22d52ab 100644 --- a/benchmarks/rtlmeter/manifest.json +++ b/benchmarks/rtlmeter/manifest.json @@ -6,7 +6,28 @@ "samples": 3, "verilatorVersion": "5.052", "cases": { - "e902": { "design": "XuanTie-E902", "test": "hello", "payload": "Hello Friend!", "maxCycles": 16384 }, - "e906": { "design": "XuanTie-E906", "test": "hello", "payload": "Hello Friend!", "maxCycles": 32768 } + "e902": { + "design": "XuanTie-E902", + "test": "hello", + "payload": "Hello Friend!", + "maxCycles": 16384 + }, + "e906": { + "design": "XuanTie-E906", + "test": "hello", + "payload": "Hello Friend!", + "maxCycles": 32768 + }, + "e203": { + "design": "HummingbirdV2-E203", + "test": "hello", + "payload": "Hello World from HummingbirdV2 E203", + "maxCycles": 16384, + "configuration": "default", + "successMarker": "TEST_PASSED", + "inputFiles": [ + "tests/hello/program.hex" + ] + } } } diff --git a/docs/.vitepress/components/BenchmarkDashboard.vue b/docs/.vitepress/components/BenchmarkDashboard.vue index b506426242d..84dead3d1b9 100644 --- a/docs/.vitepress/components/BenchmarkDashboard.vue +++ b/docs/.vitepress/components/BenchmarkDashboard.vue @@ -428,10 +428,14 @@ function shortDate(epoch: number): string { return `${d.getMonth() + 1}/${d.getDate()}`; } +function rtlmeterDesignName(name: string): string { + return name === "e203" ? "HummingbirdV2-E203" : `XuanTie-${name.toUpperCase()}`; +} + /** Format chart title from benchName */ function formatChartTitle(benchName: string): string { - const rtlmeter = benchName.match(/^rtlmeter_(e902|e906)_hello_v1_x64_(two-state|four-state)_total$/); - if (rtlmeter) return `XuanTie-${rtlmeter[1].toUpperCase()} hello · cold source-to-finish`; + const rtlmeter = benchName.match(/^rtlmeter_(e902|e906|e203)_hello_v1_x64_(two-state|four-state)_total$/); + if (rtlmeter) return `${rtlmeterDesignName(rtlmeter[1])} hello · cold source-to-finish`; let s = benchName; const rica = s.match(/^collection_rica_(kernel-[a-z-]+)_([a-f0-9]+)_(x64|arm64)_total$/); if (rica) return `rica ${rica[1]} · total · ${rica[3]} · workload ${rica[2]}`; @@ -902,7 +906,7 @@ onBeforeUnmount(() => { Measurement details.

-

XuanTie-{{ entry.rtlmeter!.case.toUpperCase() }} · latest qualification

+

{{ rtlmeterDesignName(entry.rtlmeter!.case) }} · latest qualification

Raw logs and versions · {{ entry.cpu }} · {{ new Date(entry.date).toLocaleDateString() }}

diff --git a/docs/benchmarks/index.md b/docs/benchmarks/index.md index ae504185b2f..a78adaddb8c 100644 --- a/docs/benchmarks/index.md +++ b/docs/benchmarks/index.md @@ -29,7 +29,7 @@ Celox/Verilator results for five fixed configurations (472 tests per sample). Its tab separates test-body, whole-process and HDL compilation time. The [RTLMeter comparison](./rtlmeter.md) measures cold source-to-finish latency for -XuanTie-E902/E906 hello programs in separate 2-state and 4-state charts, with +XuanTie-E902/E906 and HummingbirdV2-E203 hello programs in separate 2-state and 4-state charts, with Verilator and the stable xezim release pinned by Nix. Unsupported modes and failed qualifications remain visible in its status tables. diff --git a/docs/benchmarks/rtlmeter.md b/docs/benchmarks/rtlmeter.md index bdc3296d7f3..3e85d1840ec 100644 --- a/docs/benchmarks/rtlmeter.md +++ b/docs/benchmarks/rtlmeter.md @@ -2,10 +2,13 @@ [Open the RTLMeter dashboard](./index.md?tab=rtlmeter). -The comparison runs the unmodified **XuanTie-E902** and **XuanTie-E906** `hello` -programs from [RTLMeter](https://github.com/verilator/rtlmeter), fixed at commit +The comparison runs the unmodified **XuanTie-E902**, **XuanTie-E906** and +**HummingbirdV2-E203** `hello` programs from [RTLMeter](https://github.com/verilator/rtlmeter), fixed at commit `4fdd6c3fd154e9b99d3a9d713cf3f4977e284f94`. All tools receive the same ordered -source list, headers, defines, testbench and `case.pat`. Input hashes, tool +source list, headers, defines, testbench and firmware (`case.pat` for E902/E906; +`program.hex` for E203). E203 uses the upstream `default` configuration, including +its `#1` flip-flop delays, with assertions enabled and standard shared-variable +semantics. Input hashes, tool versions, executable hashes and raw output are retained with each run. ## State models @@ -38,15 +41,16 @@ These short programs measure iteration latency, **not steady-state simulation throughput**. All configurations for one design run sequentially on the same VM and logical -CPU, with tool order rotated between repetitions. The two designs may run on +CPU, with tool order rotated between repetitions. Different designs may run on different hosts. Compare results within one design, state model and host. -A successful sample requires a zero exit status, exactly one `Hello Friend!` -and `TEST PASSED` line, no failure marker, and a positive final RTLMeter clock -count. Counts must be stable across repetitions and differ by at most one clock +A successful sample requires a zero exit status, the expected program output +and success marker exactly once, no failure marker, and a positive final +RTLMeter clock count. E902/E906 print `Hello Friend!` and `TEST PASSED`; E203 +prints `Hello World from HummingbirdV2 E203` and `TEST_PASSED`. Counts must be stable across repetitions and differ by at most one clock between tools, allowing for `$finish` and the counter on the same active edge. A separate one-cycle negative control must stop before program success. -All tools use the same upstream `+max_cycles` limit (16,384 for E902; 32,768 +All tools use the same upstream `+max_cycles` limit (16,384 for E902/E203; 32,768 for E906), so a stalled UART or CPU cannot count as a completed workload. Unsupported modes, probe failures, simulation failures, timeouts and clock mismatches appear in the table and contribute no performance points. @@ -69,5 +73,5 @@ work/rtlmeter-python/bin/python scripts/run-rtlmeter-bench.py prepare work/rtlme nix develop .#xezim --command work/rtlmeter-python/bin/python scripts/run-rtlmeter-bench.py run e902 work/rtlmeter-source work/rtlmeter-bin/celox work/rtlmeter-report ``` -Repeat with `e906` and a fresh output directory. Local dirty-checkout results +Repeat with `e906` or `e203` and a fresh output directory. Local dirty-checkout results are useful for investigation and cannot be published as release measurements. diff --git a/docs/ja/benchmarks/index.md b/docs/ja/benchmarks/index.md index d46f631bbaa..7e6be84d9c4 100644 --- a/docs/ja/benchmarks/index.md +++ b/docs/ja/benchmarks/index.md @@ -94,6 +94,6 @@ Issue には実行へのリンクと、性能低下の場合は比較結果と ローカル計測は、同じマシン上で 2 つのリビジョンを比較する場合に最も有効です。 CI 履歴は、単発の小さな差より長期的な傾向の確認に向いています。 -[RTLMeter 比較](./rtlmeter.md)では XuanTie-E902/E906 hello を用い、 +[RTLMeter 比較](./rtlmeter.md)では XuanTie-E902/E906 と HummingbirdV2-E203 の hello を用い、 2-state / 4-state を分けて Verilator・Nix 固定の安定版 xezim と比較します。 コンパイルから実行完了までを測り、未対応や失敗も表に表示します。 diff --git a/docs/ja/benchmarks/rtlmeter.md b/docs/ja/benchmarks/rtlmeter.md index 2c85ab46a33..cabf3213473 100644 --- a/docs/ja/benchmarks/rtlmeter.md +++ b/docs/ja/benchmarks/rtlmeter.md @@ -2,7 +2,9 @@ [RTLMeter ダッシュボード](./index.md?tab=rtlmeter)で、Celox・Verilator・xezim の 2-state / 4-state 比較を確認できます。対象は固定した RTLMeter の -XuanTie-E902 / E906 の `hello` です。 +XuanTie-E902 / E906 と HummingbirdV2-E203 の `hello` です。 +E203 は上流の `default` 構成(フリップフロップの `#1` 遅延を含む)を使用し、 +assertion を有効にした通常の共有変数の意味論で実行します。 測定値は、同じ VM・論理 CPU 上で順番を入れ替えて実行した 3 回の中央値です。 HDL の読み込みからコンパイル、起動、実行完了までを含みます。Verilator には diff --git a/scripts/publish-rtlmeter-bench.mjs b/scripts/publish-rtlmeter-bench.mjs index cca6dc9617d..c65f50a3d89 100644 --- a/scripts/publish-rtlmeter-bench.mjs +++ b/scripts/publish-rtlmeter-bench.mjs @@ -13,6 +13,8 @@ const positive = value => Number.isSafeInteger(value) && value > 0; export function rtlmeterMetrics(report, commit) { assert.ok(manifest.cases[report.case], "Unknown RTLMeter case"); + const spec = manifest.cases[report.case]; + assert.deepEqual(report.caseSpec, spec, "Workload options must match the manifest"); assert.equal(report.schemaVersion, 1); assert.equal(report.contract, manifest.contract); assert.equal(report.status, "completed"); @@ -42,7 +44,7 @@ export function rtlmeterMetrics(report, commit) { Object.fromEntries(Object.entries(report.inputSha256).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)), )).digest("hex")); const design = manifest.cases[report.case].design; - for (const path of [`designs/${design}/descriptor.yaml`, `designs/${design}/tests/hello/case.pat`, + for (const path of [`designs/${design}/descriptor.yaml`, ...((spec.inputFiles ?? ["tests/hello/case.pat"]).map(file => `designs/${design}/${file}`)), "rtl/__rtlmeter_utils.sv", "rtl/__rtlmeter_top_include.vh"]) { assert.ok(digest(report.inputSha256[path]), `Missing input identity: ${path}`); } @@ -84,7 +86,7 @@ export function rtlmeterMetrics(report, commit) { const times = row.samples.map(sample => sample.processNs).sort((a, b) => a - b); return { name: `rtlmeter-${row.engine}/rtlmeter_${report.case}_hello_v1_x64_${row.stateModel}_total`, unit: "us", value: times[Math.floor(times.length / 2)] / 1000, - extra: JSON.stringify({ contract: report.contract, rtlmeter: report.rtlmeterRevision, + extra: JSON.stringify({ caseSpec: report.caseSpec, contract: report.contract, rtlmeter: report.rtlmeterRevision, state: row.stateModel, cycles: row.samples[0].cycles, maxCycles: report.maxCycles, samples: times, configuration: report.configuration, versions: report.versions, binarySha256: report.binarySha256, sourceSha256: report.sourceSha256, run }) }; diff --git a/scripts/rtlmeter-benchmark.test.mjs b/scripts/rtlmeter-benchmark.test.mjs index 876d446e1a1..39ce3e8c3b5 100644 --- a/scripts/rtlmeter-benchmark.test.mjs +++ b/scripts/rtlmeter-benchmark.test.mjs @@ -7,15 +7,17 @@ import { rtlmeterMetrics } from "./publish-rtlmeter-bench.mjs"; const manifest = JSON.parse(readFileSync(new URL("../benchmarks/rtlmeter/manifest.json", import.meta.url))); const locked = JSON.parse(readFileSync(new URL("../flake.lock", import.meta.url))).nodes.xezim; const commit = 'a'.repeat(40); -function report() { +function report(name = "e902") { + const spec = manifest.cases[name]; const inputSha256 = Object.fromEntries([ - ...Array.from({ length: 110 }, (_, i) => `designs/XuanTie-E902/src/${i}.v`), - 'designs/XuanTie-E902/descriptor.yaml', 'designs/XuanTie-E902/tests/hello/case.pat', + ...Array.from({ length: 110 }, (_, i) => `designs/${spec.design}/src/${i}.v`), + `designs/${spec.design}/descriptor.yaml`, + ...(spec.inputFiles ?? ["tests/hello/case.pat"]).map(file => `designs/${spec.design}/${file}`), 'rtl/__rtlmeter_utils.sv', 'rtl/__rtlmeter_top_include.vh', ].sort().map(path => [path, 'b'.repeat(64)])); - return { schemaVersion: 1, contract: manifest.contract, case: 'e902', status: 'completed', + return { schemaVersion: 1, contract: manifest.contract, case: name, caseSpec: spec, status: 'completed', rtlmeterRevision: manifest.revision, celoxCommit: commit, dirty: false, - requestedSamples: 3, maxCycles: manifest.cases.e902.maxCycles, host: { architecture: 'x86_64', cpu: 'test CPU', affinityCpu: 0 }, + requestedSamples: 3, maxCycles: spec.maxCycles, host: { architecture: 'x86_64', cpu: 'test CPU', affinityCpu: 0 }, xezimRelease: locked.original.ref, xezimRevision: locked.locked.rev, versions: { celox: 'celox 0.12.0', verilator: 'Verilator 5.052', xezim: `xezim version ${locked.original.ref.replace(/^v/, '')}\ngit unknown` }, binarySha256: { celox: 'a'.repeat(64), verilator: 'b'.repeat(64), xezim: 'c'.repeat(64) }, @@ -73,7 +75,7 @@ test('RTLMeter runs daily/manual with locked tools, raw failures and master-only assert.doesNotMatch(workflow, /^\s+(pull_request|push|merge_group):/m); assert.match(workflow, /cancel-in-progress: false/); assert.match(workflow, /fail-fast: false/); - assert.match(workflow, /case: \[e902, e906\]/); + assert.match(workflow, /case: \[e902, e906, e203\]/); assert.match(workflow, /nix build --no-update-lock-file \.#xezim/); assert.match(workflow, /revision: ea338be98e1e838d3518809ce8899f85a009963c/); assert.match(workflow, /needs: comparison\n if: github.ref == 'refs\/heads\/master'/); @@ -81,3 +83,14 @@ test('RTLMeter runs daily/manual with locked tools, raw failures and master-only assert.match(workflow, /if: always\(\)[\s\S]+retention-days: 30/); assert.ok(workflow.indexOf('--validate-only') < workflow.lastIndexOf('node scripts/publish-rtlmeter-bench.mjs')); }); + +test('E203 publishes the default hello workload and rejects altered options or image identities', () => { + const r = report('e203'); + assert.ok(rtlmeterMetrics(r, commit).every(metric => metric.name.includes('rtlmeter_e203_hello_v1_'))); + const wrongOptions = structuredClone(r); + wrongOptions.caseSpec.configuration = 'nodelay'; + assert.throws(() => rtlmeterMetrics(wrongOptions, commit)); + delete r.inputSha256['designs/HummingbirdV2-E203/tests/hello/program.hex']; + r.sourceSha256 = createHash('sha256').update(JSON.stringify(r.inputSha256)).digest('hex'); + assert.throws(() => rtlmeterMetrics(r, commit), /Missing input identity:.*program\.hex/); +}); diff --git a/scripts/run-rtlmeter-bench.py b/scripts/run-rtlmeter-bench.py index a8ea09af146..57b3f727a01 100644 --- a/scripts/run-rtlmeter-bench.py +++ b/scripts/run-rtlmeter-bench.py @@ -54,10 +54,16 @@ def specification(name, source): descriptor = yaml.safe_load((design / 'descriptor.yaml').read_text()) compile_spec = descriptor['compile'] test = descriptor['execute']['tests'][spec['test']] + configurations = descriptor.get('configurations', {}) + configuration = configurations[spec['configuration']] if 'configuration' in spec else configurations.get('default', {}) + configured_compile = configuration.get('compile', {}) + configured_execute = configuration.get('execute', {}) + test = {**test, **configured_execute.get('tests', {}).get(spec['test'], {})} sources = [design / p for p in compile_spec['verilogSourceFiles']] sources.append(source / 'rtl/__rtlmeter_utils.sv') files = [design / p for p in test.get('files', [])] - defines = {**compile_spec.get('verilogDefines', {}), '__RTLMETER_MAIN_CLOCK': compile_spec['mainClock']} + defines = {**compile_spec.get('verilogDefines', {}), **configured_compile.get('verilogDefines', {}), + '__RTLMETER_MAIN_CLOCK': compile_spec['mainClock']} # Fingerprint all potential local headers, not only explicit compilation inputs. inputs = sorted(set([*sources, *files, design / 'descriptor.yaml', *design.joinpath('src').rglob('*'), source / 'rtl/__rtlmeter_top_include.vh'])) @@ -96,12 +102,12 @@ def execute(command, cwd, log, timeout, cpu): return {'exitCode': code, 'timedOut': code in (124, 137), 'elapsedNs': time.monotonic_ns() - start} -def accept(stdout, cycles, outcome, payload): +def accept(stdout, cycles, outcome, payload, success_marker='TEST PASSED'): if outcome['timedOut'] or outcome['exitCode'] != 0: raise ValueError('process failed or timed out') - if re.search(r'TEST\s+FAIL(?:ED)?|simulation finished with error|\$fatal|%Error:', stdout, re.I): + if re.search(r'TEST[\s_]+FAIL(?:ED)?|Time Out !!!|simulation finished with error|\$fatal|%Error:', stdout, re.I): raise ValueError('testbench reported failure') - if stdout.splitlines().count('TEST PASSED') != 1 or stdout.splitlines().count(payload) != 1: + if stdout.splitlines().count(success_marker) != 1 or stdout.splitlines().count(payload) != 1: raise ValueError('missing unique upstream success marker or expected program output') if not re.fullmatch(r'[1-9][0-9]*', cycles.strip()): raise ValueError('missing valid final RTLMeter clock count') @@ -168,7 +174,7 @@ def measure_case(name, source, celox, xezim, output, build_root, timeout=1800, s release = locked['original'].get('ref') if release is None or versions['xezim'].splitlines()[0] != f'xezim version {release.removeprefix("v")}': raise ValueError('xezim must be built from the release fixed by flake.lock') - report = {'schemaVersion': 1, 'contract': MANIFEST['contract'], 'case': name, + report = {'schemaVersion': 1, 'contract': MANIFEST['contract'], 'case': name, 'caseSpec': MANIFEST['cases'][name], 'rtlmeterRevision': MANIFEST['revision'], 'sourceSha256': spec['sourceSha256'], 'inputSha256': spec['inputSha256'], 'celoxCommit': git(ROOT, 'rev-parse', 'HEAD'), 'dirty': bool(git(ROOT, 'status', '--porcelain')), 'requestedSamples': samples, @@ -219,7 +225,7 @@ def save(): text = ''.join(p.read_text(errors='replace') for p in sorted((control / 'logs').glob('*.log'))) control_cycles = control / '_rtlmeter_cycles.txt' if (outcome['exitCode'] == 0 and not outcome['timedOut'] - and 'RTLMeter: +max_cycles reached, exiting' in text and 'TEST PASSED' not in text + and 'RTLMeter: +max_cycles reached, exiting' in text and spec.get('successMarker', 'TEST PASSED') not in text and control_cycles.exists() and control_cycles.read_text().strip() == '1'): row['negativeControl'] = 'passed' else: @@ -245,7 +251,7 @@ def save(): stdout = ''.join(p.read_text(errors='replace') for p in sorted((directory / 'logs').glob('*.log'))) cycles = directory / '_rtlmeter_cycles.txt' try: - count = accept(stdout, cycles.read_text() if cycles.exists() else '', outcome, spec['payload']) + count = accept(stdout, cycles.read_text() if cycles.exists() else '', outcome, spec['payload'], spec.get('successMarker', 'TEST PASSED')) if count >= spec['maxCycles']: raise ValueError('Workload reached the cycle limit instead of completing normally') row['samples'].append({'status': 'passed', 'processNs': outcome['elapsedNs'], 'cycles': count}) diff --git a/scripts/tests/test_rtlmeter_bench.py b/scripts/tests/test_rtlmeter_bench.py index 915fb738011..ba72f5d3d07 100644 --- a/scripts/tests/test_rtlmeter_bench.py +++ b/scripts/tests/test_rtlmeter_bench.py @@ -37,6 +37,58 @@ def test_verilator_times_build_and_run_in_both_modes(self): with self.assertRaisesRegex(ValueError, 'no global two-state'): bench.commands('xezim', 'two-state', spec, Path('/source/files.f'), Path('/build'), binaries, []) + def test_e203_uses_its_own_success_and_failure_markers(self): + outcome = {'exitCode': 0, 'timedOut': False} + text = 'Hello World from HummingbirdV2 E203\nTEST_PASSED\n' + payload = bench.MANIFEST['cases']['e203']['payload'] + self.assertEqual(bench.accept(text, '3000', outcome, payload, 'TEST_PASSED'), 3000) + for output in [text.replace('TEST_PASSED', 'TEST PASSED'), + text + 'TEST_FAILED\n', text + 'Time Out !!!\n', + text + 'TEST_PASSED\n', text.replace(payload, '')]: + with self.subTest(output=output), self.assertRaises(ValueError): + bench.accept(output, '3000', outcome, payload, 'TEST_PASSED') + + def test_descriptor_default_defines_reach_every_simulator(self): + # Like E203, this descriptor supplies FF delays via its default + # configuration. Keep the source unmodified and assertions enabled. + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + design = root / 'designs/HummingbirdV2-E203' + (design / 'src').mkdir(parents=True) + (design / 'tests/hello').mkdir(parents=True) + (root / 'rtl').mkdir() + for path in ['src/tb.v', 'tests/hello/program.hex']: + (design / path).write_text('test fixture') + for path in ['__rtlmeter_utils.sv', '__rtlmeter_top_include.vh']: + (root / 'rtl' / path).write_text('test fixture') + (design / 'descriptor.yaml').write_text(""" +compile: + verilogSourceFiles: [src/tb.v] + topModule: tb + mainClock: tb.clk +execute: + tests: + hello: + files: [tests/hello/program.hex] +configurations: + default: + compile: + verilogDefines: + RTLMETER_FF_DELAY: '#1' + nodelay: + compile: + verilogDefines: + RTLMETER_FF_DELAY: '' +""") + spec = bench.specification('e203', root) + self.assertEqual(spec['defines'], {'RTLMETER_FF_DELAY': '#1', '__RTLMETER_MAIN_CLOCK': 'tb.clk'}) + self.assertEqual(spec['files'], [design / 'tests/hello/program.hex']) + binaries = {engine: engine for engine in bench.ENGINES} + for engine in bench.ENGINES: + command = bench.commands(engine, 'four-state', spec, root / 'files.f', root / 'build', binaries, [])[0] + self.assertIn('-DRTLMETER_FF_DELAY=#1', command) + self.assertFalse(any('DISABLE_SV_ASSERTION' in arg or 'shared_always_temporary' in arg for arg in command if isinstance(arg, str))) + def test_cold_build_directory_cannot_be_reused(self): with tempfile.TemporaryDirectory() as directory: with bench.build_directory(Path(directory), 'sample') as first:
SimulatorStateStatusDetails