diff --git a/xschem_library/examples/0_examples_top.sch b/xschem_library/examples/0_examples_top.sch index 1568826f..a9fb65f3 100644 --- a/xschem_library/examples/0_examples_top.sch +++ b/xschem_library/examples/0_examples_top.sch @@ -89,7 +89,7 @@ N 410 -350 410 -320 {lab=BUS[2]} N 460 -400 460 -320 {lab=BUS[2:1]} N 860 -460 860 -390 {lab=#net2} N 820 -420 910 -420 {lab=#net1} -C {poweramp.sym} 480 -820 0 0 {name=x1 +C {poweramp.sym} 480 -900 0 0 {name=x1 tclcommand="xschem descend"} C {tesla.sym} 160 -700 0 0 {name=x2} C {test_ne555.sym} 160 -660 0 0 {name=x3} @@ -1459,19 +1459,20 @@ cwtAyKwqggMC8z8AAABAXz/APixDHOviNio/cIyWTt0GHEAHmaX3NW0zQHJvU5F/bTNA3V5CW3kqoL85 UsA+" } C {test_ac.sym} 160 -340 0 0 {name=x15} -C {rom8k.sym} 480 -860 0 0 {name=x17} +C {rom8k.sym} 160 -180 0 0 {name=x17} C {test_doublepin.sym} 160 -300 0 0 {name=x19} -C {classD_amp.sym} 480 -900 0 0 {name=x20} -C {delta_sigma.sym} 480 -740 0 0 {name=x21} -C {solar_panel.sym} 480 -700 0 0 {name=xsolar} +C {classD_amp.sym} 160 -220 0 0 {name=x20} +C {delta_sigma.sym} 480 -820 0 0 {name=x21} +C {solar_panel.sym} 480 -780 0 0 {name=xsolar} C {test_extracted_netlist.sym} 160 -260 0 0 {name=x23 tclcommand="xschem descend"} -C {poweramp_lcc.sym} 480 -780 0 0 {name=x16 +C {poweramp_lcc.sym} 480 -860 0 0 {name=x16 tclcommand="xschem descend"} -C {test_symbolgen.sym} 480 -660 0 0 {name=x18} -C {inst_sch_select.sym} 480 -620 0 0 {name=x24} -C {test_bus_tap.sym} 480 -580 0 0 {name=x22} +C {test_symbolgen.sym} 480 -740 0 0 {name=x18} +C {inst_sch_select.sym} 480 -700 0 0 {name=x24} +C {test_bus_tap.sym} 480 -660 0 0 {name=x22} C {bus_tap.sym} 450 -310 1 1 {name=l5 lab=[2:1]} -C {test_jfet.sym} 480 -540 0 0 {name=x25} -C {test_short_option.sym} 480 -500 0 0 {name=x26} -C {test_lvs_ignore.sym} 480 -460 0 0 {name=x27} +C {test_jfet.sym} 480 -620 0 0 {name=x25} +C {test_short_option.sym} 480 -580 0 0 {name=x26} +C {test_lvs_ignore.sym} 480 -540 0 0 {name=x27} +C {test_generators.sym} 480 -500 0 0 {name=x28} diff --git a/xschem_library/examples/res.tcl b/xschem_library/examples/res.tcl new file mode 100755 index 00000000..70164440 --- /dev/null +++ b/xschem_library/examples/res.tcl @@ -0,0 +1,58 @@ +#!/bin/sh +# the next line restarts using wish \ +exec tclsh "$0" "$@" + +set arg1 [lindex $argv 0] +puts stderr "res value=$arg1" +if {$arg1 > 0.1} { +puts "v {xschem version=3.4.0 file_version=1.2 +} +G {} +K {type=resistor +format=\"@name @pinlist @value m=@m\" +template=\"name=R1 value=1k m=1\" +} +V {} +S {} +E {} +L 4 0 20 0 30 {} +L 4 0 20 7.5 17.5 {} +L 4 -7.5 12.5 7.5 17.5 {} +L 4 -7.5 12.5 7.5 7.5 {} +L 4 -7.5 2.5 7.5 7.5 {} +L 4 -7.5 2.5 7.5 -2.5 {} +L 4 -7.5 -7.5 7.5 -2.5 {} +L 4 -7.5 -7.5 7.5 -12.5 {} +L 4 -7.5 -17.5 7.5 -12.5 {} +L 4 -7.5 -17.5 0 -20 {} +L 4 0 -30 0 -20 {} +L 4 2.5 -22.5 7.5 -22.5 {} +L 4 5 -25 5 -20 {} +B 5 -2.5 -32.5 2.5 -27.5 {name=P dir=inout propag=1 pinnumber=1 goto=1} +B 5 -2.5 27.5 2.5 32.5 {name=M dir=inout propag=0 pinnumber=2 goto=0} +T {@name} -15 -13.75 0 1 0.2 0.2 {} +T {@value} 15 -3.75 0 0 0.2 0.2 {} +T {@#0:net_name} 10 -28.75 0 0 0.15 0.15 {layer=15} +T {@#1:net_name} 10 20 0 0 0.15 0.15 {layer=15} +T {m=@m} -15 1.25 0 1 0.2 0.2 {} +T {@spice_get_current} 12.5 -16.25 0 0 0.2 0.2 {layer=15}" +} else { + +puts "v {xschem version=3.4.0 file_version=1.2 +} +G {} +K {type=show_label +format=\"* shorted: @name @#0:net_name <--> @#1:net_name @value\" +template=\"name=R1 value=0.1\" +} +V {} +S {} +E {} +L 1 0 -30 0 30 {} +B 5 -2.5 -32.5 2.5 -27.5 {name=P dir=inout propag=1 pinnumber=1 goto=1} +B 5 -2.5 27.5 2.5 32.5 {name=P dir=inout propag=0 pinnumber=2 goto=0} +T {@value} 15 -3.75 0 0 0.2 0.2 {} +T {@#0:net_name} 10 -28.75 0 0 0.15 0.15 {layer=15} +T {@#1:net_name} 10 20 0 0 0.15 0.15 {layer=15} +T {@name} -15 -13.75 0 1 0.2 0.2 {}" +} diff --git a/xschem_library/examples/test_generators.sch b/xschem_library/examples/test_generators.sch new file mode 100644 index 00000000..5082a204 --- /dev/null +++ b/xschem_library/examples/test_generators.sch @@ -0,0 +1,85 @@ +v {xschem version=3.4.0 file_version=1.2 +} +G {} +K {} +V {} +S {} +E {} +L 4 290 -510 290 -210 {} +L 4 290 -560 290 -510 {} +P 3 5 400 -440 620 -440 620 -350 400 -350 400 -440 {dash=4} +P 3 5 140 -250 220 -250 220 -170 140 -170 140 -250 {dash=4} +P 3 5 140 -540 220 -540 220 -460 140 -460 140 -540 {dash=4} +P 4 7 710 -390 670 -390 670 -400 640 -390 670 -380 670 -390 710 -390 {} +P 4 7 290 -510 250 -510 250 -520 220 -510 250 -500 250 -510 290 -510 {} +P 4 7 290 -210 250 -210 250 -220 220 -210 250 -200 250 -210 290 -210 {} +T {Resistor generator (res.tcl) +if a value <= 0.1 is given +it becomes a short} 720 -410 0 0 0.4 0.4 { layer=4} +T {Tier generator (tier.tcl) +if 'lab' matches VDD | VCC | VPP shows +as supply node, else show as ground node} 240 -640 0 0 0.4 0.4 { layer=4} +T {Title symbol has embedded TCL command +to enable show_pin_net_names.} 160 -120 0 0 0.4 0.4 { layer=6} +N 180 -300 180 -240 { +lab=VSS} +N 180 -480 180 -360 { +lab=VDD} +N 460 -480 460 -420 { +lab=VDD} +N 180 -480 460 -480 { +lab=VDD} +N 570 -480 570 -420 { +lab=VDD} +N 460 -480 570 -480 { +lab=VDD} +N 460 -360 460 -280 { +lab=#net1} +N 570 -360 570 -280 { +lab=VDD} +C {tier.tcl(@lab\\)} 180 -480 0 0 {name=p1 sig_type=std_logic lab=VDD +tclcommand="edit_file [abs_sym_path tier.tcl]"} +C {tier.tcl(@lab\\)} 180 -240 2 0 {name=p2 sig_type=std_logic lab=VSS +tclcommand="edit_file [abs_sym_path tier.tcl]" +} +C {res.sym} 180 -330 0 0 {name=R1 +value=1k +footprint=1206 +device=resistor +m=1 +net_name=true} +C {lab_show.sym} 180 -380 0 0 {name=l1} +C {lab_show.sym} 180 -260 0 0 {name=l2} +C {capa.sym} 460 -250 0 0 {name=C1 +m=1 +value=1p +footprint=1206 +device="ceramic capacitor" +net_name=true} +C {capa.sym} 570 -250 0 0 {name=C2 +m=1 +value=1p +footprint=1206 +device="ceramic capacitor" +net_name=true} +C {tier.tcl(@lab\\)} 460 -220 2 0 {name=p3 sig_type=std_logic lab=VSS} +C {tier.tcl(@lab\\)} 570 -220 2 0 {name=p4 sig_type=std_logic lab=VSS} +C {res.tcl(@value\\)} 460 -390 0 0 {name=R2 value=100 +net_name=true +tclcommand="edit_file [abs_sym_path res.tcl]" +} +C {res.tcl(@value\\)} 570 -390 0 0 {name=R3 value=0.1 +net_name=true +tclcommand="edit_file [abs_sym_path res.tcl]" +} +C {lab_show.sym} 460 -290 0 0 {name=l3} +C {lab_show.sym} 570 -290 0 0 {name=l4} +C {title.sym} 160 -30 0 0 {name=l5 +author="tcleval([ + if \{$show_pin_net_names == 0\} \{ + set show_pin_net_names 1 + xschem update_all_sym_bboxes + \} + return \{Stefan Schippers\} +])" +} diff --git a/xschem_library/examples/test_generators.sym b/xschem_library/examples/test_generators.sym new file mode 100644 index 00000000..912853f2 --- /dev/null +++ b/xschem_library/examples/test_generators.sym @@ -0,0 +1,11 @@ +v {xschem version=3.4.0 file_version=1.2} +K {type=subcircuit +format="@name @pinlist @symname" +template="name=x1" +} +T {@symname} -85.5 -6 0 0 0.3 0.3 {} +T {@name} 135 -22 0 0 0.2 0.2 {} +L 4 -130 -10 130 -10 {} +L 4 -130 10 130 10 {} +L 4 -130 -10 -130 10 {} +L 4 130 -10 130 10 {} diff --git a/xschem_library/examples/tier.tcl b/xschem_library/examples/tier.tcl new file mode 100755 index 00000000..d168fd78 --- /dev/null +++ b/xschem_library/examples/tier.tcl @@ -0,0 +1,34 @@ +#!/bin/sh +# the next line restarts using wish \ +exec tclsh "$0" "$@" + +set arg1 [lindex $argv 0] + +puts stderr "tier node=$arg1" +puts "v {xschem version=3.4.0 file_version=1.2 +} +G {} +K {type=label +format=\"*.alias @lab\" +template=\"name=p1 sig_type=std_logic lab=xxx\" +net_name=true +} +V {} +S {} +E {} +B 5 -2.5 -2.5 2.5 2.5 {name=P dir=inout propag=1 pinnumber=1 goto=1}" + +if {[regexp -nocase {^(VCC|VDD|VPP)$} $arg1]} { +puts "L 4 -20 -40 20 -40 {} +L 4 0 -40 0 0 {} + + + +T {@#0:net_name} 5 -13.75 0 0 0.15 0.15 {layer=15} +T {@lab} -15 -53.75 0 0 0.2 0.2 {}" +} else { +puts "P 4 7 0 0 0 -20 -10 -20 0 -40 10 -20 0 -20 0 0 {fill=true} +T {@#0:net_name} 5 -13.75 0 0 0.15 0.15 {layer=15} +T {@lab} -15 -53.75 0 0 0.2 0.2 {}" +} +