diff --git a/cace/isolated_switch_ena1v8.yaml b/cace/isolated_switch_ena1v8.yaml index dba612e..d1be6aa 100644 --- a/cace/isolated_switch_ena1v8.yaml +++ b/cace/isolated_switch_ena1v8.yaml @@ -9,7 +9,7 @@ description: > not ensure break-before-make. PDK: sky130A -cace_format: 5.0 +cace_format: 5.2 authorship: designer: Tim Edwards @@ -23,13 +23,12 @@ paths: magic: mag layout: gds netlist: netlist - documentation: doc + documentation: docs pins: dvdd: description: Digital power supply type: power - type: ground dvss: description: Digital ground type: ground @@ -39,8 +38,7 @@ pins: avss: description: Analog ground type: ground - direction: input - "on": + on: description: Enable the switch type: signal direction: input @@ -86,14 +84,15 @@ parameters: display: R_on unit: Ohm spec: - maximum: - value: any + r_on: + maximum: + value: any tool: ngspice: template: isolated_switch_ena1v8_tb.sch format: ascii suffix: .data - variables: [result] + variables: [r_on] conditions: corner: enumerate: [tt, ff, ss] # fs, sf @@ -102,42 +101,36 @@ parameters: typical: 27 maximum: 130 - area: - description: Total circuit layout area - display: Area - unit: µm² + magic_area: spec: - maximum: - value: any + area: + display: Area + description: Total circuit layout area + unit: µm² + maximum: + value: any + width: + display: Width + description: Total circuit layout width + unit: µm + maximum: + value: any + height: + display: Height + description: Total circuit layout height + unit: µm + maximum: + value: any tool: magic_area - width: - description: Total circuit layout width - display: Width - unit: µm - spec: - maximum: - value: any - tool: - magic_width - - height: - description: Total circuit layout height - display: Height - unit: µm - spec: - maximum: - value: any - tool: - magic_height - magic_drc: description: Magic DRC display: Magic DRC spec: - maximum: - value: 0 + drc_errors: + maximum: + value: 0 tool: magic_drc @@ -145,38 +138,20 @@ parameters: description: Netgen LVS display: Netgen LVS spec: - maximum: - value: 0 + lvs_errors: + maximum: + value: 0 tool: netgen_lvs: - script: run_project_lvs.tcl - - klayout_drc_feol: - description: KLayout DRC feol - display: KLayout DRC feol - spec: - maximum: - value: 0 - tool: - klayout_drc: - args: ['-rd', 'feol=true'] - - klayout_drc_beol: - description: KLayout DRC beol - display: KLayout DRC beol - spec: - maximum: - value: 0 - tool: - klayout_drc: - args: ['-rd', 'beol=true'] + script: isolated_switch_ena1v8_lvs.tcl klayout_drc_full: description: KLayout DRC full display: KLayout DRC full spec: - maximum: - value: 0 + drc_errors: + maximum: + value: 0 tool: klayout_drc: args: ['-rd', 'feol=true', '-rd', 'beol=true', '-rd', 'offgrid=true'] diff --git a/cace/scripts/isolated_switch_ena1v8_lvs.tcl b/cace/scripts/isolated_switch_ena1v8_lvs.tcl new file mode 100644 index 0000000..bbfb9f4 --- /dev/null +++ b/cace/scripts/isolated_switch_ena1v8_lvs.tcl @@ -0,0 +1,10 @@ +# NOTE: PDK_ROOT, PDK and CACE_ROOT are set in the local environment by CACE + +set PDK_ROOT $::env(PDK_ROOT) +set PDK $::env(PDK) +set CACE_ROOT $::env(CACE_ROOT) + +set circuit1 [readnet spice $CACE_ROOT/netlist/layout/isolated_switch_ena1v8.spice] +set circuit2 [readnet spice $CACE_ROOT/netlist/schematic/isolated_switch_ena1v8.spice] +readnet spice $PDK_ROOT/$PDK/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice $circuit2 +lvs "$circuit1 isolated_switch_ena1v8" "$circuit2 isolated_switch_ena1v8" $PDK_ROOT/$PDK/libs.tech/netgen/${PDK}_setup.tcl isolated_switch_ena1v8_comp.out -json diff --git a/cace/scripts/simple_analog_switch_ena1v8_lvs.tcl b/cace/scripts/simple_analog_switch_ena1v8_lvs.tcl new file mode 100644 index 0000000..6538ab6 --- /dev/null +++ b/cace/scripts/simple_analog_switch_ena1v8_lvs.tcl @@ -0,0 +1,10 @@ +# NOTE: PDK_ROOT, PDK and CACE_ROOT are set in the local environment by CACE + +set PDK_ROOT $::env(PDK_ROOT) +set PDK $::env(PDK) +set CACE_ROOT $::env(CACE_ROOT) + +set circuit1 [readnet spice $CACE_ROOT/netlist/layout/simple_analog_switch_ena1v8.spice] +set circuit2 [readnet spice $CACE_ROOT/netlist/schematic/simple_analog_switch_ena1v8.spice] +readnet spice $PDK_ROOT/$PDK/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice $circuit2 +lvs "$circuit1 simple_analog_switch_ena1v8" "$circuit2 simple_analog_switch_ena1v8" $PDK_ROOT/$PDK/libs.tech/netgen/${PDK}_setup.tcl simple_analog_switch_ena1v8_comp.out -json diff --git a/cace/scripts/simplest_analog_switch_ena1v8_lvs.tcl b/cace/scripts/simplest_analog_switch_ena1v8_lvs.tcl new file mode 100644 index 0000000..2100be4 --- /dev/null +++ b/cace/scripts/simplest_analog_switch_ena1v8_lvs.tcl @@ -0,0 +1,10 @@ +# NOTE: PDK_ROOT, PDK and CACE_ROOT are set in the local environment by CACE + +set PDK_ROOT $::env(PDK_ROOT) +set PDK $::env(PDK) +set CACE_ROOT $::env(CACE_ROOT) + +set circuit1 [readnet spice $CACE_ROOT/netlist/layout/simplest_analog_switch_ena1v8.spice] +set circuit2 [readnet spice $CACE_ROOT/netlist/schematic/simplest_analog_switch_ena1v8.spice] +readnet spice $PDK_ROOT/$PDK/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice $circuit2 +lvs "$circuit1 simplest_analog_switch_ena1v8" "$circuit2 simplest_analog_switch_ena1v8" $PDK_ROOT/$PDK/libs.tech/netgen/${PDK}_setup.tcl simplest_analog_switch_ena1v8_comp.out -json diff --git a/cace/simple_analog_switch_ena1v8.yaml b/cace/simple_analog_switch_ena1v8.yaml index 4ec0d4c..6628822 100644 --- a/cace/simple_analog_switch_ena1v8.yaml +++ b/cace/simple_analog_switch_ena1v8.yaml @@ -9,7 +9,7 @@ description: > mitigation. PDK: sky130A -cace_format: 5.0 +cace_format: 5.2 authorship: designer: Tim Edwards @@ -23,13 +23,12 @@ paths: magic: mag layout: gds netlist: netlist - documentation: doc + documentation: docs pins: dvdd: description: Digital power supply type: power - type: ground dvss: description: Digital ground type: ground @@ -39,8 +38,7 @@ pins: avss: description: Analog ground type: ground - direction: input - "on": + on: description: Enable the switch type: signal direction: input @@ -86,14 +84,15 @@ parameters: display: R_on unit: Ohm spec: - maximum: - value: any + r_on: + maximum: + value: any tool: ngspice: template: simple_analog_switch_ena1v8_tb.sch format: ascii suffix: .data - variables: [result] + variables: [r_on] conditions: corner: enumerate: [tt, ff, ss] # fs, sf @@ -102,42 +101,36 @@ parameters: typical: 27 maximum: 130 - area: - description: Total circuit layout area - display: Area - unit: µm² + magic_area: spec: - maximum: - value: any + area: + display: Area + description: Total circuit layout area + unit: µm² + maximum: + value: any + width: + display: Width + description: Total circuit layout width + unit: µm + maximum: + value: any + height: + display: Height + description: Total circuit layout height + unit: µm + maximum: + value: any tool: magic_area - width: - description: Total circuit layout width - display: Width - unit: µm - spec: - maximum: - value: any - tool: - magic_width - - height: - description: Total circuit layout height - display: Height - unit: µm - spec: - maximum: - value: any - tool: - magic_height - magic_drc: description: Magic DRC display: Magic DRC spec: - maximum: - value: 0 + drc_errors: + maximum: + value: 0 tool: magic_drc @@ -145,38 +138,20 @@ parameters: description: Netgen LVS display: Netgen LVS spec: - maximum: - value: 0 + lvs_errors: + maximum: + value: 0 tool: netgen_lvs: - script: run_project_lvs.tcl - - klayout_drc_feol: - description: KLayout DRC feol - display: KLayout DRC feol - spec: - maximum: - value: 0 - tool: - klayout_drc: - args: ['-rd', 'feol=true'] - - klayout_drc_beol: - description: KLayout DRC beol - display: KLayout DRC beol - spec: - maximum: - value: 0 - tool: - klayout_drc: - args: ['-rd', 'beol=true'] + script: simple_analog_switch_ena1v8_lvs.tcl klayout_drc_full: description: KLayout DRC full display: KLayout DRC full spec: - maximum: - value: 0 + drc_errors: + maximum: + value: 0 tool: klayout_drc: args: ['-rd', 'feol=true', '-rd', 'beol=true', '-rd', 'offgrid=true'] diff --git a/cace/simplest_analog_switch_ena1v8.yaml b/cace/simplest_analog_switch_ena1v8.yaml index 16afbe6..2cccebb 100644 --- a/cace/simplest_analog_switch_ena1v8.yaml +++ b/cace/simplest_analog_switch_ena1v8.yaml @@ -9,7 +9,7 @@ description: > single nFET and pFET. PDK: sky130A -cace_format: 5.0 +cace_format: 5.2 authorship: designer: Tim Edwards @@ -23,13 +23,12 @@ paths: magic: mag layout: gds netlist: netlist - documentation: doc + documentation: docs pins: dvdd: description: Digital power supply type: power - type: ground dvss: description: Digital ground type: ground @@ -39,8 +38,7 @@ pins: avss: description: Analog ground type: ground - direction: input - "on": + on: description: Enable the switch type: signal direction: input @@ -86,14 +84,15 @@ parameters: display: R_on unit: Ohm spec: - maximum: - value: any + r_on: + maximum: + value: any tool: ngspice: template: simplest_analog_switch_ena1v8_tb.sch format: ascii suffix: .data - variables: [result] + variables: [r_on] conditions: corner: enumerate: [tt, ff, ss] # fs, sf @@ -102,42 +101,36 @@ parameters: typical: 27 maximum: 130 - area: - description: Total circuit layout area - display: Area - unit: µm² + magic_area: spec: - maximum: - value: any + area: + display: Area + description: Total circuit layout area + unit: µm² + maximum: + value: 600 + width: + display: Width + description: Total circuit layout width + unit: µm + maximum: + value: any + height: + display: Height + description: Total circuit layout height + unit: µm + maximum: + value: any tool: magic_area - width: - description: Total circuit layout width - display: Width - unit: µm - spec: - maximum: - value: any - tool: - magic_width - - height: - description: Total circuit layout height - display: Height - unit: µm - spec: - maximum: - value: any - tool: - magic_height - magic_drc: description: Magic DRC display: Magic DRC spec: - maximum: - value: 0 + drc_errors: + maximum: + value: 0 tool: magic_drc @@ -145,38 +138,20 @@ parameters: description: Netgen LVS display: Netgen LVS spec: - maximum: - value: 0 + lvs_errors: + maximum: + value: 0 tool: netgen_lvs: - script: run_project_lvs.tcl - - klayout_drc_feol: - description: KLayout DRC feol - display: KLayout DRC feol - spec: - maximum: - value: 0 - tool: - klayout_drc: - args: ['-rd', 'feol=true'] - - klayout_drc_beol: - description: KLayout DRC beol - display: KLayout DRC beol - spec: - maximum: - value: 0 - tool: - klayout_drc: - args: ['-rd', 'beol=true'] + script: simplest_analog_switch_ena1v8_lvs.tcl klayout_drc_full: description: KLayout DRC full display: KLayout DRC full spec: - maximum: - value: 0 + drc_errors: + maximum: + value: 0 tool: klayout_drc: args: ['-rd', 'feol=true', '-rd', 'beol=true', '-rd', 'offgrid=true'] diff --git a/cace/templates/isolated_switch_ena1v8_tb.sch b/cace/templates/isolated_switch_ena1v8_tb.sch index d45436f..b6ecc41 100644 --- a/cace/templates/isolated_switch_ena1v8_tb.sch +++ b/cace/templates/isolated_switch_ena1v8_tb.sch @@ -115,7 +115,7 @@ N 260 270 260 310 { lab=OUT} C {devices/vsource.sym} 50 120 0 0 {name=V0 value=0 savecurrent=false} C {devices/gnd.sym} 50 190 0 0 {name=l3 lab=GND} -C {devices/vsource.sym} 130 120 0 0 {name=V2 value=\{dvdd\} savecurrent=false} +C {devices/vsource.sym} 130 120 0 0 {name=V2 value=CACE\{dvdd\} savecurrent=false} C {devices/lab_wire.sym} 50 50 0 0 {name=p1 sig_type=std_logic lab=DVSS} C {devices/lab_wire.sym} 130 50 0 0 {name=p5 sig_type=std_logic lab=DVDD} C {devices/launcher.sym} 500 520 0 0 {name=h1 @@ -130,26 +130,26 @@ xschem raw_read $netlist_dir/[file tail [file rootname [xschem get current_name] " } C {devices/vsource.sym} 210 120 0 0 {name=V1 value=0 savecurrent=false} -C {devices/vsource.sym} 290 120 0 0 {name=V3 value=\{avdd\} savecurrent=false} +C {devices/vsource.sym} 290 120 0 0 {name=V3 value=CACE\{avdd\} savecurrent=false} C {devices/lab_wire.sym} 210 50 0 0 {name=p2 sig_type=std_logic lab=AVSS} C {devices/lab_wire.sym} 290 50 0 0 {name=p3 sig_type=std_logic lab=AVDD} C {devices/lab_wire.sym} 720 330 0 1 {name=p4 sig_type=std_logic lab=DVSS} C {devices/lab_wire.sym} 720 310 0 1 {name=p6 sig_type=std_logic lab=DVDD} C {devices/lab_wire.sym} 720 350 0 1 {name=p7 sig_type=std_logic lab=AVSS} C {devices/lab_wire.sym} 720 410 0 1 {name=p8 sig_type=std_logic lab=AVDD} -C {devices/vsource.sym} 370 120 0 0 {name=V4 value="[\{dvdd\} * \{enable\}]" savecurrent=false} +C {devices/vsource.sym} 370 120 0 0 {name=V4 value="CACE[CACE\{dvdd\} * CACE\{enable\}]" savecurrent=false} C {devices/lab_wire.sym} 370 50 0 0 {name=p9 sig_type=std_logic lab=ON} C {devices/code_shown.sym} 1000 140 0 0 {name=SETUP simulator=ngspice only_toplevel=false value=" -.lib \{PDK_ROOT\}/\{PDK\}/libs.tech/combined/sky130.lib.spice \{corner\} +.lib CACE\{PDK_ROOT\}/CACE\{PDK\}/libs.tech/combined/sky130.lib.spice CACE\{corner\} -.include \{PDK_ROOT\}/\{PDK\}/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice +.include CACE\{PDK_ROOT\}/CACE\{PDK\}/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice -.include \{DUT_path\} +.include CACE\{DUT_path\} -.temp \{temperature\} +.temp CACE\{temperature\} "} C {devices/code_shown.sym} 1000 360 0 0 {name=CONTROL simulator=ngspice @@ -164,14 +164,14 @@ value=" *set appendwrite * run dc simulation - dc vin 0 \{avdd\} \{step\} + dc vin 0 CACE\{avdd\} CACE\{step\} let r_switch = (v(in)-v(out))/-i(vin) meas DC r_switch_max max r_switch *write simplest_analog_switch_ena1v8_tb.raw - echo $&r_switch_max > \{simpath\}/\{filename\}_\{N\}.data + echo $&r_switch_max > CACE\{simpath\}/CACE\{filename\}_CACE\{N\}.data .endc "} C {devices/vsource.sym} 160 340 0 0 {name=VIN value="ac 1" savecurrent=false} diff --git a/cace/templates/simple_analog_switch_ena1v8_tb.sch b/cace/templates/simple_analog_switch_ena1v8_tb.sch index 24606b9..7d402ee 100644 --- a/cace/templates/simple_analog_switch_ena1v8_tb.sch +++ b/cace/templates/simple_analog_switch_ena1v8_tb.sch @@ -115,7 +115,7 @@ N 260 270 260 310 { lab=OUT} C {devices/vsource.sym} 50 120 0 0 {name=V0 value=0 savecurrent=false} C {devices/gnd.sym} 50 190 0 0 {name=l3 lab=GND} -C {devices/vsource.sym} 130 120 0 0 {name=V2 value=1.8 savecurrent=false} +C {devices/vsource.sym} 130 120 0 0 {name=V2 value=CACE\{dvdd\} savecurrent=false} C {devices/lab_wire.sym} 50 50 0 0 {name=p1 sig_type=std_logic lab=DVSS} C {devices/lab_wire.sym} 130 50 0 0 {name=p5 sig_type=std_logic lab=DVDD} C {devices/launcher.sym} 500 520 0 0 {name=h1 @@ -130,26 +130,26 @@ xschem raw_read $netlist_dir/[file tail [file rootname [xschem get current_name] " } C {devices/vsource.sym} 210 120 0 0 {name=V1 value=0 savecurrent=false} -C {devices/vsource.sym} 290 120 0 0 {name=V3 value=\{avdd\} savecurrent=false} +C {devices/vsource.sym} 290 120 0 0 {name=V3 value=CACE\{avdd\} savecurrent=false} C {devices/lab_wire.sym} 210 50 0 0 {name=p2 sig_type=std_logic lab=AVSS} C {devices/lab_wire.sym} 290 50 0 0 {name=p3 sig_type=std_logic lab=AVDD} C {devices/lab_wire.sym} 720 330 0 1 {name=p4 sig_type=std_logic lab=DVSS} C {devices/lab_wire.sym} 720 310 0 1 {name=p6 sig_type=std_logic lab=DVDD} C {devices/lab_wire.sym} 720 350 0 1 {name=p7 sig_type=std_logic lab=AVSS} C {devices/lab_wire.sym} 720 410 0 1 {name=p8 sig_type=std_logic lab=AVDD} -C {devices/vsource.sym} 370 120 0 0 {name=V4 value="[\{dvdd\} * \{enable\}]" savecurrent=false} +C {devices/vsource.sym} 370 120 0 0 {name=V4 value="CACE[CACE\{dvdd\} * CACE\{enable\}]" savecurrent=false} C {devices/lab_wire.sym} 370 50 0 0 {name=p9 sig_type=std_logic lab=ON} C {devices/code_shown.sym} 1000 140 0 0 {name=SETUP simulator=ngspice only_toplevel=false value=" -.lib \{PDK_ROOT\}/\{PDK\}/libs.tech/combined/sky130.lib.spice \{corner\} +.lib CACE\{PDK_ROOT\}/CACE\{PDK\}/libs.tech/combined/sky130.lib.spice CACE\{corner\} -.include \{PDK_ROOT\}/\{PDK\}/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice +.include CACE\{PDK_ROOT\}/CACE\{PDK\}/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice -.include \{DUT_path\} +.include CACE\{DUT_path\} -.temp \{temperature\} +.temp CACE\{temperature\} "} C {devices/code_shown.sym} 1000 360 0 0 {name=CONTROL simulator=ngspice @@ -164,14 +164,14 @@ value=" *set appendwrite * run dc simulation - dc vin 0 \{avdd\} \{step\} + dc vin 0 CACE\{avdd\} CACE\{step\} let r_switch = (v(in)-v(out))/-i(vin) meas DC r_switch_max max r_switch *write simplest_analog_switch_ena1v8_tb.raw - echo $&r_switch_max > \{simpath\}/\{filename\}_\{N\}.data + echo $&r_switch_max > CACE\{simpath\}/CACE\{filename\}_CACE\{N\}.data .endc "} C {devices/vsource.sym} 160 340 0 0 {name=VIN value="ac 1" savecurrent=false} diff --git a/cace/templates/simplest_analog_switch_ena1v8_tb.sch b/cace/templates/simplest_analog_switch_ena1v8_tb.sch index 313b603..bf3c11e 100644 --- a/cace/templates/simplest_analog_switch_ena1v8_tb.sch +++ b/cace/templates/simplest_analog_switch_ena1v8_tb.sch @@ -116,7 +116,7 @@ lab=OUT} C {simplest_analog_switch_ena1v8.sym} 570 360 0 0 {name=x1} C {devices/vsource.sym} 50 120 0 0 {name=V0 value=0 savecurrent=false} C {devices/gnd.sym} 50 190 0 0 {name=l3 lab=GND} -C {devices/vsource.sym} 130 120 0 0 {name=V2 value=1.8 savecurrent=false} +C {devices/vsource.sym} 130 120 0 0 {name=V2 value=CACE\{dvdd\} savecurrent=false} C {devices/lab_wire.sym} 50 50 0 0 {name=p1 sig_type=std_logic lab=DVSS} C {devices/lab_wire.sym} 130 50 0 0 {name=p5 sig_type=std_logic lab=DVDD} C {devices/launcher.sym} 500 520 0 0 {name=h1 @@ -130,26 +130,26 @@ xschem raw_read $netlist_dir/[file tail [file rootname [xschem get current_name] " } C {devices/vsource.sym} 210 120 0 0 {name=V1 value=0 savecurrent=false} -C {devices/vsource.sym} 290 120 0 0 {name=V3 value=\{avdd\} savecurrent=false} +C {devices/vsource.sym} 290 120 0 0 {name=V3 value=CACE\{avdd\} savecurrent=false} C {devices/lab_wire.sym} 210 50 0 0 {name=p2 sig_type=std_logic lab=AVSS} C {devices/lab_wire.sym} 290 50 0 0 {name=p3 sig_type=std_logic lab=AVDD} C {devices/lab_wire.sym} 720 330 0 1 {name=p4 sig_type=std_logic lab=DVSS} C {devices/lab_wire.sym} 720 310 0 1 {name=p6 sig_type=std_logic lab=DVDD} C {devices/lab_wire.sym} 720 350 0 1 {name=p7 sig_type=std_logic lab=AVSS} C {devices/lab_wire.sym} 720 410 0 1 {name=p8 sig_type=std_logic lab=AVDD} -C {devices/vsource.sym} 370 120 0 0 {name=V4 value="[\{dvdd\} * \{enable\}]" savecurrent=false} +C {devices/vsource.sym} 370 120 0 0 {name=V4 value="CACE[CACE\{dvdd\} * CACE\{enable\}]" savecurrent=false} C {devices/lab_wire.sym} 370 50 0 0 {name=p9 sig_type=std_logic lab=ON} C {devices/code_shown.sym} 1000 140 0 0 {name=SETUP simulator=ngspice only_toplevel=false value=" -.lib \{PDK_ROOT\}/\{PDK\}/libs.tech/combined/sky130.lib.spice \{corner\} +.lib CACE\{PDK_ROOT\}/CACE\{PDK\}/libs.tech/combined/sky130.lib.spice CACE\{corner\} -.include \{PDK_ROOT\}/\{PDK\}/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice +.include CACE\{PDK_ROOT\}/CACE\{PDK\}/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice -.include \{DUT_path\} +.include CACE\{DUT_path\} -.temp \{temperature\} +.temp CACE\{temperature\} "} C {devices/code_shown.sym} 1000 360 0 0 {name=CONTROL simulator=ngspice @@ -164,14 +164,14 @@ value=" *set appendwrite * run dc simulation - dc vin 0 \{avdd\} \{step\} + dc vin 0 CACE\{avdd\} CACE\{step\} let r_switch = (v(in)-v(out))/-i(vin) meas DC r_switch_max max r_switch *write simplest_analog_switch_ena1v8_tb.raw - echo $&r_switch_max > \{simpath\}/\{filename\}_\{N\}.data + echo $&r_switch_max > CACE\{simpath\}/CACE\{filename\}_CACE\{N\}.data .endc "} C {devices/vsource.sym} 160 340 0 0 {name=VIN value="ac 1" savecurrent=false} diff --git a/cace/templates/xschemrc b/cace/templates/xschemrc new file mode 100644 index 0000000..21fc111 --- /dev/null +++ b/cace/templates/xschemrc @@ -0,0 +1,2 @@ +# Source project xschemrc +source [file dirname [info script]]/../../xschem/xschemrc diff --git a/xschem/xschemrc b/xschem/xschemrc index 3701927..3b753a3 100644 --- a/xschem/xschemrc +++ b/xschem/xschemrc @@ -1,508 +1,7 @@ -#### xschemrc system configuration file - -#### values may be overridden by user's ~/.xschem/xschemrc configuration file -#### or by project-local ./xschemrc - -########################################################################### -#### XSCHEM INSTALLATION DIRECTORY: XSCHEM_SHAREDIR -########################################################################### -#### Normally there is no reason to set this variable if using standard -#### installation. Location of files is set at compile time but may be overridden -#### with following line: -# set XSCHEM_SHAREDIR $env(HOME)/share/xschem - -########################################################################### -#### XSCHEM SYSTEM-WIDE DESIGN LIBRARY PATHS: XSCHEM_LIBRARY_PATH -########################################################################### -#### If unset xschem starts with XSCHEM_LIBRARY_PATH set to the default, typically: -# ${HOME}/.xschem/xschem_library -# /share/xschem/xschem_library/devices -# /share/doc/xschem/examples -# /share/doc/xschem/ngspice -# /share/doc/xschem/logic -# /share/doc/xschem/xschem_simulator -# /share/doc/xschem/binto7seg -# /share/doc/xschem/pcb -# /share/doc/xschem/rom8k - -#### Flush any previous definition -set XSCHEM_LIBRARY_PATH {} -#### include devices/*.sym -append XSCHEM_LIBRARY_PATH ${XSCHEM_SHAREDIR}/xschem_library -#### include skywater libraries. Here i use [pwd]. This works if i start xschem from here. -append XSCHEM_LIBRARY_PATH :[file dirname [info script]] -#### add ~/.xschem/xschem_library (USER_CONF_DIR is normally ~/.xschem) -append XSCHEM_LIBRARY_PATH :$USER_CONF_DIR/xschem_library - -########################################################################### -#### SET CUSTOM COLORS FOR XSCHEM LIBRARIES MATCHING CERTAIN PATTERNS -########################################################################### -#### each line contains a dircolor(pattern) followed by a color -#### color can be an ordinary name (grey, brown, blue) or a hex code {#77aaff} -#### hex code must be enclosed in braces -array unset dircolor -set dircolor(sky130_fd_pr$) blue -set dircolor(sky130_tests$) blue -set dircolor(xschem_sky130$) blue -set dircolor(xschem_library$) red -set dircolor(devices$) red - -########################################################################### -#### WINDOW TO OPEN ON STARTUP: XSCHEM_START_WINDOW -########################################################################### -#### Start without a design if no filename given on command line: -#### To avoid absolute paths, use a path that is relative to one of the -#### XSCHEM_LIBRARY_PATH directories. Default: empty -set XSCHEM_START_WINDOW {sky130_tests/top.sch} - -########################################################################### -#### DIRECTORY WHERE SIMULATIONS, NETLIST AND SIMULATOR OUTPUTS ARE PLACED -########################################################################### -#### If unset $USER_CONF_DIR/simulations is assumed (normally ~/.xschem/simulations) -# set netlist_dir $env(HOME)/.xschem/simulations -#### if this is set to '1' netlists and simulations will go into a simulation/ folder -#### inside the directory containing the top level schematic. Default: not set (0) -# set local_netlist_dir 1 - -########################################################################### -#### NETLIST AND HIERARCHICAL PRINT EXCLUDE PATTERNS -########################################################################### -#### xschem_libs is a list of patterns of cells to exclude from netlisting. -#### Matching is done as regular expression on full cell path -#### Example: -#### set xschem_libs { {/cmoslib/} {/analoglib/.*pass} buffer } -#### in this case all schematic cells of directory cmoslib and cells containing -#### /analoglib/...pass and buffer will be excluded from netlisting -#### default value: empty -# set xschem_libs {} -#### noprint_libs is a list with same rules as for xschem_libs. This -#### variable controls hierarchical print -#### default value: empty -# set noprint_libs {} -#### nolist_libs is a list with same rules as for xschem_libs. This -#### variable controls cell listing in procedure list_hierarchy. -#### default value: empty -# set nolist_libs {} - -########################################################################### -#### CHANGE DEFAULT [] WITH SOME OTHER CHARACTERS FOR BUSSED SIGNALS -#### IN SPICE NETLISTS (EXAMPLE: DATA[7] --> DATA<7>) -########################################################################### -#### default: empty (use xschem default, [ ]) -# set bus_replacement_char {<>} -#### for XSPICE: replace square brackets as the are used for XSPICE vector nodes. -# set bus_replacement_char {__} - -########################################################################### -#### SOME DEFAULT BEHAVIOR -########################################################################### -#### Allowed values: spice, verilog, vhdl, tedax, default: spice -# set netlist_type spice - -#### Some netlisting options (these are the defaults) -# set verilog_2001 1 - -#### to use a fixed line width set change_lw to 0 and set some value to line_width -#### these are the defaults -# set line_width 0 -# set change_lw 1 - -#### allow color postscript and svg exports. Default: 1, enable color -# set color_ps 1 - -#### set paper size: name, height, width. Sizes in 1/72 of an inch (typographical points) -#### default: {a4 842 595} -# set ps_paper_size {a4 842 595} -# set ps_paper_size {letter 792 612} - -#### initial size of xschem window you can specify also position with (wxh+x+y) -#### this is the default: -# set initial_geometry {900x600} -set initial_geometry {1280x695+0+0} - -#### if set to 0, when zooming out allow the viewport do drift toward the mouse position, -#### allowing to move away by zooming / unzooming with mouse wheel -#### default setting: 0 -# set unzoom_nodrift 0 - -#### if set to 1 full zoom will center the drawing instead of anhoring to lower -#### left corner. Default: 0 -set zoom_full_center 1 - -#### if set to 1 allow to place multiple components with same name. -#### Warning: this is normally not allowed in any simulation netlist. -#### default: 0, do not allow place multiple elements with same name (refdes) -# set disable_unique_names 0 - -#### if set to 1 continue drawing lines / wires after click -#### default: 0 -# set persistent_command 1 - -#### if set to 1 a wire is inserted when separating components that are -#### connected by pins. Default: not enabled (0) -# set connect_by_kissing 1 - -#### if set to 1 automatically join/trim wires while editing -#### this may slow down on rally big designs. Can be disabled via menu -#### default: 0 -# set autotrim_wires 0 - -#### set widget scaling (mainly for font display), this is useful on 4K displays -#### default: unset (tk uses its default) > 1.0 ==> bigger -# set tk_scaling 1.7 - -#### use the tclreadline package if available , Default: 1 (enabled). -# set use_tclreadline 1 - -#### disable some symbol layers. Default: none, all layers are visible. -# set enable_layer(5) 0 ;# example to disable pin red boxes - -#### enable to scale grid point size as done with lines at close zoom, default: 0 -# set big_grid_points 0 - -#### enable grouping contiguous bits of bus slices in net->pin instance -#### assignments for verilog netlists. Default: disabled (0) -# set verilog_bitblast 0 - -#### allow searching the full search path for schematics associated to symbols -#### instead of looking only in symbol directory. Default: disabled (0). -# set search_schematic 0 - -#### focus the schematic window if mouse goes over it, even if a dialog box -#### is displayed, without needing to click. -#### This allows to move/zoom/pan the schematic while editing attributes. -#### Clicking in the schematic window usually closes the dialog box or starts -#### editing a new component if clicking on a new component. -#### default: enabled (1) -# set autofocus_mainwindow 1 - -#### replace selected text in text widgets when pasting from clipboard -#### default: enabled (1) -# set text_replace_selection 0 - -#### set component browser always above drawing canvas. -#### default: enabled (1) -# set component_browser_on_top 0 - -#### set graph line with multiplier with respect to xschem actual line width -#### default: 2.0 -# set graph_linewidth_mult 2.0 - -########################################################################### -#### EXPORT FORMAT TRANSLATORS, PNG AND PDF -########################################################################### -#### command to translate xpm to png; (assumes command takes source -#### and dest file as arguments, example: gm convert plot.xpm plot.png) -#### default: {gm convert} -#### Windows ghostscript uses gswin64c -# set to_png {gswin64c -sDEVICE=png16m -o} -# set to_png {gm convert} - -#### command to translate ps to pdf; (assumes command takes source -#### and dest file as arguments, example: ps2pdf plot.ps plot.pdf) -#### default: ps2pdf -#### Windows ghostscript uses gswin64c -# set to_pdf {gswin64c -sDEVICE=pdfwrite -o} -# set to_pdf ps2pdf -set to_pdf {ps2pdf -dAutoRotatePages=/None} - -########################################################################### -#### UNDO: SAVE ON DISK OR KEEP IN MEMORY -########################################################################### -#### Alloved: 'disk'or 'memory'. -#### Saving undo on disk is safer but slower on extremely big schematics. -#### In most cases you won't notice any delay. Undo on disk allows previous -#### state recovery in case of crashes. In-memory undo is extremely fast -#### but should a crash occur everything is lost. -#### It is highly recommended to keep undo on disk. -#### Default: disk -# set undo_type disk - -########################################################################### -#### CUSTOM GRID / SNAP VALUE SETTINGS -########################################################################### -#### Warning: changing these values will likely break compatibility -#### with existing symbol libraries. Defaults: grid 20, snap 10. -# set cadgrid 20 -# set cadsnap 10 - -########################################################################### -#### CUSTOM COLORS MAY BE DEFINED HERE -########################################################################### -# set cadlayers 22 -# set light_colors { -# "#ffffff" "#0044ee" "#aaaaaa" "#222222" "#229900" -# "#bb2200" "#00ccee" "#ff0000" "#888800" "#00aaaa" -# "#880088" "#00ff00" "#0000cc" "#666600" "#557755" -# "#aa2222" "#7ccc40" "#00ffcc" "#ce0097" "#d2d46b" -# "#ef6158" "#fdb200" } - -# set dark_colors { -# "#000000" "#00ccee" "#3f3f3f" "#cccccc" "#88dd00" -# "#bb2200" "#00ccee" "#ff0000" "#ffff00" "#ffffff" -# "#ff00ff" "#00ff00" "#0000cc" "#aaaa00" "#aaccaa" -# "#ff7777" "#bfff81" "#00ffcc" "#ce0097" "#d2d46b" -# "#ef6158" "#fdb200" } - -########################################################################### -#### CAIRO STUFF -########################################################################### -#### Scale all fonts by this number -# set cairo_font_scale 1.0 - -#### default for following two is 0.85 (xscale) and 0.88 (yscale) to -#### match cairo font spacing -# set nocairo_font_xscale 1.0 -#### set nocairo_font_yscale 1.0 - -#### Scale line spacing by this number -# set cairo_font_line_spacing 1.0 - -#### Specify a font -# set cairo_font_name {Sans-Serif} -# set svg_font_name {Sans-Serif} - -#### Lift up text by some zoom-corrected pixels for -#### better compatibility wrt no cairo version. -#### Useful values in the range [-1, 3] -# set cairo_vert_correct 0 -# set nocairo_vert_correct 0 - -########################################################################### -#### KEYBINDINGS -########################################################################### -#### General format for specifying a replacement for a keybind -#### Replace Ctrl-q with Escape (so you wont kill the program) -# set replace_key(Control-q) Escape - -#### swap w and W keybinds; Always specify Shift for capital letters -# set replace_key(Shift-W) Key-w -# set replace_key(Key-w) Shift-W - -########################################################################### -#### TERMINAL -########################################################################### -#### default for linux: xterm -# set terminal {xterm -geometry 100x35 -fn 9x15 -bg black -fg white -cr white -ms white } -#### lxterminal is not OK since it will not inherit env vars: -#### In order to reduce memory usage and increase the performance, all instances -#### of the lxterminal are sharing a single process. LXTerminal is part of LXDE - -########################################################################### -#### EDITOR -########################################################################### -#### editor must not detach from launching shell (-f mandatory for gvim) -#### default for linux: gvim -f -# set editor {gvim -f -geometry 90x28} -# set editor { xterm -geometry 100x40 -e nano } -# set editor { xterm -geometry 100x40 -e pico } - -#### For Windows -# set editor {notepad.exe} - -########################################################################### -#### SHOW ERC INFO WINDOW (erc errors, warnings etc) -########################################################################### -#### default: 0 (can be enabled by menu) -# set show_infowindow 0 - -########################################################################### -#### ALWAYS SHOW ERC INFO WINDOW AFTER NETLIST -########################################################################### -#### default: 0 -# set show_infowindow_after_netlist 0 - -########################################################################### -#### TCP CONNECTION WITH GAW -########################################################################### -#### set gaw address for socket connection: {host port} -#### default: set to localhost, port 2020 -# set gaw_tcp_address {localhost 2020} - -########################################################################### -#### XSCHEM LISTEN TO TCP PORT -########################################################################### -#### set xschem listening port; default: not enabled -# set xschem_listen_port 2021 - -########################################################################### -#### BESPICE WAVE SOCKET CONNECTION -########################################################################### -#### set bespice wave listening port; default: not enabled -set bespice_listen_port 2022 - -########################################################################### -#### TCL FILES TO LOAD AT STARTUP -########################################################################### -#### list of tcl files to preload. -set tcl_files {} -# lappend tcl_files ${XSCHEM_SHAREDIR}/ngspice_backannotate.tcl -# lappend tcl_files ${XSCHEM_SHAREDIR}/change_index.tcl -# lappend tcl_files .... - -########################################################################### -#### WEB URL DOWNLOAD HELPER APPLICATION -########################################################################### -#### used to download files from web: default: {curl -f -s -O -J} -# set download_url_helper {curl -f -s -O -J} -# set download_url_helper {wget -N --quiet --content-disposition} - -########################################################################### -#### XSCHEM TOOLBAR -########################################################################### -#### default: not enabled. -set toolbar_visible 1 -# set toolbar_horiz 1 - -########################################################################### -#### TABBED WINDOWS -########################################################################### -# default: not enabled. Interface can be changed runtime if only one window -# or tab is open. -set tabbed_interface 1 - -########################################################################### -#### CASE INSENSITIVE SYMBOL LOOKUP -########################################################################### -## this option might be useful on filesystems that are case insensitive and -## on designs ported from windows where case of file names does not matter. -## if this option is set symbol lookup will be case insensitive, -## so a symbol reference 'AMPLI.SYM' will match with 'ampli.sym' or -## Amply.sym on disk. File system must be case insensitive for this to work, -## like FAT32 or NTFS. -## Do not set this option if you don't know what you are doing. -## Default: not enabled (0) -# set case_insensitive 1 - -########################################################################### -#### HIDE GRAPHS IF NO SPICE DATA LOADED -########################################################################### -## if enabled graphs will be hidden if no data is loaded. -## default: not enabled (0) -# set hide_empty_graphs 0 - -########################################################################### -#### SHOW HIDDEN TEXTS -########################################################################### -## This option shows text objects even if they have attribute 'hide=true' set -## default: 0 (not set) -# set show_hidden_texts 1 - -########################################################################### -#### LIVE BACKANNOTATION OF DATA AT CURSOR 2 (B) POSITION -########################################################################### -## if enabled will backannotate values in schematic at cursor 'b' position -## in graph. Default: enabled (1) -set live_cursor2_backannotate 1 - -########################################################################### -#### SKYWATER PDK SPECIFIC VARIABLES -########################################################################### - -## check if env var PDK_ROOT exists, and use it for building open_pdks paths -if { [info exists env(PDK_ROOT)] && $env(PDK_ROOT) ne {} } { - ## found variable, set tcl PDK_ROOT var - if {![file isdir $env(PDK_ROOT)]} { - puts stderr "Warning: PDK_ROOT environment variable is set but path not found on the system." - } - set PDK_ROOT $env(PDK_ROOT) -} else { - ## not existing or empty. - puts stderr "Warning: PDK_ROOT env. var. not found or empty, trying to find an open_pdks install" - if {[file isdir /usr/share/pdk]} {set PDK_ROOT /usr/share/pdk - } elseif {[file isdir /usr/local/share/pdk]} {set PDK_ROOT /usr/local/share/pdk - } elseif {[file isdir $env(HOME)/share/pdk]} {set PDK_ROOT $env(HOME)/share/pdk - } else { - puts stderr {No open_pdks installation found, set PDK_ROOT env. var. and restart xschem} - } +# Source the PDK xschemrc file +if {![info exists PDK]} { + source $env(PDK_ROOT)/$env(PDK)/libs.tech/xschem/xschemrc } -if {[info exists PDK_ROOT]} { - ## get process variant - if {[info exists env(PDK)]} { - set PDK $env(PDK) - } else { - set PDK sky130A - } - # set SKYWATER_MODELS ${PDK_ROOT}/${PDK}/libs.tech/ngspice - set SKYWATER_MODELS ${PDK_ROOT}/${PDK}/libs.tech/combined - set SKYWATER_STDCELLS ${PDK_ROOT}/${PDK}/libs.ref/sky130_fd_sc_hd/spice - puts stderr "open_pdks installation: using $PDK_ROOT" - puts stderr "SKYWATER_MODELS: $SKYWATER_MODELS" - puts stderr "SKYWATER_STDCELLS: $SKYWATER_STDCELLS" -} - -# sky130 mosfets dimension checks -proc fet_drc {instance symbol model w l {nf 1}} { - set res {} - # puts "$instance $model $symbol w=$w l=$l nf=$nf" - if { [string is double $w] && [string is double $l] && [string is integer $nf]} { - # not *_nf.sym devices: get single finger width - if {![regexp {fet.*_nf\.sym$} $symbol]} { - set w [expr { double($w) / double($nf)}] - } - switch -regexp $model { - {[np]fet_01v8$} { - if { $w < 0.42 } { - append res "${instance} ($model): finger width is too small, w / nf = $w" \n - } - if { $l < 0.15 } { - append res "${instance} ($model): length is too small, l = $l" \n - } - } - {pfet_01v8_lvt$} { - if { $w < 0.42 } { - append res "${instance} ($model): finger width is too small, w / nf = $w" \n - } - if { $l < 0.35 } { - append res "${instance} ($model): length is too small, l = $l" \n - } - } - {nfet_01v8_lvt$} { - if { $w < 0.42 } { - append res "${instance} ($model): finger width is too small, w / nf = $w" \n - } - if { $l < 0.15 } { - append res "${instance} ($model): length is too small, l = $l" \n - } - } - {[np]fet_g5v0d10v5$} { - if { $w < 0.42 } { - append res "${instance} ($model): finger width is too small, w / nf = $w" \n - } - if { $l < 0.5 } { - append res "${instance} ($model): length is too small, l = $l" \n - } - } - {pfet_g5v0d16v0$} { - if { $w < 5 } { - append res "${instance} ($model): finger width is too small, w / nf = $w" \n - } - if { $l < 0.66 } { - append res "${instance} ($model): length is too small, l = $l" \n - } - } - {nfet_g5v0d16v0$} { - if { $w < 5 } { - append res "${instance} ($model): finger width is too small, w / nf = $w" \n - } - if { $l < 0.7 } { - append res "${instance} ($model): length is too small, l = $l" \n - } - } - } ;# switch - } - return $res -} - -# open_pdks specific: -# Set variables after ${PDK_ROOT} is known -# This overrides some of the variables set above. - -set XSCHEM_START_WINDOW ${PDK_ROOT}/${PDK}/libs.tech/xschem/sky130_tests/top.sch -append XSCHEM_LIBRARY_PATH :${PDK_ROOT}/${PDK}/libs.tech/xschem - -# allow a user-specific path add-on (https://github.com/iic-jku/iic-osic-tools/issues/7) -if { [info exists ::env(XSCHEM_USER_LIBRARY_PATH) ] } { - append XSCHEM_LIBRARY_PATH :$env(XSCHEM_USER_LIBRARY_PATH) -} +# Add current directory to xschem library path +append XSCHEM_LIBRARY_PATH :[file dirname [info script]] diff --git a/xschem/xschemrc_old b/xschem/xschemrc_old new file mode 100644 index 0000000..3701927 --- /dev/null +++ b/xschem/xschemrc_old @@ -0,0 +1,508 @@ +#### xschemrc system configuration file + +#### values may be overridden by user's ~/.xschem/xschemrc configuration file +#### or by project-local ./xschemrc + +########################################################################### +#### XSCHEM INSTALLATION DIRECTORY: XSCHEM_SHAREDIR +########################################################################### +#### Normally there is no reason to set this variable if using standard +#### installation. Location of files is set at compile time but may be overridden +#### with following line: +# set XSCHEM_SHAREDIR $env(HOME)/share/xschem + +########################################################################### +#### XSCHEM SYSTEM-WIDE DESIGN LIBRARY PATHS: XSCHEM_LIBRARY_PATH +########################################################################### +#### If unset xschem starts with XSCHEM_LIBRARY_PATH set to the default, typically: +# ${HOME}/.xschem/xschem_library +# /share/xschem/xschem_library/devices +# /share/doc/xschem/examples +# /share/doc/xschem/ngspice +# /share/doc/xschem/logic +# /share/doc/xschem/xschem_simulator +# /share/doc/xschem/binto7seg +# /share/doc/xschem/pcb +# /share/doc/xschem/rom8k + +#### Flush any previous definition +set XSCHEM_LIBRARY_PATH {} +#### include devices/*.sym +append XSCHEM_LIBRARY_PATH ${XSCHEM_SHAREDIR}/xschem_library +#### include skywater libraries. Here i use [pwd]. This works if i start xschem from here. +append XSCHEM_LIBRARY_PATH :[file dirname [info script]] +#### add ~/.xschem/xschem_library (USER_CONF_DIR is normally ~/.xschem) +append XSCHEM_LIBRARY_PATH :$USER_CONF_DIR/xschem_library + +########################################################################### +#### SET CUSTOM COLORS FOR XSCHEM LIBRARIES MATCHING CERTAIN PATTERNS +########################################################################### +#### each line contains a dircolor(pattern) followed by a color +#### color can be an ordinary name (grey, brown, blue) or a hex code {#77aaff} +#### hex code must be enclosed in braces +array unset dircolor +set dircolor(sky130_fd_pr$) blue +set dircolor(sky130_tests$) blue +set dircolor(xschem_sky130$) blue +set dircolor(xschem_library$) red +set dircolor(devices$) red + +########################################################################### +#### WINDOW TO OPEN ON STARTUP: XSCHEM_START_WINDOW +########################################################################### +#### Start without a design if no filename given on command line: +#### To avoid absolute paths, use a path that is relative to one of the +#### XSCHEM_LIBRARY_PATH directories. Default: empty +set XSCHEM_START_WINDOW {sky130_tests/top.sch} + +########################################################################### +#### DIRECTORY WHERE SIMULATIONS, NETLIST AND SIMULATOR OUTPUTS ARE PLACED +########################################################################### +#### If unset $USER_CONF_DIR/simulations is assumed (normally ~/.xschem/simulations) +# set netlist_dir $env(HOME)/.xschem/simulations +#### if this is set to '1' netlists and simulations will go into a simulation/ folder +#### inside the directory containing the top level schematic. Default: not set (0) +# set local_netlist_dir 1 + +########################################################################### +#### NETLIST AND HIERARCHICAL PRINT EXCLUDE PATTERNS +########################################################################### +#### xschem_libs is a list of patterns of cells to exclude from netlisting. +#### Matching is done as regular expression on full cell path +#### Example: +#### set xschem_libs { {/cmoslib/} {/analoglib/.*pass} buffer } +#### in this case all schematic cells of directory cmoslib and cells containing +#### /analoglib/...pass and buffer will be excluded from netlisting +#### default value: empty +# set xschem_libs {} +#### noprint_libs is a list with same rules as for xschem_libs. This +#### variable controls hierarchical print +#### default value: empty +# set noprint_libs {} +#### nolist_libs is a list with same rules as for xschem_libs. This +#### variable controls cell listing in procedure list_hierarchy. +#### default value: empty +# set nolist_libs {} + +########################################################################### +#### CHANGE DEFAULT [] WITH SOME OTHER CHARACTERS FOR BUSSED SIGNALS +#### IN SPICE NETLISTS (EXAMPLE: DATA[7] --> DATA<7>) +########################################################################### +#### default: empty (use xschem default, [ ]) +# set bus_replacement_char {<>} +#### for XSPICE: replace square brackets as the are used for XSPICE vector nodes. +# set bus_replacement_char {__} + +########################################################################### +#### SOME DEFAULT BEHAVIOR +########################################################################### +#### Allowed values: spice, verilog, vhdl, tedax, default: spice +# set netlist_type spice + +#### Some netlisting options (these are the defaults) +# set verilog_2001 1 + +#### to use a fixed line width set change_lw to 0 and set some value to line_width +#### these are the defaults +# set line_width 0 +# set change_lw 1 + +#### allow color postscript and svg exports. Default: 1, enable color +# set color_ps 1 + +#### set paper size: name, height, width. Sizes in 1/72 of an inch (typographical points) +#### default: {a4 842 595} +# set ps_paper_size {a4 842 595} +# set ps_paper_size {letter 792 612} + +#### initial size of xschem window you can specify also position with (wxh+x+y) +#### this is the default: +# set initial_geometry {900x600} +set initial_geometry {1280x695+0+0} + +#### if set to 0, when zooming out allow the viewport do drift toward the mouse position, +#### allowing to move away by zooming / unzooming with mouse wheel +#### default setting: 0 +# set unzoom_nodrift 0 + +#### if set to 1 full zoom will center the drawing instead of anhoring to lower +#### left corner. Default: 0 +set zoom_full_center 1 + +#### if set to 1 allow to place multiple components with same name. +#### Warning: this is normally not allowed in any simulation netlist. +#### default: 0, do not allow place multiple elements with same name (refdes) +# set disable_unique_names 0 + +#### if set to 1 continue drawing lines / wires after click +#### default: 0 +# set persistent_command 1 + +#### if set to 1 a wire is inserted when separating components that are +#### connected by pins. Default: not enabled (0) +# set connect_by_kissing 1 + +#### if set to 1 automatically join/trim wires while editing +#### this may slow down on rally big designs. Can be disabled via menu +#### default: 0 +# set autotrim_wires 0 + +#### set widget scaling (mainly for font display), this is useful on 4K displays +#### default: unset (tk uses its default) > 1.0 ==> bigger +# set tk_scaling 1.7 + +#### use the tclreadline package if available , Default: 1 (enabled). +# set use_tclreadline 1 + +#### disable some symbol layers. Default: none, all layers are visible. +# set enable_layer(5) 0 ;# example to disable pin red boxes + +#### enable to scale grid point size as done with lines at close zoom, default: 0 +# set big_grid_points 0 + +#### enable grouping contiguous bits of bus slices in net->pin instance +#### assignments for verilog netlists. Default: disabled (0) +# set verilog_bitblast 0 + +#### allow searching the full search path for schematics associated to symbols +#### instead of looking only in symbol directory. Default: disabled (0). +# set search_schematic 0 + +#### focus the schematic window if mouse goes over it, even if a dialog box +#### is displayed, without needing to click. +#### This allows to move/zoom/pan the schematic while editing attributes. +#### Clicking in the schematic window usually closes the dialog box or starts +#### editing a new component if clicking on a new component. +#### default: enabled (1) +# set autofocus_mainwindow 1 + +#### replace selected text in text widgets when pasting from clipboard +#### default: enabled (1) +# set text_replace_selection 0 + +#### set component browser always above drawing canvas. +#### default: enabled (1) +# set component_browser_on_top 0 + +#### set graph line with multiplier with respect to xschem actual line width +#### default: 2.0 +# set graph_linewidth_mult 2.0 + +########################################################################### +#### EXPORT FORMAT TRANSLATORS, PNG AND PDF +########################################################################### +#### command to translate xpm to png; (assumes command takes source +#### and dest file as arguments, example: gm convert plot.xpm plot.png) +#### default: {gm convert} +#### Windows ghostscript uses gswin64c +# set to_png {gswin64c -sDEVICE=png16m -o} +# set to_png {gm convert} + +#### command to translate ps to pdf; (assumes command takes source +#### and dest file as arguments, example: ps2pdf plot.ps plot.pdf) +#### default: ps2pdf +#### Windows ghostscript uses gswin64c +# set to_pdf {gswin64c -sDEVICE=pdfwrite -o} +# set to_pdf ps2pdf +set to_pdf {ps2pdf -dAutoRotatePages=/None} + +########################################################################### +#### UNDO: SAVE ON DISK OR KEEP IN MEMORY +########################################################################### +#### Alloved: 'disk'or 'memory'. +#### Saving undo on disk is safer but slower on extremely big schematics. +#### In most cases you won't notice any delay. Undo on disk allows previous +#### state recovery in case of crashes. In-memory undo is extremely fast +#### but should a crash occur everything is lost. +#### It is highly recommended to keep undo on disk. +#### Default: disk +# set undo_type disk + +########################################################################### +#### CUSTOM GRID / SNAP VALUE SETTINGS +########################################################################### +#### Warning: changing these values will likely break compatibility +#### with existing symbol libraries. Defaults: grid 20, snap 10. +# set cadgrid 20 +# set cadsnap 10 + +########################################################################### +#### CUSTOM COLORS MAY BE DEFINED HERE +########################################################################### +# set cadlayers 22 +# set light_colors { +# "#ffffff" "#0044ee" "#aaaaaa" "#222222" "#229900" +# "#bb2200" "#00ccee" "#ff0000" "#888800" "#00aaaa" +# "#880088" "#00ff00" "#0000cc" "#666600" "#557755" +# "#aa2222" "#7ccc40" "#00ffcc" "#ce0097" "#d2d46b" +# "#ef6158" "#fdb200" } + +# set dark_colors { +# "#000000" "#00ccee" "#3f3f3f" "#cccccc" "#88dd00" +# "#bb2200" "#00ccee" "#ff0000" "#ffff00" "#ffffff" +# "#ff00ff" "#00ff00" "#0000cc" "#aaaa00" "#aaccaa" +# "#ff7777" "#bfff81" "#00ffcc" "#ce0097" "#d2d46b" +# "#ef6158" "#fdb200" } + +########################################################################### +#### CAIRO STUFF +########################################################################### +#### Scale all fonts by this number +# set cairo_font_scale 1.0 + +#### default for following two is 0.85 (xscale) and 0.88 (yscale) to +#### match cairo font spacing +# set nocairo_font_xscale 1.0 +#### set nocairo_font_yscale 1.0 + +#### Scale line spacing by this number +# set cairo_font_line_spacing 1.0 + +#### Specify a font +# set cairo_font_name {Sans-Serif} +# set svg_font_name {Sans-Serif} + +#### Lift up text by some zoom-corrected pixels for +#### better compatibility wrt no cairo version. +#### Useful values in the range [-1, 3] +# set cairo_vert_correct 0 +# set nocairo_vert_correct 0 + +########################################################################### +#### KEYBINDINGS +########################################################################### +#### General format for specifying a replacement for a keybind +#### Replace Ctrl-q with Escape (so you wont kill the program) +# set replace_key(Control-q) Escape + +#### swap w and W keybinds; Always specify Shift for capital letters +# set replace_key(Shift-W) Key-w +# set replace_key(Key-w) Shift-W + +########################################################################### +#### TERMINAL +########################################################################### +#### default for linux: xterm +# set terminal {xterm -geometry 100x35 -fn 9x15 -bg black -fg white -cr white -ms white } +#### lxterminal is not OK since it will not inherit env vars: +#### In order to reduce memory usage and increase the performance, all instances +#### of the lxterminal are sharing a single process. LXTerminal is part of LXDE + +########################################################################### +#### EDITOR +########################################################################### +#### editor must not detach from launching shell (-f mandatory for gvim) +#### default for linux: gvim -f +# set editor {gvim -f -geometry 90x28} +# set editor { xterm -geometry 100x40 -e nano } +# set editor { xterm -geometry 100x40 -e pico } + +#### For Windows +# set editor {notepad.exe} + +########################################################################### +#### SHOW ERC INFO WINDOW (erc errors, warnings etc) +########################################################################### +#### default: 0 (can be enabled by menu) +# set show_infowindow 0 + +########################################################################### +#### ALWAYS SHOW ERC INFO WINDOW AFTER NETLIST +########################################################################### +#### default: 0 +# set show_infowindow_after_netlist 0 + +########################################################################### +#### TCP CONNECTION WITH GAW +########################################################################### +#### set gaw address for socket connection: {host port} +#### default: set to localhost, port 2020 +# set gaw_tcp_address {localhost 2020} + +########################################################################### +#### XSCHEM LISTEN TO TCP PORT +########################################################################### +#### set xschem listening port; default: not enabled +# set xschem_listen_port 2021 + +########################################################################### +#### BESPICE WAVE SOCKET CONNECTION +########################################################################### +#### set bespice wave listening port; default: not enabled +set bespice_listen_port 2022 + +########################################################################### +#### TCL FILES TO LOAD AT STARTUP +########################################################################### +#### list of tcl files to preload. +set tcl_files {} +# lappend tcl_files ${XSCHEM_SHAREDIR}/ngspice_backannotate.tcl +# lappend tcl_files ${XSCHEM_SHAREDIR}/change_index.tcl +# lappend tcl_files .... + +########################################################################### +#### WEB URL DOWNLOAD HELPER APPLICATION +########################################################################### +#### used to download files from web: default: {curl -f -s -O -J} +# set download_url_helper {curl -f -s -O -J} +# set download_url_helper {wget -N --quiet --content-disposition} + +########################################################################### +#### XSCHEM TOOLBAR +########################################################################### +#### default: not enabled. +set toolbar_visible 1 +# set toolbar_horiz 1 + +########################################################################### +#### TABBED WINDOWS +########################################################################### +# default: not enabled. Interface can be changed runtime if only one window +# or tab is open. +set tabbed_interface 1 + +########################################################################### +#### CASE INSENSITIVE SYMBOL LOOKUP +########################################################################### +## this option might be useful on filesystems that are case insensitive and +## on designs ported from windows where case of file names does not matter. +## if this option is set symbol lookup will be case insensitive, +## so a symbol reference 'AMPLI.SYM' will match with 'ampli.sym' or +## Amply.sym on disk. File system must be case insensitive for this to work, +## like FAT32 or NTFS. +## Do not set this option if you don't know what you are doing. +## Default: not enabled (0) +# set case_insensitive 1 + +########################################################################### +#### HIDE GRAPHS IF NO SPICE DATA LOADED +########################################################################### +## if enabled graphs will be hidden if no data is loaded. +## default: not enabled (0) +# set hide_empty_graphs 0 + +########################################################################### +#### SHOW HIDDEN TEXTS +########################################################################### +## This option shows text objects even if they have attribute 'hide=true' set +## default: 0 (not set) +# set show_hidden_texts 1 + +########################################################################### +#### LIVE BACKANNOTATION OF DATA AT CURSOR 2 (B) POSITION +########################################################################### +## if enabled will backannotate values in schematic at cursor 'b' position +## in graph. Default: enabled (1) +set live_cursor2_backannotate 1 + +########################################################################### +#### SKYWATER PDK SPECIFIC VARIABLES +########################################################################### + +## check if env var PDK_ROOT exists, and use it for building open_pdks paths +if { [info exists env(PDK_ROOT)] && $env(PDK_ROOT) ne {} } { + ## found variable, set tcl PDK_ROOT var + if {![file isdir $env(PDK_ROOT)]} { + puts stderr "Warning: PDK_ROOT environment variable is set but path not found on the system." + } + set PDK_ROOT $env(PDK_ROOT) +} else { + ## not existing or empty. + puts stderr "Warning: PDK_ROOT env. var. not found or empty, trying to find an open_pdks install" + if {[file isdir /usr/share/pdk]} {set PDK_ROOT /usr/share/pdk + } elseif {[file isdir /usr/local/share/pdk]} {set PDK_ROOT /usr/local/share/pdk + } elseif {[file isdir $env(HOME)/share/pdk]} {set PDK_ROOT $env(HOME)/share/pdk + } else { + puts stderr {No open_pdks installation found, set PDK_ROOT env. var. and restart xschem} + } +} + +if {[info exists PDK_ROOT]} { + ## get process variant + if {[info exists env(PDK)]} { + set PDK $env(PDK) + } else { + set PDK sky130A + } + # set SKYWATER_MODELS ${PDK_ROOT}/${PDK}/libs.tech/ngspice + set SKYWATER_MODELS ${PDK_ROOT}/${PDK}/libs.tech/combined + set SKYWATER_STDCELLS ${PDK_ROOT}/${PDK}/libs.ref/sky130_fd_sc_hd/spice + puts stderr "open_pdks installation: using $PDK_ROOT" + puts stderr "SKYWATER_MODELS: $SKYWATER_MODELS" + puts stderr "SKYWATER_STDCELLS: $SKYWATER_STDCELLS" +} + +# sky130 mosfets dimension checks +proc fet_drc {instance symbol model w l {nf 1}} { + set res {} + # puts "$instance $model $symbol w=$w l=$l nf=$nf" + if { [string is double $w] && [string is double $l] && [string is integer $nf]} { + # not *_nf.sym devices: get single finger width + if {![regexp {fet.*_nf\.sym$} $symbol]} { + set w [expr { double($w) / double($nf)}] + } + switch -regexp $model { + {[np]fet_01v8$} { + if { $w < 0.42 } { + append res "${instance} ($model): finger width is too small, w / nf = $w" \n + } + if { $l < 0.15 } { + append res "${instance} ($model): length is too small, l = $l" \n + } + } + {pfet_01v8_lvt$} { + if { $w < 0.42 } { + append res "${instance} ($model): finger width is too small, w / nf = $w" \n + } + if { $l < 0.35 } { + append res "${instance} ($model): length is too small, l = $l" \n + } + } + {nfet_01v8_lvt$} { + if { $w < 0.42 } { + append res "${instance} ($model): finger width is too small, w / nf = $w" \n + } + if { $l < 0.15 } { + append res "${instance} ($model): length is too small, l = $l" \n + } + } + {[np]fet_g5v0d10v5$} { + if { $w < 0.42 } { + append res "${instance} ($model): finger width is too small, w / nf = $w" \n + } + if { $l < 0.5 } { + append res "${instance} ($model): length is too small, l = $l" \n + } + } + {pfet_g5v0d16v0$} { + if { $w < 5 } { + append res "${instance} ($model): finger width is too small, w / nf = $w" \n + } + if { $l < 0.66 } { + append res "${instance} ($model): length is too small, l = $l" \n + } + } + {nfet_g5v0d16v0$} { + if { $w < 5 } { + append res "${instance} ($model): finger width is too small, w / nf = $w" \n + } + if { $l < 0.7 } { + append res "${instance} ($model): length is too small, l = $l" \n + } + } + } ;# switch + } + return $res +} + +# open_pdks specific: +# Set variables after ${PDK_ROOT} is known +# This overrides some of the variables set above. + +set XSCHEM_START_WINDOW ${PDK_ROOT}/${PDK}/libs.tech/xschem/sky130_tests/top.sch +append XSCHEM_LIBRARY_PATH :${PDK_ROOT}/${PDK}/libs.tech/xschem + +# allow a user-specific path add-on (https://github.com/iic-jku/iic-osic-tools/issues/7) +if { [info exists ::env(XSCHEM_USER_LIBRARY_PATH) ] } { + append XSCHEM_LIBRARY_PATH :$env(XSCHEM_USER_LIBRARY_PATH) +}