proc SCHEMATIC_xgate {} {
  make pmos -orient R270 -W WP -L LP -origin {520 310}
  make nmos -orient R90 -W WN -L LN -origin {520 250}
  make inout -name t2 -origin {590 280}
  make inout -orient RX -name t1 -origin {450 280}
  make input -orient R90 -name in -origin {520 190}
  make input -orient R90Y -name in_L -origin {520 370}
  make xgate -origin {730 280}
  make_wire 480 310 450 310
  make_wire 450 250 480 250
  make_wire 560 250 590 250
  make_wire 590 310 560 310
  make_wire 590 280 590 310
  make_wire 590 280 590 250
  make_wire 450 280 450 250
  make_wire 450 280 450 310
  make_text -origin {420 100} -text {Full Transmission Gate Primitive}
  make_line 420 110 640 110
}

proc ICON_xgate args {
  icon_setup $args {{origin {0 0}} {orient R0} {name {}} {M {}} {WP 2.4u} {LP 0.6u} {WN 1.2u} {LN 0.6u}}
  icon_term -type inout -origin {30 0} -name t2
  icon_term -type input -origin {0 -30} -orient R90 -name in
  icon_term -type input -origin {0 40} -orient R270 -name in_L
  icon_term -type inout -origin {-30 0} -orient RX -name t1
  icon_line -30 -30 -30 30 30 0 -30 -30
  icon_arc -10 20 10 40 -start 0 -extent 359
  icon_property -origin {-120 120} -type user -name name
  icon_property -origin {-120 140} -type user -name M
  icon_property -origin {-120 160} -type user -name WP -default 2.4u
  icon_property -origin {-120 180} -type user -name LP -default 0.6u
  icon_property -origin {-120 200} -type user -name WN -default 1.2u
  icon_property -origin {-120 220} -type user -name LN -default 0.6u
  icon_property -origin {-20 -10} -label {P:$WP}
  icon_property -origin {-20 10} -label {N:$WN}
  icon_line 30 -30 30 30 -30 0 30 -30
  icon_line 0 -30 0 -10
}

