drt: LEF58_SPACING ENDOFLINE MINLENGTH l TWOSIDES is checked one-sided (io passes the TWOEDGES flag as TWOSIDES)

Đang mở Phù hợp với người mới
#12,173 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@osamahammad21 đang làm issue này rồi.

Từ ngày 10/11/2026.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
backend, databases

Hướng nghiên cứu

Đọc khối chuyển đổi trong src/drt/src/io/io.cpp xử lý isMinLengthValid() || isMaxLengthValid(), sau đó lần theo cách cờ two-sides được truyền đến checkMetalEndOfLine_eol_hasMinMaxLength. Như đã gợi ý, thay đổi hai lời gọi setLength để dùng cờ cho TWOSIDES. Chạy lại trường hợp tái hiện LEF/DEF được cung cấp và xác nhận trường hợp TWOSIDES không báo vi phạm, còn trường hợp chỉ có một phía vẫn báo một vi phạm.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug drt
Describe the bug

For a LEF58_SPACING end-of-line rule with MINLENGTH minLength TWOSIDES, an end-of-line edge
should qualify only when both of its side edges are at least minLength long. drt instead
qualifies it when either side edge is long enough, i.e. it ignores TWOSIDES.

odb parses the clause correctly: maxminlengthParser in lefTechLayerSpacingEolParser.cpp sets
setMinLengthValid / setMinLength and, for TWOSIDES, setTwoSidesValid(true). But when drt
converts the rule (src/drt/src/io/io.cpp, the isMinLengthValid() || isMaxLengthValid() block),
it passes rule->isTwoEdgesValid() as the two-sides argument:

len->setLength(false, rule->getMinLength(), rule->isTwoEdgesValid());
...
len->setLength(true, rule->getMaxLength(), rule->isTwoEdgesValid());

isTwoEdgesValid() is the PARALLELEDGE … TWOEDGES flag, so checkMetalEndOfLine_eol_hasMinMaxLength
sees isTwoSides() == false unless the rule also has PARALLELEDGE … TWOEDGES. The MAXLENGTH
branch is affected the same way. Presumably isTwoSidesValid() was intended.

Expected Behavior

In the repro below, net a ends in a 50 nm end whose side edges are 80 nm and 30 nm long, 60 nm
in front of net b. With MINLENGTH 0.05 TWOSIDES the 30 nm side is shorter than 0.05, so the end
does not qualify and there is no end-of-line violation.

To Reproduce

tech.lef (synthetic):

VERSION 5.8 ;
BUSBITCHARS "[]" ;
DIVIDERCHAR "/" ;
UNITS
  DATABASE MICRONS 1000 ;
END UNITS
MANUFACTURINGGRID 0.005 ;
LAYER M1
  TYPE ROUTING ;
  DIRECTION HORIZONTAL ;
  PITCH 0.1 ;
  WIDTH 0.05 ;
  SPACING 0.05 ;
END M1
LAYER V1
  TYPE CUT ;
  SPACING 0.05 ;
  WIDTH 0.05 ;
END V1
LAYER M2
  TYPE ROUTING ;
  DIRECTION VERTICAL ;
  PITCH 0.1 ;
  WIDTH 0.05 ;
  SPACING 0.05 ;
  PROPERTY LEF58_SPACING "SPACING 0.08 ENDOFLINE 0.06 WITHIN 0.025 MINLENGTH 0.05 TWOSIDES ;" ;
END M2
END LIBRARY

repro.def:

VERSION 5.8 ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
DESIGN eol_minlength ;
UNITS DISTANCE MICRONS 1000 ;
DIEAREA ( 0 0 ) ( 3000 3000 ) ;
GCELLGRID X 0 DO 2 STEP 3000 ;
GCELLGRID Y 0 DO 2 STEP 3000 ;
TRACKS Y 50 DO 30 STEP 100 LAYER M1 ;
TRACKS X 50 DO 30 STEP 100 LAYER M2 ;
NETS 2 ;
- a + ROUTED M2 ( 1550 2000 ) ( * 1100 ) ( 1580 * ) ;
- b + ROUTED M2 ( 1690 925 ) ( * 1275 ) ;
END NETS
END DESIGN

run.tcl:

read_lef tech.lef
read_def repro.def
set_thread_count 1
drt::check_drc -output_file drc.rpt

openroad -exit -no_init run.tcl, OpenROAD 4155ac3101.

Result for three versions of the M2 rule (only the MINLENGTH clause changes):

clause violations expected
MINLENGTH 0.05 TWOSIDES 1 (Lef58SpacingEndOfLine, nets a b, bbox (1.6050, 1.0750) - (1.6650, 1.1250)) 0
MINLENGTH 0.05 1 (same) 1
MINLENGTH 0.1 0 0

The TWOSIDES run reports exactly what the one-sided run reports. The MINLENGTH 0.1 run shows
the clause itself is read (neither side is 100 nm long).

With a trace print in checkMetalEndOfLine_eol_hasMinMaxLength, the end above reaches it with
prev=80 next=30 minLength=50 isTwoSides()=0 for the TWOSIDES rule. Adding
PARALLELEDGE 0.1 WITHIN 0.2 TWOEDGES to the rule makes isTwoSides() read 1.

Relevant log output
violation type: Lef58SpacingEndOfLine
	srcs: net:a net:b
	bbox = (1.6050, 1.0750) - (1.6650, 1.1250) on Layer M2

No warnings are printed while reading the LEF.

Suggested Solution

In io.cpp, pass rule->isTwoSidesValid() instead of rule->isTwoEdgesValid() to both
setLength calls.

Additional Context

Found while checking end-of-line rules on a synthetic design; the repro above is all synthetic.

Ngôn ngữ chính
Verilog
Star
3.4k
Fork
1.1k
Merge trung bình
3 ngày 11 giờ
Pull request đã merge (30 ngày)
247

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của The-OpenROAD-Project/OpenROAD

Tất cả issue của The-OpenROAD-Project/OpenROAD

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.