Skip to content

Conversation

jpienaar
Copy link
Member

@jpienaar jpienaar commented Jul 9, 2025

Handle failure case where the probe was being inserted before def.

Handle failure case where the probe was being inserted before def.
Copy link
Member

@maerhart maerhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines 998 to 1016
hw.module @ProbePostDef() {
%false = hw.constant false
%f = llhd.sig %false : i1
%h = llhd.sig %false : i1
%0 = llhd.prb %h : !hw.inout<i1>
%1 = llhd.prb %f : !hw.inout<i1>
%2 = llhd.combinational -> i1 {
%c7_i32 = hw.constant 7 : i32
%c0_i31 = hw.constant 0 : i31
%false_0 = hw.constant false
%e = llhd.sig %false_0 : i1
%3 = comb.concat %c0_i31, %1 : i31, i1
%4 = llhd.prb %e : !hw.inout<i1>
%5 = comb.icmp ult %3, %c7_i32 : i32
%6 = comb.and %5, %4 : i1
llhd.yield %6 : i1
}
hw.output
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this can probably be trimmed down a bit
I guess something like this is enough to trigger the issue?

hw.module @ProbePostDef() {
  %2 = llhd.combinational -> i1 {
    %false = hw.constant false
    %e = llhd.sig %false : i1
    %4 = llhd.prb %e : !hw.inout<i1>
    llhd.yield %4 : i1
  }
  hw.output
}

Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks for the fix! LGTM with Martin's test tweak 👍

@jpienaar jpienaar merged commit 945019b into llvm:main Jul 10, 2025
3 checks passed
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.

3 participants