Skip to content

drw/drf suboptimality #453

@Nic30

Description

@Nic30

Description:
For larger nets some trivial cases do not optimize. with drw/drf while they do with rw/rf

  • using latest master 474e7fb, gcc 15.2.0, Ubuntu 25.10

Input formulas:

a = n1
b = n2
c = n3
n17 =  (a ^ ((b & a) & a)) ^ 1
n23 = (a & b) | (c & ~b)
n26 = (c | a) & ~(c & b)
Image

script:

 resyn2; compress2;  resyn2; compress2;
 # with replaced:  
 #   rf -> drf,-l
 #   rw -> drw,-l

replaced as suggested by YosysHQ/yosys#4039


Expected output (output with the original rf, rw in opt. script):

n17 = ~a | b
Image

Actual output for n17:

n17 = ~(a & ~(a & b))
Image
  • Doing more optimization rounds does not help.
  • Removing n23 or n26 will "fix" the issue.
  • DRefactor fExtend=true seems to fix this (but by adding more formulas it can be broken again)

Is this an expected behavior?

Is this a limitation of drf/drw or I am doing something incorrectly, or is there some parameter like nCutsMax which needs tweaking to achieve same behavior as rf/rw?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions