[LVS] Reading invalid SPICE netlist silently fails

Đang mở
#2,166 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp, ruby
Lĩnh vực
tooling

Hướng nghiên cứu

Start with the netlist.read call in src/lvs/lvs/built-in-macros/_lvs_netter.rb around line 951 and the exception-raising code in src/db/db/dbNetlistSpiceReader.cc around lines 485–511. Reproduce the issue with the SPICE netlist in the report and trace how parser errors cross the C++/Ruby interface. Done means the invalid input no longer fails silently and the error is handled appropriately.

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

Mô tả

It seem that the LVS schematic function used to parse a spice file does not handle errors properly.

More specificaly, it seems the netlist.read call cannot fail:

https://github.com/KLayout/klayout/blob/ec5de0ffe83ed0e51c64473b0bef0c8bf140d87b/src/lvs/lvs/built-in-macros/_lvs_netter.rb#L951

Interestingly enough, exceptions are raised in the read function:

https://github.com/KLayout/klayout/blob/ec5de0ffe83ed0e51c64473b0bef0c8bf140d87b/src/db/db/dbNetlistSpiceReader.cc#L485-L511

The problems seems to come from the c++/ruby interface, where exceptions generated in c++ are not caught in ruby. Unfortunately, I do not have the skills to debug this much further.

A simple way to reproduce the error is to load the following SPICE file for an LVS comparison. You will see that only the first resistor is parsed, whereas the second is not present (due to the spice parser throwing on the "&%ç%&*+£à° line

.subckt top A B sub
R1 A B
"&%ç%&*+£à°
R2 A B
.ends
Ngôn ngữ chính
C++
Star
1.2k
Fork
305
Merge trung bình
3 ngày 2 giờ
Pull request đã merge (30 ngày)
11

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 KLayout/klayout

Tất cả issue của KLayout/klayout

Issue tương tự

Thêm issue về C++

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.