• v0.60.0
    ci / checks (push) Successful in 1m37s
    ci / corpus (push) Successful in 36s
    release / build-and-publish (push) Successful in 8m2s
    Stable

    lucio released this 2026-10-08 01:18:14 -07:00 | 55 commits to master since this release

    Rename and references through a generate block label

    TODO §65.1, topo §2.9 row 43 (MCP-14). (docs/features/generate-label-rename.)

    • rename of a block label rewrites every path through it. Renaming
      g_lane in for (…) begin : g_lane used to rewrite the label alone,
      leaving g_lane[0].lane_q (and u_x.g_lane[1].sig in another file)
      naming a block that no longer existed, with no warning. The label, its
      closing end : g_lane, and every path segment naming the block — bare,
      indexed (g[0].x, g[i].x), nested (g_a.g_b[2].x), behind an instance
      path from another file — are now one reference set, renamed all or
      nothing; a spelling inside macro text or a string is a warning. A name
      declared inside a block is likewise renamed through such a path. Named
      procedural blocks: begin : lbl, end : lbl and disable lbl; (and the
      lbl: begin … end : lbl form) are one set.
    • find_references (LSP textDocument/references, lucisv-mcp find refs) lists the declaration, the closing label and every segment, same
      file and cross-file, with the declaring file open or closed.
    • lucisv-mcp rename no longer refuses a block-kind declaration.
    • Resolution changes every consumer sees: a for generate block's label is a
      name of the enclosing module (its genvar is not); generate … endgenerate
      is not a scope; blk.x and arr[0].field (a packed struct array) resolve
      their tails; an unnamed genblk1 still names nothing. The index cache
      format moves to 21, so a 0.59.0 cache is rebuilt once.
    • A rename says so when a path it cannot resolve spells the name: a
      hierarchical path segment in any file of the rename's set that resolved to
      no declaration (tb.dut.gen_x[0].q, rooted at a top module) is left
      unchanged and warned about with its lines, for every kind of declaration;
      and renaming a member one arm of a generate if/case declares warns
      about the same-named member of the arm sharing its label.
    • duplicate-declaration now also reports a block label beside a net,
      variable, parameter or instance of the same name, and such a label is no
      longer counted as a read of the net.
    • Rename and port warnings name a file by its path whenever another file of
      the set shares its base name (two pwrmgr_if.sv are two findable lines,
      root-relative in lucisv-mcp), and a line a path warning names is not
      repeated under unresolved:. Same-named members are warned about through
      every enclosing same-label generate arm (g.h.x), and an escaped name's
      unresolved paths are found too.
    • Rename warnings and mentions are about the renamed declaration. For a
      member of a module or interface (a net, variable, port, parameter, block,
      …), a bare spelling of its name in a macro argument, a `define body, an
      unstructured assertion, a comment or a string is reported only where it can
      mean it: in the declaration's home set — the declaring file,
      everything it `includes, whatever includes it (transitively), and the
      files the rename edits. In code, a spelling in the declaring file is
      reported after a scope lookup finds the declaration there (an instantiating
      module's own same-named signal is not); one in an included fragment always;
      a `define body when the macro is invoked from the home set (through
      other macros too — ASSERT_DEFAULT_CLK's clk_i); a macro argument inside
      a bind into the declaring module; and a bare use in the plain code of an
      included fragment (prim_util_memload.svh's mem) is named as a use the
      rename could not edit. Reported wherever they are written: a dotted
      spelling (.state_q, a possible hierarchical path); a bare macro argument
      the macro carries to the declaration — after a . ( `CONN(state_q)
      building .state_q(state_q), `FORCE(state_q) building
      force u_m.state_q), into a bind into the declaring module, or into a
      macro lucisv has no definition of; and the body of a macro that expands to
      such a bind. Not reported: a body whose spellings are only its own
      parameter named like the declaration (unless the body also spells the name
      after a ., or a default argument spells it), and a backtick inside a
      string. Any doubt means no scoping: a module, interface, package or
      package member, a declaration outside a module, or one whose home set holds
      an include lucisv cannot resolve (a macro-built name, a file outside the
      project such as uvm_macros.svh) is reported everywhere as before. On
      opentitan the state_q rename's answer went from 274 lines (61 kB, 230
      macro warnings, 229 about other modules) to about 72 lines (12 kB),
      hmac_core.StIdle's from 48 lines to 3.
    • duplicate-declaration also reports a block label beside a port, genvar,
      typedef, function or task, and two named procedural blocks of one label in
      one scope.
    • lucisv-mcp rename with many warnings is fast again: rooting the warning
      paths was quadratic per warning (a state_q rename on opentitan: 125 s →
      3.3 s). Naming the files in warnings no longer scans the whole set once per
      file either: the engine's part of that rename went from 2.9 s to 2.2 s.
    • A use in a file that includes the declaring file (or that it includes) is
      no longer reported as "left unchanged" when the rename did rewrite it —
      renaming a module whose instantiation sits in a file included beside it
      said so wrongly.
    Downloads