-
XuanTie-{{ entry.rtlmeter!.case.toUpperCase() }} · latest qualification
+
{{ rtlmeterDesignName(entry.rtlmeter!.case) }} · latest qualification
Raw logs and versions · {{ entry.cpu }} · {{ new Date(entry.date).toLocaleDateString() }}
| Simulator | State | Status | Details |
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/guide/celox-toml.md b/docs/guide/celox-toml.md
index 5a8c51d7b07..dfa0926a6ab 100644
--- a/docs/guide/celox-toml.md
+++ b/docs/guide/celox-toml.md
@@ -207,6 +207,23 @@ The Rust `.allow_inferred_latches(true)` and JavaScript `allowInferredLatches: t
options provide `allow` only when this diagnostic has no explicit setting;
an explicit `error`, `warn` or `allow` takes precedence.
+`shared_always_temporary` defaults to `error`, which keeps IEEE 1800-2023
+semantics for a variable that several `always @*` blocks write, such as a loop
+index they share: each block waits on the variables it reads, the shared one
+included (§9.4.2.2), and writes notify other blocks that are waiting. For an
+isolated index written before reads, Celox may run other Active work after the
+body and before the next implicit wait (§4.7, §4.9.3). Shared storage and event
+notifications remain; sharing alone does not require nonconvergence. Blocks that keep waking
+each other end the run with `time T does not settle`, which names the blocks.
+With `warn` or `allow`, Celox instead makes such a variable a temporary of each
+block, when only `always @*` blocks write it, each writes it before it reads it
+on every path, and nothing else reads it: no other process, continuous
+assignment, subroutine, port, instance connection or hierarchical name. Its
+writes then wake no other block, as in Icarus Verilog, and the variable itself
+keeps its initial value. This deviates from the standard, so it is not the
+default; `warn` reports each variable and its blocks. Declaring the variable
+inside each block keeps the standard semantics without it.
+
Project simulator constructors load this table alongside `Veryl.toml`. Native
compilation also supports standalone SystemVerilog projects:
diff --git a/docs/guide/systemverilog-reference.md b/docs/guide/systemverilog-reference.md
index b90081ad47b..aab1c2919d6 100644
--- a/docs/guide/systemverilog-reference.md
+++ b/docs/guide/systemverilog-reference.md
@@ -58,6 +58,7 @@ In a timed `Simulation`, `initial` and plain `always` processes can suspend:
| `#delay` | integral and real delays, `#(min:typ:max)` (the typical value), package-scoped values such as `#pkg::D`, and [time literals](#time-literal-delays); an X or Z delay counts as zero |
| `@(...)` | variables, `posedge` / `negedge` / `edge`, items joined by `or` or `,`, bit, part and run-time index selects, any expression including calls of pure functions, `iff` conditions on items (not in `always_ff`), and `@*` / `@(*)`, which waits on the variables its statement reads |
| `wait (condition)` | any condition; an X or Z condition counts as false |
+| Delayed nonblocking assignments | `lhs <= #constant rhs` in `initial` and ordinary `always`, for integral constant delays and time literals. The value and destination position are captured immediately; the update is queued in the NBA region of the target time without suspending the caller (IEEE 1800-2023 10.4.2). Pending updates survive checkpoints and state files. |
| Assignments | blocking and nonblocking, to any target a blocking assignment takes, including unpacked array elements and run-time positions; nonblocking updates take effect in the NBA region of the time slot, at the position evaluated when the assignment executes, and bits outside the target or at a position with an X or Z bit are not written |
An `always` whose sensitivity list names exactly the variables its statement
@@ -361,7 +362,7 @@ it. The error carries the number of the issue that tracks the construct;
constructs without a dedicated issue point to the frontend roadmap, [#88](https://github.com/celox-sim/celox/issues/88).
- Class features beyond those [listed](#classes): `$cast` to a variable that is not a class handle, anonymous enumeration, struct and union types and named four-state or string constants of a module or package as class parameter values (a class passes its own such parameters on by name), module-local classes as type arguments to package-class specializations, properties that are `real` or arrays, reads of bit and part selects of a property not declared `[N-1:0]`, selects of a member of a property of unpacked structure type, packed structure members of a property, properties as `output` or `inout` arguments, and randomization or constraints over 4-state properties. Recursive calls remain unsupported.
-- Behavioral and verification constructs: intra-assignment timing controls (`a = #1 b`),
+- Behavioral and verification constructs: nonblocking intra-assignment event controls and nonconstant delays,
delayed continuous assignments ([#444](https://github.com/celox-sim/celox/issues/444)),
`wait fork` / `disable fork`, temporal concurrent assertions beyond the Boolean subset below, `force` / `release`.
- Named events beyond those [listed](#named-events): arrays of events, event ports,
diff --git a/docs/guide/systemverilog.md b/docs/guide/systemverilog.md
index 7ca5e547568..157e73f8106 100644
--- a/docs/guide/systemverilog.md
+++ b/docs/guide/systemverilog.md
@@ -103,7 +103,7 @@ ports, types, statements or system functions before porting a design.
Common reasons a design needs changes are:
- Class-based verification beyond [simple classes](./systemverilog-reference#classes) and concurrent assertions beyond the [single-cycle Boolean subset](./systemverilog-reference#concurrent-assertions).
-- `fork` / `join`, intra-assignment timing such as `a = #1 b`
+- `fork` / `join`, nonblocking intra-assignment event controls and nonconstant delays
and `iff` in `always_ff` event controls ([#452](https://github.com/celox-sim/celox/issues/452)).
- Nonblocking latch assignments, multiple drivers and tri-state buses. Inferred latches in `always_comb` require `inferred_latch = "warn"` or `"allow"` in the common `[diagnostics]` configuration.
- Non-ANSI module ports, wildcard `.*` connections, gate primitives with delays, strengths or instance arrays, and `bind`.
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/docs/ja/guide/celox-toml.md b/docs/ja/guide/celox-toml.md
index 6443f46cdad..243dbf44feb 100644
--- a/docs/ja/guide/celox-toml.md
+++ b/docs/ja/guide/celox-toml.md
@@ -155,6 +155,10 @@ memory_file_word_count = "error"
Rust の `.allow_inferred_latches(true)` と JavaScript の `allowInferredLatches: true` は、
この診断の明示設定がない場合だけ `allow` を補います。明示した `error`・`warn`・`allow` が優先されます。
+`shared_always_temporary` の既定値は `error` で、共有するループ変数のように複数の `always @*` ブロックが書き込む変数に IEEE 1800-2023 の意味論を適用します。各ブロックは自身が読む変数(共有変数を含む)の変化を待つため(§9.4.2.2)、書き込みは待機中の他のブロックに通知されます。ほかから読まれず読む前に書かれる添字については、本体終了後、次の暗黙のイベント待ちに入る前に他の Active 領域の処理を実行できます(§4.7、§4.9.3)。共有変数の格納とイベント通知は保持し、共有だけを理由に非収束とはしません。互いに起動し続けるブロックは `time T does not settle` で実行を終了し、そのメッセージに該当ブロックが示されます。
+`warn` または `allow` を選ぶと、Celox はそのような変数を各ブロックの一時変数として扱います。対象は、`always @*` ブロックだけが書き込み、各ブロックがすべての経路で読む前に書き込み、ほかに読むもの(他のプロセス、継続的代入、サブルーチン、ポート、インスタンス接続、階層名)がない変数です。その書き込みは Icarus Verilog と同様に他のブロックを起動せず、変数自体は初期値のままになります。
+これは規格からの逸脱なので既定では無効です。`warn` は対象の変数とブロックを報告します。変数を各ブロックの中で宣言すれば、この緩和なしで規格どおりの意味論を保てます。
+
`interface_array_query` の既定値は `error` です。`warn` または `allow` で、固定長の interface 配列と添字で選択した部分配列に対する `$size` を互換拡張として許可します。IEEE 1800-2023 §20.7 の対象はデータ配列であり、interface インスタンスはデータオブジェクトではありません。省略可能な次元引数は既知の整数定数に限ります。この拡張によって interface ハンドルに packed 幅が付いたり、他の配列クエリが使えるようになったりすることはありません。
```toml
diff --git a/docs/ja/guide/systemverilog-reference.md b/docs/ja/guide/systemverilog-reference.md
index 8db85ac8c33..b2885807b1c 100644
--- a/docs/ja/guide/systemverilog-reference.md
+++ b/docs/ja/guide/systemverilog-reference.md
@@ -55,6 +55,7 @@ outline: [2, 3]
| `#delay` | 整数と実数の遅延、`#(min:typ:max)`(typ の値)、`#pkg::D` のような package スコープの値、[時間リテラル](#time-literal-delays)。X / Z の遅延は 0 として扱う |
| `@(...)` | 変数、`posedge` / `negedge` / `edge`、`or` または `,` で並べた項目、ビット選択・部分選択・実行時添字の選択、pure な関数呼び出しを含む任意の式、項目の `iff` 条件(`always_ff` を除く)、文が読む変数を待つ `@*` / `@(*)` |
| `wait (condition)` | 任意の条件。X / Z の条件は偽として扱う |
+| 遅延付きノンブロッキング代入 | `initial` と通常の `always` での `lhs <= #constant rhs`。整数の定数遅延と時間リテラルに対応します。右辺と代入先の位置を即時に評価し、呼び出し元を中断せず指定時刻の NBA 領域で更新します(IEEE 1800-2023 10.4.2)。予約更新はチェックポイントと state file にも保持します。 |
| 代入 | ブロッキング代入とノンブロッキング代入。代入先はブロッキング代入と同じで、unpacked 配列の要素や実行時に決まる位置も使えます。ノンブロッキング代入は代入を実行した時点で評価した位置に、そのタイムスロットの NBA 領域で反映します。代入先の範囲外のビットと、X や Z のビットを含む位置には書き込みません |
文が読む変数をちょうど並べたセンシティビティリスト(`@*` が求めるもの、IEEE 1800-2023 9.4.2.2)を持つ
@@ -239,7 +240,7 @@ unpacked 構造体(IEEE 1800-2023 7.2)のメンバには、整数型、列
ANSI ヘッダーのポートは、クロック入力やパラメータ依存の幅も含めて modport 経由で渡せます。
interface 自体と入れ子の interface は対応しています。型パラメータはインスタンスごとに解決し、modport ポート経由でも伝搬します。
再帰する特殊化と64段を超える入れ子は拒否します。細かな制約は[英語版の一覧](/guide/systemverilog-reference#interface-restrictions)を参照してください。
-- 振る舞い記述・検証向けの構文:`final`、代入内のタイミング制御(`a = #1 b`)、遅延付き継続代入([#444](https://github.com/celox-sim/celox/issues/444))、
+- 振る舞い記述・検証向けの構文:`final`、ノンブロッキング代入内のイベント制御と定数でない遅延、遅延付き継続代入([#444](https://github.com/celox-sim/celox/issues/444))、
`fork` / `join`、`wait fork` / `disable fork`、下記のBoolean部分集合を超える並行アサーション、`force` / `release`。
- [対応範囲](#named-events)を超える named event:event の配列、event のポート、unpacked 構造体の event メンバ、event を返す関数、
`always_comb` / `always_latch` の中の trigger、
diff --git a/docs/ja/guide/systemverilog.md b/docs/ja/guide/systemverilog.md
index cd64eb40245..6b38968a5b6 100644
--- a/docs/ja/guide/systemverilog.md
+++ b/docs/ja/guide/systemverilog.md
@@ -92,7 +92,7 @@ X/Z を扱う場合は builder に `.four_state(true)` を指定します。
デザインの変更が必要になりやすいのは、次の機能です。
- [単純なクラス](./systemverilog-reference#classes)を超えるクラスを使う検証、[単一サイクルBoolean部分集合](./systemverilog-reference#並行アサーション)を超える並行アサーション。
-- `fork` / `join`、`a = #1 b` のような代入内のタイミング制御、
+- `fork` / `join`、ノンブロッキング代入内のイベント制御と定数でない遅延、
`always_ff` のイベント制御の `iff`([#452](https://github.com/celox-sim/celox/issues/452))。
- ラッチ内のノンブロッキング代入、複数ドライバ、トライステートバス。`always_comb` の暗黙のラッチ推論は 共通の `[diagnostics]` 設定で `inferred_latch = "warn"` または `"allow"` を指定して許可します。
- 非 ANSI モジュールポート、ワイルドカード `.*` 接続、遅延・強度指定やインスタンス配列を持つゲートプリミティブ、`bind`。
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: