Skip to content

Label logic driver source + kind in hovers#388

Open
evanwporter wants to merge 8 commits into
hudson-trading:mainfrom
evanwporter:driver-info
Open

Label logic driver source + kind in hovers#388
evanwporter wants to merge 8 commits into
hudson-trading:mainfrom
evanwporter:driver-info

Conversation

@evanwporter

@evanwporter evanwporter commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Closes #351

Copied from MikePopoloski/slang#1861

Within SystemVerilog the logic keyword is somewhat unique in that its meaning isn't wholly contained within the declaration ("meaning" isn't quite the right word here but hopefully you get my point :) ).

Consider (FYI: I used chatgpt to generate the following examples):

1. logic assigned by a continuous assignment

module ContinuousLogic (
    input logic a,
    output logic q
);
    assign q = a;
endmodule

2. logic assigned as combinational logic

module CombinationalLogic (
    input logic a,
    input logic b,
    output logic q
);
    always_comb begin
        q = a & b;
    end
endmodule

3. logic assigned as a latch

module LatchLogic (
    input logic en,
    input logic d,
    output logic q
);
    always_latch begin
        if (en)
            q = d;
    end
endmodule
module InferredLatchLogic (
    input logic en,
    input logic d,
    output logic q
);
    always_comb begin
        if (en)
            q = d;
        // q is not assigned when en is false
    end
endmodule

4. logic assigned as a register / flip-flop

module RegisterLogic (
    input logic clk,
    input logic d,
    output logic q
);
    always_ff @(posedge clk) begin
        q <= d;
    end
endmodule

In all 4 examples q is a variable, however the exact way that q is set changes in each example.

To this end this PR attemps to add an additional piece of info to the hovers that distinguishes between each of the different ways q can be set--ie: as a latch, net or register.

Images:

image

Comment thread src/Hovers.cpp Outdated
@evanwporter evanwporter marked this pull request as ready for review June 10, 2026 19:34
@toddstrader

Copy link
Copy Markdown
Collaborator

This makes more sense to me re: terminology. I'll leave it to @AndrewNolte to opine on the implementation.

Comment thread include/document/ShallowAnalysis.h Outdated
Comment thread src/Hovers.cpp Outdated
Comment thread src/Hovers.cpp Outdated
@evanwporter evanwporter requested a review from AndrewNolte June 11, 2026 18:25
Comment thread src/Hovers.cpp Outdated
@evanwporter evanwporter requested a review from AndrewNolte June 11, 2026 18:56
@AndrewNolte

Copy link
Copy Markdown
Collaborator

Sorry did a big refactor here for hover logic- #339

@evanwporter

evanwporter commented Jun 15, 2026 via email

Copy link
Copy Markdown
Contributor Author

@evanwporter evanwporter marked this pull request as draft June 16, 2026 17:32
@evanwporter

Copy link
Copy Markdown
Contributor Author

it works but the way that the extraDisplayNode and the ShallowAnalysis is passed around could be improved

@evanwporter evanwporter changed the title Label driver source + kind in hovers Label logic driver source + kind in hovers Jun 16, 2026
@evanwporter evanwporter marked this pull request as ready for review June 16, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

distinguish net vs register in hovers

3 participants