Repository navigation
Match a disable target by the last segment of its path (§9.6.2) - #967
philipaxer wants to merge 16 commits into
Conversation
The object model builds the tree on its own parse and reads each construct's implicit name. A directly nested branch opens no generate scope; its inner blocks are walked in the enclosing scope.
Each HierarchicalIdentifier built by the simulator starts unbound. The audit variable is listed in the env var registry.
…§23.9) The function declaration built for a compiled task carries the task's `decl`.
… §13.5.3, §18.7, §18.12, §3.12.1) New `generate_block_hiding` runs programs where an inner scope hides a block's subroutine, and programs where a name still binds to it. `bind_audit` expects `target=` on each line and no rename of the hidden name, which no longer disagrees.
…l block, gate, property, sequence, let and constraint (§23.9, §8, §9.2.3, §11.13, §16.12, §18.5.11, §28) The bind audit test's final-block call now reads as renamed to g.f, with no group.
…11, §26.3) Ten programs: a child in a block, a block function before the module's, a parent instance's before the top's, generate loops in an instance, nested and unlabelled blocks, a grandchild and a bound instance, task enables, function bodies and continuous assigns of the child. The child's unit and imports come first, a parent's import is not visible, rooted and dotted calls are unchanged. The bind audit prints where each upward call resolves.
|
Integrated by cherry-pick with @philipaxer's authorship preserved, as the whole series: xezim-core 38f31c3…d802056 (core #171–#183) and xezim 163df958…554812e6 (#962–#981). Each layer has a code commit and a test commit, with #952 in the subjects. The per-layer "Sync core revision" commits were replaced by one sync to the final core revision. Follow-ups for gaps found in review, each checked against the reference simulator:
Two cases are left: a Published in xezim 603c9bf3 with xezim-core 212dde0. |
Part 6 of the series for #952, which replaces name-string scoping in generate blocks with a scope tree and a binder.
Depends on #966: until that merges, this branch also shows its commits. New here:
6e8723feMatch a disable target by the last segment of its path (§9.6.2)06182740Test disable by path, by label and upward (§9.6.2, §23.8.1, §23.9, §27.4)1d465e90Sync core revisionCore side: aionhw/xezim-core#176 (pinned at
52eedb4; the last commit, "Sync core revision", sets the pin).Changes:
disablenow carries a path. The interpreter, the bytecode compiler and the fallback scan read its name throughdisable_name, which returns the last segment. Core writes a resolved task as one segment, its key. Any other target is read as the name the parser used to keep, so the run time matches it as before. No other lookup changes.Tests:
tests/hierarchy/disable_targets.rs: 14 programs. A path to a block task, from the module, another block, a nested block, a loop index and inside an instance. A block task in an instance. A child's upwarddisable. Labels that hide a block task. A path-called task disabling itself. A named block by path from another process. Where Verilator runs a program, the value is cross-checked with it.The results and what is not covered are in the core PR.
Tests after the rebase onto main
Rebased onto core
5b0b02eand xezim2e4e7f99. The results above were measured before the rebase, against the previous PR of the series.cargo test: 475 passed, 0 failed.cargo test --release --test hierarchy(built without LTO): 854 passed, 0 failed.The series
This PR is one part of a stacked series for #952. This section is the same in every part, so each PR can be read on its own.
Problem. A generate block is a scope (§23.9, §27.5, §27.6), but xezim resolved names in generate blocks by string. The elaborator renamed declarations textually (
f→g.f) from per-block name lists, and the simulator retried a missed name by its last segment at run time. Each fix to that scheme, including the one for #897, broke other legal programs: a local hiding a block function was renamed anyway, items outside the copied list kept the bare name, two unlabelled blocks with the same variable collided, a child instance's call reached the wrong parent, anddisable g.tmatched by leaf.Approach.
scope_tree.rs).elaborate/bind.rs).g.f,u.g[1].x,genblk2.t) are the keys the runtime already uses, so xezim needs almost no source change.XEZIM_BIND_AUDIT=1prints each binding next to what the rename did, so every disagreement can be listed.Parts (core / xezim; each depends on the one before and repeats its commits until that merges):
genblk<n>, §27.6 zero padding, §27.5 direct nesting) come from itdisableby path and by label is bound like other names (§9.6.2)genblk<n>Independent of the series: #969 (time scope and clocking of a block in an instance) and #970 (a subroutine with no written lifetime stays static on the compiled tier).
Still to come.
The run-time retries by leaf name stay. They serve shapes the binder cannot decide before the run (a class method calling its instance's task,
g[k].f()with a variable index, virtual interfaces) and name resolution outside generate blocks (interface ports,$root, packages).Size so far (parts 1 to 13 against main): core +4,476/-1,066 outside tests (net +3,410), +2,458 tests; xezim +198/-101 outside tests, mostly the core pin, +3,550 tests.
Testing. Every part passed the full xezim suite and the core suite before the rebase onto main. After the rebase, part 7 passed the full suites on main, and parts 8 to 13 passed the
hierarchyand core suites. CI runs the rest. Each part's audit and artifact identity against the previous part are in its own text. Expected values come from IEEE 1800-2023 and are checked against Verilator 5.055 where it accepts the program.Review order. Parts 1 and 2 are the base; the rest read from them. Reviewing those two first settles the direction.