Coverage gaps L3, L6, L10: six language shapes, randsequence as real nodes, an opt-in uvm_field_* indent
TODO §54 (docs/features/coverage-gaps-l); closes docs/coverage_gaps.md L3, L6 and L10. The first dev stalled under machine load; a second finished from the tree. 54.1 `->>` with optional delay or event control (`StmtKind::EventTrigger`), stream `with [range]` (`ExprKind::StreamWith`), the LRM's other `casting_type`s, drive strength on a net declaration (`DataDecl::strength`, whose comment slots also fix a pre-existing refusal on an `assign` with a comment before its strength), `let` at statement position (`StmtKind::Let`), and `#(min:typ:max)` clocking skews — `ClockingSkew` as the LRM's two alternatives, `edge [delay]` | `delay` (review rework of QA's HIGH). Comment slots added to `let`, stream concatenations and the clocking grammar; the RTL gap fuzzer at 505 gaps, zero failing. 54.2 `randsequence` (it was a parse error; the keyword is new): `RandSequence` → `Production` → `Alternative` → `ProdItem` (ref, block, if, repeat, case, rand join), code blocks by the statement grammar; one production per line, alternatives aligned; the LRM's examples as cases. 54.3 `[format] uvm-utils-indent` / `lucisv.format.uvmUtilsIndent`, default off, tracking nested `_begin`/`_end` pairs; 21 corpus files change with it on, all idempotent. A short comment-free enum body already one-lines, so no key was built — the behaviour is pinned. `[format]` table tests added (review rework). `->>`'s event control is bound through the shared `bind_timing` (review rework of QA's second HIGH). 0 of 820 corpus files differ from 0.48.x with the key off; the opentitan sweep is identical; no corpus or opentitan file writes any of the new shapes. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
e1679bebc5
commit
a69a1cb528
69 files changed
+3660
-127
No files matched your search
@@ -340,7 +340,7 @@ impl<'a> Fmt<'a> {
|
||||
pub(super) fn gate_instantiation(&self, g: &GateInstantiation) -> Doc {
|
||||
let mut docs = vec![text(g.gate.clone())];
|
||||
if let Some(s) = &g.strength {
|
||||
docs.push(text(format!(" {}", drive_strength(s))));
|
||||
docs.push(drive_strength(self, s));
|
||||
}
|
||||
if !g.delay.is_empty() {
|
||||
// The gap in front of the `#` is a space unless the source wrote
|
||||
@@ -439,10 +439,45 @@ fn holds_verbatim_value(list: &[ListElem<Connection>]) -> bool {
|
||||
})
|
||||
}
|
||||
|
||||
/// `(weak0, pull1)`, or the single-strength `(weak1)` a pull gate may write.
|
||||
pub(super) fn drive_strength(s: &DriveStrength) -> String {
|
||||
match &s.second {
|
||||
Some(second) => format!("({}, {})", s.first, second),
|
||||
None => format!("({})", s.first),
|
||||
/// `(weak0, pull1)`, or the single-strength `(weak1)` a pull gate may write —
|
||||
/// with the comments written in any of its five gaps back where they stood.
|
||||
///
|
||||
/// The gap in front of the `(` is the strength's own (`assign /*c*/ (weak0,
|
||||
/// pull1) x = y;`), so — exactly as a net delay's `before_hash` is — this
|
||||
/// prints the separator that precedes the `(` too: the comments when the
|
||||
/// source wrote any there, and a plain space when it did not. A caller emits
|
||||
/// nothing of its own in front of the call.
|
||||
pub(super) fn drive_strength(fmt: &Fmt<'_>, s: &DriveStrength) -> Doc {
|
||||
let c = &s.comments;
|
||||
if c.before_open.is_empty()
|
||||
&& c.after_open.is_empty()
|
||||
&& c.before_comma.is_empty()
|
||||
&& c.after_comma.is_empty()
|
||||
&& c.before_close.is_empty()
|
||||
{
|
||||
return match &s.second {
|
||||
Some(second) => text(format!(" ({}, {})", s.first, second)),
|
||||
None => text(format!(" ({})", s.first)),
|
||||
};
|
||||
}
|
||||
let mut docs = Vec::new();
|
||||
match c.before_open.is_empty() {
|
||||
true => docs.push(text(" ")),
|
||||
false => fmt.inline_comments_spaced(&c.before_open, &mut docs),
|
||||
}
|
||||
docs.push(text("("));
|
||||
fmt.slot_comments(&c.after_open, &mut docs);
|
||||
docs.push(text(s.first.clone()));
|
||||
if let Some(second) = &s.second {
|
||||
fmt.slot_comments(&c.before_comma, &mut docs);
|
||||
docs.push(text(","));
|
||||
match c.after_comma.is_empty() {
|
||||
true => docs.push(text(" ")),
|
||||
false => fmt.inline_comments_spaced(&c.after_comma, &mut docs),
|
||||
}
|
||||
docs.push(text(second.clone()));
|
||||
}
|
||||
fmt.slot_comments(&c.before_close, &mut docs);
|
||||
docs.push(text(")"));
|
||||
concat(docs)
|
||||
}
|
||||
Reference in new issue
Block a user