Skip to content

Commit

Permalink
Merge pull request #11 from mabrains/lvs_dev2
Browse files Browse the repository at this point in the history
Expanding LVS Testing and Functionality Enhancement
  • Loading branch information
atorkmabrains authored May 15, 2024
2 parents 5770fee + 83e408e commit 7ab000f
Show file tree
Hide file tree
Showing 12 changed files with 331 additions and 12 deletions.
36 changes: 31 additions & 5 deletions ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_reader.lvs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,35 @@

# Custom reader for subcircuit models
class CustomReader < RBA::NetlistSpiceReaderDelegate
# Cleanup sch for R, C elements
def clean_sch(line, element)
line = line.delete('[]$\\/')
# Extracting parameters with values
valid_params = line.scan(/\b\w+=\S+\b/)
case element
when 'R'
# For 2 term res [<nets> <model> <params>]
num_terms = 3
when 'C'
# Determine number of terms based on component type
num_terms =
if line.downcase.include?('varicap')
5
elsif line.downcase.include?('rfcmim')
4
else
3
end
end
line_no_param = line.split(' ').take(num_terms).join(' ')
"#{line_no_param.strip} #{valid_params.join(' ')}"
end

# Override parse_element method to handle exceptions gracefully
def parse_element(line, element)
# Prep sch for R, C
line = clean_sch(line, element) if %w[R C].include?(element)

super
rescue StandardError
case element
Expand Down Expand Up @@ -265,13 +292,11 @@ class CustomReader < RBA::NetlistSpiceReaderDelegate

# Map parameters for a diode device.
def map_diode_params(device, model, params)
if model.downcase.include?('diodev') || model.downcase.include?('schottky') || model.downcase.include?('nmoscl')
device.set_parameter('m', params['M'] || 1.0)
else
unless model.downcase.include?('diodev') || model.downcase.include?('schottky') || model.downcase.include?('nmoscl')
device.set_parameter('A', (params['A'] || ((params['W'] || 0.0) * (params['L'] || 0.0))) * 1e12)
device.set_parameter('P', (params['P'] || (((params['W'] || 0.0) + (params['L'] || 0.0)) * 2)) * 1e6)
device.set_parameter('m', params['M'] || 1.0)
end
device.set_parameter('m', params['M'] || 1.0)
end

# Map parameters for a capacitor device.
Expand All @@ -293,7 +318,8 @@ class CustomReader < RBA::NetlistSpiceReaderDelegate
def map_resistor_params(device, model, params)
if model.downcase.include?('tap')
device.set_parameter('A', (params['A'] || ((params['W'] || 0.0) * (params['L'] || 0.0))) * 1e12)
device.set_parameter('P', (params['P'] || params['PERIM'] || (((params['W'] || 0.0) + (params['L'] || 0.0)) * 2)) * 1e6)
device.set_parameter('P',
(params['P'] || params['PERIM'] || (((params['W'] || 0.0) + (params['L'] || 0.0)) * 2)) * 1e6)
elsif RES_DEV.any? { |res| model.downcase.start_with?(res) }
device.set_parameter('w', (params['W'] || 0.0) * 1e6)
device.set_parameter('l', (params['L'] || 0.0) * 1e6)
Expand Down
5 changes: 3 additions & 2 deletions ihp-sg13g2/libs.tech/klayout/tech/lvs/run_lvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,13 @@ def generate_klayout_switches(arguments, layout_path, netlist_path):
switches = dict()

if arguments["--run_mode"] in ["flat", "deep"]:
switches["run_mode"] = arguments["--run_mode"]
run_mode = arguments["--run_mode"]
else:
logging.error("Allowed klayout modes are (flat , deep) only")
exit()
exit(1)

switches = {
"run_mode": run_mode,
"no_net_names": "true" if arguments.get("--no_net_names") else "false",
"spice_comments": "true" if arguments.get("--spice_comments") else "false",
"net_only": "true" if arguments.get("--net_only") else "false",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*==========================================================================

.SUBCKT cap_cmim
C0 PLUS1 MINUS1 cap_cmim w=6.99u l=6.99u m=1
C0 PLUS1 MINUS1 $[cap_cmim] 74.620f w=6.99u l=6.99u m=1
C1 PLUS2 MINUS2 cap_cmim w=6.99u l=6.99u m=2
C2 PLUS3 MINUS3 cap_cmim w=6.99u l=6.99u m=3

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*==========================================================================

.SUBCKT lvsres
Rm1 net1 net2 lvsres l=1u w=5u
Rm2 net3 net4 lvsres l=1.5u w=5u
Rm3 net5 net6 lvsres length=1u width=6u
Rm1 net1 net2 $[lvsres] 20k l=1u w=5u
Rm2 net3 net4 lvsres \ l=1.5u w=5u
Rm3 net5 net6 lvsres / length=1u width=6u
.ENDS
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,85 @@ R3 p3 p4 rhigh w=0.5e-6 l=40e-6 m=1 b=0
R1 p5 p_intern rhigh w=0.5e-6 l=30e-6 m=1 b=0
R2 p_intern p6 rhigh w=0.5e-6 l=10e-6 m=1 b=0
M1 p_intern G S B sg13_lv_nmos w=0.15e-6 l=0.2e-6 m=1 ng=1

* Extra patterns
R_pattern_1 a_1 b_1 rhigh w=5.85u l=5.4u b=3 ps=0.2u
R_pattern_2 a_2 b_2 rhigh w=1.67u l=9.14u b=6 ps=0.19u
R_pattern_3 a_3 b_3 rhigh w=4.69u l=7.11u b=4 ps=0.19u
R_pattern_4 a_4 b_4 rhigh w=5.02u l=0.82u b=4 ps=0.2u
R_pattern_5 a_5 b_5 rhigh w=0.64u l=6.3u b=2 ps=0.2u
R_pattern_6 a_6 b_6 rhigh w=4.64u l=1.98u b=4 ps=0.19u
R_pattern_7 a_7 b_7 rhigh w=3.93u l=9.34u b=8 ps=0.19u
R_pattern_8 a_8 b_8 rhigh w=5.1u l=3.03u b=9 ps=0.2u
R_pattern_9 a_9 b_9 rhigh w=5.1u l=9.34u b=4 ps=0.2u
R_pattern_10 a_10 b_10 rhigh w=3.93u l=1.98u b=2 ps=0.2u
R_pattern_11 a_11 b_11 rhigh w=4.64u l=6.3u b=4 ps=0.19u
R_pattern_12 a_12 b_12 rhigh w=0.64u l=0.82u b=4 ps=0.19u
R_pattern_13 a_13 b_13 rhigh w=5.02u l=7.11u b=6 ps=0.2u
R_pattern_14 a_14 b_14 rhigh w=4.69u l=9.14u b=3 ps=0.2u
R_pattern_15 a_15 b_15 rhigh w=1.67u l=5.4u b=9 ps=0.19u
R_pattern_16 a_16 b_16 rhigh w=5.85u l=3.03u b=8 ps=0.19u
R_pattern_17 a_17 b_17 rhigh w=1.67u l=3.03u b=2 ps=0.19u
R_pattern_18 a_18 b_18 rhigh w=5.02u l=9.34u b=4 ps=0.19u
R_pattern_19 a_19 b_19 rhigh w=4.64u l=9.14u b=8 ps=0.2u
R_pattern_20 a_20 b_20 rhigh w=5.1u l=5.4u b=4 ps=0.19u
R_pattern_21 a_21 b_21 rhigh w=5.85u l=0.82u b=6 ps=0.19u
R_pattern_22 a_22 b_22 rhigh w=4.69u l=1.98u b=9 ps=0.19u
R_pattern_23 a_23 b_23 rhigh w=0.64u l=7.11u b=3 ps=0.19u
R_pattern_24 a_24 b_24 rhigh w=3.93u l=6.3u b=4 ps=0.19u
R_pattern_25 a_25 b_25 rhigh w=1.67u l=6.3u b=4 ps=0.2u
R_pattern_26 a_26 b_26 rhigh w=3.93u l=7.11u b=4 ps=0.19u
R_pattern_27 a_27 b_27 rhigh w=0.64u l=5.4u b=4 ps=0.19u
R_pattern_28 a_28 b_28 rhigh w=4.69u l=3.03u b=4 ps=0.19u
R_pattern_29 a_29 b_29 rhigh w=5.85u l=9.34u b=2 ps=0.19u
R_pattern_30 a_30 b_30 rhigh w=5.1u l=9.14u b=2 ps=0.19u
R_pattern_31 a_31 b_31 rhigh w=4.64u l=0.82u b=9 ps=0.19u
R_pattern_32 a_32 b_32 rhigh w=5.02u l=1.98u b=3 ps=0.19u
R_pattern_33 a_33 b_33 rhigh w=5.02u l=3.03u b=8 ps=0.19u
R_pattern_34 a_34 b_34 rhigh w=4.64u l=5.4u b=6 ps=0.19u
R_pattern_35 a_35 b_35 rhigh w=5.1u l=7.11u b=8 ps=0.19u
R_pattern_36 a_36 b_36 rhigh w=5.85u l=6.3u b=9 ps=0.19u
R_pattern_37 a_37 b_37 rhigh w=4.69u l=0.82u b=2 ps=0.19u
R_pattern_38 a_38 b_38 rhigh w=0.64u l=9.34u b=9 ps=0.19u
R_pattern_39 a_39 b_39 rhigh w=3.93u l=9.14u b=9 ps=0.19u
R_pattern_40 a_40 b_40 rhigh w=1.67u l=1.98u b=4 ps=0.19u
R_pattern_41 a_41 b_41 rhigh w=1.67u l=0.82u b=3 ps=0.19u
R_pattern_42 a_42 b_42 rhigh w=3.93u l=3.03u b=6 ps=0.19u
R_pattern_43 a_43 b_43 rhigh w=0.64u l=1.98u b=6 ps=0.19u
R_pattern_44 a_44 b_44 rhigh w=4.69u l=5.4u b=8 ps=0.19u
R_pattern_45 a_45 b_45 rhigh w=5.85u l=9.14u b=4 ps=0.19u
R_pattern_46 a_46 b_46 rhigh w=5.1u l=6.3u b=3 ps=0.19u
R_pattern_47 a_47 b_47 rhigh w=4.64u l=7.11u b=2 ps=0.19u
R_pattern_48 a_48 b_48 rhigh w=5.02u l=6.3u b=4 ps=0.19u
R_pattern_49 a_49 b_49 rhigh w=5.02u l=9.14u b=4 ps=0.19u
R_pattern_50 a_50 b_50 rhigh w=4.64u l=9.34u b=3 ps=0.19u
R_pattern_51 a_51 b_51 rhigh w=5.1u l=1.98u b=4 ps=0.19u
R_pattern_52 a_52 b_52 rhigh w=5.85u l=7.11u b=4 ps=0.19u
R_pattern_53 a_53 b_53 rhigh w=4.69u l=9.34u b=4 ps=0.19u
R_pattern_54 a_54 b_54 rhigh w=0.64u l=3.03u b=4 ps=0.19u
R_pattern_55 a_55 b_55 rhigh w=3.93u l=0.82u b=4 ps=0.19u
R_pattern_56 a_56 b_56 rhigh w=1.67u l=9.34u b=6 ps=0.19u
R_pattern_57 a_57 b_57 rhigh w=5.02u l=5.4u b=2 ps=0.19u
R_pattern_58 a_58 b_58 rhigh w=1.67u l=7.11u b=9 ps=0.19u
R_pattern_59 a_59 b_59 rhigh w=4.64u l=3.03u b=4 ps=0.19u
R_pattern_60 a_60 b_60 rhigh w=1.67u l=0.82u b=8 ps=0.19u
R_pattern_61 a_61 b_61 rhigh w=3.93u l=5.4u b=3 ps=0.19u
R_pattern_62 a_62 b_62 rhigh w=0.64u l=9.14u b=8 ps=0.19u
R_pattern_63 a_63 b_63 rhigh w=4.69u l=6.3u b=6 ps=0.19u
R_pattern_64 a_64 b_64 rhigh w=5.85u l=1.98u b=4 ps=0.19u
R_pattern_65 a_65 b_65 rhigh w=5.1u l=0.82u b=6 ps=0.19u
R_pattern_66 a_66 b_66 rhigh w=5.02u l=0.82u b=9 ps=0.19u
R_pattern_67 a_67 b_67 rhigh w=1.67u l=0.82u b=4 ps=0.19u
R_pattern_68 a_68 b_68 rhigh w=5.1u l=1.98u b=8 ps=0.19u
R_pattern_69 a_69 b_69 rhigh w=5.1u l=9.14u b=4 ps=0.19u
R_pattern_70 a_70 b_70 rhigh w=5.1u l=5.4u b=4 ps=0.19u
R_pattern_71 a_71 b_71 rhigh w=5.1u l=3.03u b=4 ps=0.19u
R_pattern_72 a_72 b_72 rhigh w=5.85u l=3.03u b=3 ps=0.19u
R_pattern_73 a_73 b_73 rhigh w=4.69u l=1.98u b=4 ps=0.19u
R_pattern_74 a_74 b_74 rhigh w=0.64u l=6.3u b=8 ps=0.19u
R_pattern_75 a_75 b_75 rhigh w=3.93u l=7.11u b=4 ps=0.19u
R_pattern_76 a_76 b_76 rhigh w=3.93u l=7.11u b=2 ps=0.19u
R_pattern_77 a_77 b_77 rhigh w=3.93u l=7.11u b=4 ps=0.19u
R_pattern_78 a_78 b_78 rhigh w=4.64u l=7.11u b=4 ps=0.19u
R_pattern_79 a_79 b_79 rhigh w=5.1u l=9.34u b=4 ps=0.19u
.ENDS
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,85 @@ Rp2 net3 net4 rppd m=1 l=1u w=0.5u
Rp3 net5 net6 rppd m=1 l=1.2u w=0.7u
Rp4 net7 net8 rppd m=1 l=1u w=0.5u ps=0.2u b=1
Rp5 net9 net10 rppd m=1 l=1.2u w=0.5u ps=0.2u b=2

* Extra patterns
R_pattern_1 a_1 b_1 rppd w=5.85u l=5.4u b=3 ps=0.2u
R_pattern_2 a_2 b_2 rppd w=1.67u l=9.14u b=6 ps=0.19u
R_pattern_3 a_3 b_3 rppd w=4.69u l=7.11u b=4 ps=0.19u
R_pattern_4 a_4 b_4 rppd w=5.02u l=0.82u b=4 ps=0.2u
R_pattern_5 a_5 b_5 rppd w=0.64u l=6.3u b=2 ps=0.2u
R_pattern_6 a_6 b_6 rppd w=4.64u l=1.98u b=4 ps=0.19u
R_pattern_7 a_7 b_7 rppd w=3.93u l=9.34u b=8 ps=0.19u
R_pattern_8 a_8 b_8 rppd w=5.1u l=3.03u b=9 ps=0.2u
R_pattern_9 a_9 b_9 rppd w=5.1u l=9.34u b=4 ps=0.2u
R_pattern_10 a_10 b_10 rppd w=3.93u l=1.98u b=2 ps=0.2u
R_pattern_11 a_11 b_11 rppd w=4.64u l=6.3u b=4 ps=0.19u
R_pattern_12 a_12 b_12 rppd w=0.64u l=0.82u b=4 ps=0.19u
R_pattern_13 a_13 b_13 rppd w=5.02u l=7.11u b=6 ps=0.2u
R_pattern_14 a_14 b_14 rppd w=4.69u l=9.14u b=3 ps=0.2u
R_pattern_15 a_15 b_15 rppd w=1.67u l=5.4u b=9 ps=0.19u
R_pattern_16 a_16 b_16 rppd w=5.85u l=3.03u b=8 ps=0.19u
R_pattern_17 a_17 b_17 rppd w=1.67u l=3.03u b=2 ps=0.19u
R_pattern_18 a_18 b_18 rppd w=5.02u l=9.34u b=4 ps=0.19u
R_pattern_19 a_19 b_19 rppd w=4.64u l=9.14u b=8 ps=0.2u
R_pattern_20 a_20 b_20 rppd w=5.1u l=5.4u b=4 ps=0.19u
R_pattern_21 a_21 b_21 rppd w=5.85u l=0.82u b=6 ps=0.19u
R_pattern_22 a_22 b_22 rppd w=4.69u l=1.98u b=9 ps=0.19u
R_pattern_23 a_23 b_23 rppd w=0.64u l=7.11u b=3 ps=0.19u
R_pattern_24 a_24 b_24 rppd w=3.93u l=6.3u b=4 ps=0.19u
R_pattern_25 a_25 b_25 rppd w=1.67u l=6.3u b=4 ps=0.2u
R_pattern_26 a_26 b_26 rppd w=3.93u l=7.11u b=4 ps=0.19u
R_pattern_27 a_27 b_27 rppd w=0.64u l=5.4u b=4 ps=0.19u
R_pattern_28 a_28 b_28 rppd w=4.69u l=3.03u b=4 ps=0.19u
R_pattern_29 a_29 b_29 rppd w=5.85u l=9.34u b=2 ps=0.19u
R_pattern_30 a_30 b_30 rppd w=5.1u l=9.14u b=2 ps=0.19u
R_pattern_31 a_31 b_31 rppd w=4.64u l=0.82u b=9 ps=0.19u
R_pattern_32 a_32 b_32 rppd w=5.02u l=1.98u b=3 ps=0.19u
R_pattern_33 a_33 b_33 rppd w=5.02u l=3.03u b=8 ps=0.19u
R_pattern_34 a_34 b_34 rppd w=4.64u l=5.4u b=6 ps=0.19u
R_pattern_35 a_35 b_35 rppd w=5.1u l=7.11u b=8 ps=0.19u
R_pattern_36 a_36 b_36 rppd w=5.85u l=6.3u b=9 ps=0.19u
R_pattern_37 a_37 b_37 rppd w=4.69u l=0.82u b=2 ps=0.19u
R_pattern_38 a_38 b_38 rppd w=0.64u l=9.34u b=9 ps=0.19u
R_pattern_39 a_39 b_39 rppd w=3.93u l=9.14u b=9 ps=0.19u
R_pattern_40 a_40 b_40 rppd w=1.67u l=1.98u b=4 ps=0.19u
R_pattern_41 a_41 b_41 rppd w=1.67u l=0.82u b=3 ps=0.19u
R_pattern_42 a_42 b_42 rppd w=3.93u l=3.03u b=6 ps=0.19u
R_pattern_43 a_43 b_43 rppd w=0.64u l=1.98u b=6 ps=0.19u
R_pattern_44 a_44 b_44 rppd w=4.69u l=5.4u b=8 ps=0.19u
R_pattern_45 a_45 b_45 rppd w=5.85u l=9.14u b=4 ps=0.19u
R_pattern_46 a_46 b_46 rppd w=5.1u l=6.3u b=3 ps=0.19u
R_pattern_47 a_47 b_47 rppd w=4.64u l=7.11u b=2 ps=0.19u
R_pattern_48 a_48 b_48 rppd w=5.02u l=6.3u b=4 ps=0.19u
R_pattern_49 a_49 b_49 rppd w=5.02u l=9.14u b=4 ps=0.19u
R_pattern_50 a_50 b_50 rppd w=4.64u l=9.34u b=3 ps=0.19u
R_pattern_51 a_51 b_51 rppd w=5.1u l=1.98u b=4 ps=0.19u
R_pattern_52 a_52 b_52 rppd w=5.85u l=7.11u b=4 ps=0.19u
R_pattern_53 a_53 b_53 rppd w=4.69u l=9.34u b=4 ps=0.19u
R_pattern_54 a_54 b_54 rppd w=0.64u l=3.03u b=4 ps=0.19u
R_pattern_55 a_55 b_55 rppd w=3.93u l=0.82u b=4 ps=0.19u
R_pattern_56 a_56 b_56 rppd w=1.67u l=9.34u b=6 ps=0.19u
R_pattern_57 a_57 b_57 rppd w=5.02u l=5.4u b=2 ps=0.19u
R_pattern_58 a_58 b_58 rppd w=1.67u l=7.11u b=9 ps=0.19u
R_pattern_59 a_59 b_59 rppd w=4.64u l=3.03u b=4 ps=0.19u
R_pattern_60 a_60 b_60 rppd w=1.67u l=0.82u b=8 ps=0.19u
R_pattern_61 a_61 b_61 rppd w=3.93u l=5.4u b=3 ps=0.19u
R_pattern_62 a_62 b_62 rppd w=0.64u l=9.14u b=8 ps=0.19u
R_pattern_63 a_63 b_63 rppd w=4.69u l=6.3u b=6 ps=0.19u
R_pattern_64 a_64 b_64 rppd w=5.85u l=1.98u b=4 ps=0.19u
R_pattern_65 a_65 b_65 rppd w=5.1u l=0.82u b=6 ps=0.19u
R_pattern_66 a_66 b_66 rppd w=5.02u l=0.82u b=9 ps=0.19u
R_pattern_67 a_67 b_67 rppd w=1.67u l=0.82u b=4 ps=0.19u
R_pattern_68 a_68 b_68 rppd w=5.1u l=1.98u b=8 ps=0.19u
R_pattern_69 a_69 b_69 rppd w=5.1u l=9.14u b=4 ps=0.19u
R_pattern_70 a_70 b_70 rppd w=5.1u l=5.4u b=4 ps=0.19u
R_pattern_71 a_71 b_71 rppd w=5.1u l=3.03u b=4 ps=0.19u
R_pattern_72 a_72 b_72 rppd w=5.85u l=3.03u b=3 ps=0.19u
R_pattern_73 a_73 b_73 rppd w=4.69u l=1.98u b=4 ps=0.19u
R_pattern_74 a_74 b_74 rppd w=0.64u l=6.3u b=8 ps=0.19u
R_pattern_75 a_75 b_75 rppd w=3.93u l=7.11u b=4 ps=0.19u
R_pattern_76 a_76 b_76 rppd w=3.93u l=7.11u b=2 ps=0.19u
R_pattern_77 a_77 b_77 rppd w=3.93u l=7.11u b=4 ps=0.19u
R_pattern_78 a_78 b_78 rppd w=4.64u l=7.11u b=4 ps=0.19u
R_pattern_79 a_79 b_79 rppd w=5.1u l=9.34u b=4 ps=0.19u
.ENDS
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,85 @@ Rs4 net7 net8 rsil m=1 l=1u w=0.5u ps=0.2u b=1
Rs5 net9 net10 rsil m=1 l=1.2u w=0.5u ps=0.2u b=2
Rs6 net11 net12 rsil m=2 l=0.5u w=0.5u
Rs7 net13 net14 rsil m=1 l=1u w=0.5u

* Extra patterns
R_pattern_1 a_1 b_1 rsil w=5.85u l=5.4u b=3 ps=0.2u
R_pattern_2 a_2 b_2 rsil w=1.67u l=9.14u b=6 ps=0.19u
R_pattern_3 a_3 b_3 rsil w=4.69u l=7.11u b=4 ps=0.19u
R_pattern_4 a_4 b_4 rsil w=5.02u l=0.82u b=4 ps=0.2u
R_pattern_5 a_5 b_5 rsil w=0.64u l=6.3u b=2 ps=0.2u
R_pattern_6 a_6 b_6 rsil w=4.64u l=1.98u b=4 ps=0.19u
R_pattern_7 a_7 b_7 rsil w=3.93u l=9.34u b=8 ps=0.19u
R_pattern_8 a_8 b_8 rsil w=5.1u l=3.03u b=9 ps=0.2u
R_pattern_9 a_9 b_9 rsil w=5.1u l=9.34u b=4 ps=0.2u
R_pattern_10 a_10 b_10 rsil w=3.93u l=1.98u b=2 ps=0.2u
R_pattern_11 a_11 b_11 rsil w=4.64u l=6.3u b=4 ps=0.19u
R_pattern_12 a_12 b_12 rsil w=0.64u l=0.82u b=4 ps=0.19u
R_pattern_13 a_13 b_13 rsil w=5.02u l=7.11u b=6 ps=0.2u
R_pattern_14 a_14 b_14 rsil w=4.69u l=9.14u b=3 ps=0.2u
R_pattern_15 a_15 b_15 rsil w=1.67u l=5.4u b=9 ps=0.19u
R_pattern_16 a_16 b_16 rsil w=5.85u l=3.03u b=8 ps=0.19u
R_pattern_17 a_17 b_17 rsil w=1.67u l=3.03u b=2 ps=0.19u
R_pattern_18 a_18 b_18 rsil w=5.02u l=9.34u b=4 ps=0.19u
R_pattern_19 a_19 b_19 rsil w=4.64u l=9.14u b=8 ps=0.2u
R_pattern_20 a_20 b_20 rsil w=5.1u l=5.4u b=4 ps=0.19u
R_pattern_21 a_21 b_21 rsil w=5.85u l=0.82u b=6 ps=0.19u
R_pattern_22 a_22 b_22 rsil w=4.69u l=1.98u b=9 ps=0.19u
R_pattern_23 a_23 b_23 rsil w=0.64u l=7.11u b=3 ps=0.19u
R_pattern_24 a_24 b_24 rsil w=3.93u l=6.3u b=4 ps=0.19u
R_pattern_25 a_25 b_25 rsil w=1.67u l=6.3u b=4 ps=0.2u
R_pattern_26 a_26 b_26 rsil w=3.93u l=7.11u b=4 ps=0.19u
R_pattern_27 a_27 b_27 rsil w=0.64u l=5.4u b=4 ps=0.19u
R_pattern_28 a_28 b_28 rsil w=4.69u l=3.03u b=4 ps=0.19u
R_pattern_29 a_29 b_29 rsil w=5.85u l=9.34u b=2 ps=0.19u
R_pattern_30 a_30 b_30 rsil w=5.1u l=9.14u b=2 ps=0.19u
R_pattern_31 a_31 b_31 rsil w=4.64u l=0.82u b=9 ps=0.19u
R_pattern_32 a_32 b_32 rsil w=5.02u l=1.98u b=3 ps=0.19u
R_pattern_33 a_33 b_33 rsil w=5.02u l=3.03u b=8 ps=0.19u
R_pattern_34 a_34 b_34 rsil w=4.64u l=5.4u b=6 ps=0.19u
R_pattern_35 a_35 b_35 rsil w=5.1u l=7.11u b=8 ps=0.19u
R_pattern_36 a_36 b_36 rsil w=5.85u l=6.3u b=9 ps=0.19u
R_pattern_37 a_37 b_37 rsil w=4.69u l=0.82u b=2 ps=0.19u
R_pattern_38 a_38 b_38 rsil w=0.64u l=9.34u b=9 ps=0.19u
R_pattern_39 a_39 b_39 rsil w=3.93u l=9.14u b=9 ps=0.19u
R_pattern_40 a_40 b_40 rsil w=1.67u l=1.98u b=4 ps=0.19u
R_pattern_41 a_41 b_41 rsil w=1.67u l=0.82u b=3 ps=0.19u
R_pattern_42 a_42 b_42 rsil w=3.93u l=3.03u b=6 ps=0.19u
R_pattern_43 a_43 b_43 rsil w=0.64u l=1.98u b=6 ps=0.19u
R_pattern_44 a_44 b_44 rsil w=4.69u l=5.4u b=8 ps=0.19u
R_pattern_45 a_45 b_45 rsil w=5.85u l=9.14u b=4 ps=0.19u
R_pattern_46 a_46 b_46 rsil w=5.1u l=6.3u b=3 ps=0.19u
R_pattern_47 a_47 b_47 rsil w=4.64u l=7.11u b=2 ps=0.19u
R_pattern_48 a_48 b_48 rsil w=5.02u l=6.3u b=4 ps=0.19u
R_pattern_49 a_49 b_49 rsil w=5.02u l=9.14u b=4 ps=0.19u
R_pattern_50 a_50 b_50 rsil w=4.64u l=9.34u b=3 ps=0.19u
R_pattern_51 a_51 b_51 rsil w=5.1u l=1.98u b=4 ps=0.19u
R_pattern_52 a_52 b_52 rsil w=5.85u l=7.11u b=4 ps=0.19u
R_pattern_53 a_53 b_53 rsil w=4.69u l=9.34u b=4 ps=0.19u
R_pattern_54 a_54 b_54 rsil w=0.64u l=3.03u b=4 ps=0.19u
R_pattern_55 a_55 b_55 rsil w=3.93u l=0.82u b=4 ps=0.19u
R_pattern_56 a_56 b_56 rsil w=1.67u l=9.34u b=6 ps=0.19u
R_pattern_57 a_57 b_57 rsil w=5.02u l=5.4u b=2 ps=0.19u
R_pattern_58 a_58 b_58 rsil w=1.67u l=7.11u b=9 ps=0.19u
R_pattern_59 a_59 b_59 rsil w=4.64u l=3.03u b=4 ps=0.19u
R_pattern_60 a_60 b_60 rsil w=1.67u l=0.82u b=8 ps=0.19u
R_pattern_61 a_61 b_61 rsil w=3.93u l=5.4u b=3 ps=0.19u
R_pattern_62 a_62 b_62 rsil w=0.64u l=9.14u b=8 ps=0.19u
R_pattern_63 a_63 b_63 rsil w=4.69u l=6.3u b=6 ps=0.19u
R_pattern_64 a_64 b_64 rsil w=5.85u l=1.98u b=4 ps=0.19u
R_pattern_65 a_65 b_65 rsil w=5.1u l=0.82u b=6 ps=0.19u
R_pattern_66 a_66 b_66 rsil w=5.02u l=0.82u b=9 ps=0.19u
R_pattern_67 a_67 b_67 rsil w=1.67u l=0.82u b=4 ps=0.19u
R_pattern_68 a_68 b_68 rsil w=5.1u l=1.98u b=8 ps=0.19u
R_pattern_69 a_69 b_69 rsil w=5.1u l=9.14u b=4 ps=0.19u
R_pattern_70 a_70 b_70 rsil w=5.1u l=5.4u b=4 ps=0.19u
R_pattern_71 a_71 b_71 rsil w=5.1u l=3.03u b=4 ps=0.19u
R_pattern_72 a_72 b_72 rsil w=5.85u l=3.03u b=3 ps=0.19u
R_pattern_73 a_73 b_73 rsil w=4.69u l=1.98u b=4 ps=0.19u
R_pattern_74 a_74 b_74 rsil w=0.64u l=6.3u b=8 ps=0.19u
R_pattern_75 a_75 b_75 rsil w=3.93u l=7.11u b=4 ps=0.19u
R_pattern_76 a_76 b_76 rsil w=3.93u l=7.11u b=2 ps=0.19u
R_pattern_77 a_77 b_77 rsil w=3.93u l=7.11u b=4 ps=0.19u
R_pattern_78 a_78 b_78 rsil w=4.64u l=7.11u b=4 ps=0.19u
R_pattern_79 a_79 b_79 rsil w=5.1u l=9.34u b=4 ps=0.19u
.ENDS
24 changes: 24 additions & 0 deletions ihp-sg13g2/libs.tech/klayout/tech/macros/sg13g2_lvs.lylvs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<text>

require 'yaml'
require 'open3'

# Load LVS options from a YAML file
#
Expand Down Expand Up @@ -82,6 +83,29 @@ def set_default_options(yaml_file_path)
default_options
end

# check klayout version
klayout_v, _ = Open3.capture2('klayout -b -v')
klayout_v = klayout_v.split("\n")[0]
klayout_v_list = []

if klayout_v.empty?
raise StandardError, "KLayout is not found. Please make sure KLayout is installed."
else
klayout_v_arr = klayout_v.split(" ")[-1].scan(/[^.]+/)
klayout_v_list = klayout_v_arr.map { |ele| ele.to_i }
end

if klayout_v_list.size &lt; 1 || klayout_v_list.size &gt; 3
raise StandardError, "Was not able to get KLayout version properly."
elsif klayout_v_list.size &gt;= 2 || klayout_v_list.size &lt;= 3
if klayout_v_list[1] &lt; 29
puts "Using this KLayout version has not been assessed. Limits are unknown."
raise StandardError, "Prerequisites at a minimum: KLayout 0.29.0"
end
end
puts "Your KLayout version is: #{klayout_v}"

# Get testing dir path
dir_path = File.dirname(File.expand_path(__FILE__))

## reading the loaded gds file path
Expand Down
Loading

0 comments on commit 7ab000f

Please sign in to comment.