Skip to content
LIBRARY
Analog.Semiconductors.Tests.PMOSTest.md

Analog.Semiconductors.Tests.PMOSTest ​

Test circuit for PMOS: the polarity mirror of the NMOS test bench.

Source and bulk sit on the 1.8 V rail and the drain is loaded by 1 kOhm to ground, so drain current pulls the output node up. The gate ramps 1.8 V down to 0 over 1 s, crossing the same three regions with every comparison reversed.

Vt is negative here, -1.0 V on the default MSL card. The device conducts once ugst = (Vgate - 1.8 - Vt)*K5 goes negative, i.e. below Vgate = 0.8.

m.d.i is the drain pin current and is negative throughout; cout.v rises from 0 toward the rail as the device turns on.

Usage ​

ElectricalComponents.Analog.Semiconductors.Tests.PMOSTest()

Behavior ​

Source ​

dyad
"""
Test circuit for PMOS: the polarity mirror of the NMOS test bench.

Source and bulk sit on the 1.8 V rail and the drain is loaded by 1 kOhm to ground, so
drain current pulls the output node up. The gate ramps 1.8 V down to 0 over 1 s,
crossing the same three regions with every comparison reversed.

**`Vt` is negative here**, `-1.0` V on the default MSL card. The device conducts once
`ugst = (Vgate - 1.8 - Vt)*K5` goes negative, i.e. below `Vgate = 0.8`.

`m.d.i` is the drain pin current and is negative throughout; `cout.v` rises from 0
toward the rail as the device turns on.
"""
test component PMOSTest
  "Supply rail level (1.8 V)"
  supply_lvl = BlockComponents.Sources.Constant(k = 1.8) {
    "Dyad": {"placement": {"diagram": {"x1": 160, "y1": 576, "x2": 260, "y2": 676}}}
  }
  "Supply rail"
  supply = ElectricalComponents.Analog.Sources.VoltageSource() {
    "Dyad": {"placement": {"diagram": {"x1": 295, "y1": 681, "x2": 395, "y2": 781}}}
  }
  "Gate ramp: 1.8 V down to 0 over 1 s"
  gate_sig = BlockComponents.Sources.Ramp(offset = 1.8, height = -1.8, duration = 1) {
    "Dyad": {"placement": {"diagram": {"x1": 290, "y1": 276, "x2": 390, "y2": 376}}}
  }
  "Gate drive"
  gate = ElectricalComponents.Analog.Sources.VoltageSource() {
    "Dyad": {"placement": {"diagram": {"x1": 435, "y1": 566, "x2": 535, "y2": 666}}}
  }
  "Drain load resistor (1 kΩ)"
  rd = ElectricalComponents.Analog.Basic.Resistor(R = 1000) {
    "Dyad": {"placement": {"diagram": {"x1": 35, "y1": 476, "x2": 135, "y2": 576}}}
  }
  "MOSFET under test"
  m = ElectricalComponents.Analog.Semiconductors.PMOS() {
    "Dyad": {"placement": {"diagram": {"x1": 565, "y1": 666, "x2": 665, "y2": 766}}}
  }
  "Output node capacitance (1 µF); supplies the differential state"
  cout = ElectricalComponents.Analog.Basic.Capacitor(C = 1u) {
    "Dyad": {"placement": {"diagram": {"x1": 165, "y1": 376, "x2": 265, "y2": 476}}}
  }
  "Ground reference"
  ground = ElectricalComponents.Analog.Basic.Ground() {
    "Dyad": {"placement": {"diagram": {"x1": 570, "y1": 75, "x2": 670, "y2": 175}}}
  }
relations
  "Gate starts at the rail, so the device is off and the output sits at ground"
  initial cout.v = 0
  connect(supply_lvl.y, supply.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 345, "y": 626}], "E": 2}], "path": {}}}
  connect(gate_sig.y, gate.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 485, "y": 326}], "E": 2}], "path": {}}}
  connect(supply.p, m.s, m.b) {
    "Dyad": {
      "edges": [
        {
          "S": 1,
          "M": [{"x": 280, "y": 731}, {"x": 280, "y": 831}, {"x": 615, "y": 831}],
          "E": 2
        },
        {
          "S": 2,
          "M": [{"x": 615, "y": 781}, {"x": 680, "y": 781}, {"x": 680, "y": 716}],
          "E": 3
        }
      ],
      "path": {}
    }
  }
  connect(m.d, rd.p, cout.p) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [{"x": 615, "y": 225}, {"x": 20, "y": 225}], "E": -1},
        {"S": -1, "M": [{"x": 20, "y": 526}], "E": 2},
        {"S": -1, "M": [], "E": 3}
      ],
      "junctions": [{"x": 20, "y": 426}],
      "path": {}
    }
  }
  connect(gate.p, m.g) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 420, "y": 616}, {"x": 420, "y": 716}], "E": 2}],
      "path": {}
    }
  }
  connect(rd.n, cout.n, supply.n, gate.n, ground.g) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [{"x": 280, "y": 526}], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [], "E": -2},
        {"S": -2, "M": [{"x": 410, "y": 731}], "E": 3},
        {"S": -2, "M": [{"x": 410, "y": 316}], "E": -3},
        {"S": -3, "M": [{"x": 550, "y": 616}], "E": 4},
        {
          "S": 4,
          "M": [{"x": 550, "y": 616}, {"x": 550, "y": 20}, {"x": 620, "y": 20}],
          "E": 5
        }
      ],
      "junctions": [{"x": 280, "y": 426}, {"x": 410, "y": 426}, {"x": 550, "y": 316}],
      "path": {}
    }
  }
metadata {
  "Dyad": {
    "tests": {"case1": {"stop": 1, "expect": {"signals": ["m.d.i", "m.ugst", "cout.v"]}}}
  }
}
end
Flattened Source
dyad
"""
Test circuit for PMOS: the polarity mirror of the NMOS test bench.

Source and bulk sit on the 1.8 V rail and the drain is loaded by 1 kOhm to ground, so
drain current pulls the output node up. The gate ramps 1.8 V down to 0 over 1 s,
crossing the same three regions with every comparison reversed.

**`Vt` is negative here**, `-1.0` V on the default MSL card. The device conducts once
`ugst = (Vgate - 1.8 - Vt)*K5` goes negative, i.e. below `Vgate = 0.8`.

`m.d.i` is the drain pin current and is negative throughout; `cout.v` rises from 0
toward the rail as the device turns on.
"""
test component PMOSTest
  "Supply rail level (1.8 V)"
  supply_lvl = BlockComponents.Sources.Constant(k = 1.8) {
    "Dyad": {"placement": {"diagram": {"x1": 160, "y1": 576, "x2": 260, "y2": 676}}}
  }
  "Supply rail"
  supply = ElectricalComponents.Analog.Sources.VoltageSource() {
    "Dyad": {"placement": {"diagram": {"x1": 295, "y1": 681, "x2": 395, "y2": 781}}}
  }
  "Gate ramp: 1.8 V down to 0 over 1 s"
  gate_sig = BlockComponents.Sources.Ramp(offset = 1.8, height = -1.8, duration = 1) {
    "Dyad": {"placement": {"diagram": {"x1": 290, "y1": 276, "x2": 390, "y2": 376}}}
  }
  "Gate drive"
  gate = ElectricalComponents.Analog.Sources.VoltageSource() {
    "Dyad": {"placement": {"diagram": {"x1": 435, "y1": 566, "x2": 535, "y2": 666}}}
  }
  "Drain load resistor (1 kΩ)"
  rd = ElectricalComponents.Analog.Basic.Resistor(R = 1000) {
    "Dyad": {"placement": {"diagram": {"x1": 35, "y1": 476, "x2": 135, "y2": 576}}}
  }
  "MOSFET under test"
  m = ElectricalComponents.Analog.Semiconductors.PMOS() {
    "Dyad": {"placement": {"diagram": {"x1": 565, "y1": 666, "x2": 665, "y2": 766}}}
  }
  "Output node capacitance (1 µF); supplies the differential state"
  cout = ElectricalComponents.Analog.Basic.Capacitor(C = 1u) {
    "Dyad": {"placement": {"diagram": {"x1": 165, "y1": 376, "x2": 265, "y2": 476}}}
  }
  "Ground reference"
  ground = ElectricalComponents.Analog.Basic.Ground() {
    "Dyad": {"placement": {"diagram": {"x1": 570, "y1": 75, "x2": 670, "y2": 175}}}
  }
relations
  "Gate starts at the rail, so the device is off and the output sits at ground"
  initial cout.v = 0
  connect(supply_lvl.y, supply.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 345, "y": 626}], "E": 2}], "path": {}}}
  connect(gate_sig.y, gate.V) {"Dyad": {"edges": [{"S": 1, "M": [{"x": 485, "y": 326}], "E": 2}], "path": {}}}
  connect(supply.p, m.s, m.b) {
    "Dyad": {
      "edges": [
        {
          "S": 1,
          "M": [{"x": 280, "y": 731}, {"x": 280, "y": 831}, {"x": 615, "y": 831}],
          "E": 2
        },
        {
          "S": 2,
          "M": [{"x": 615, "y": 781}, {"x": 680, "y": 781}, {"x": 680, "y": 716}],
          "E": 3
        }
      ],
      "path": {}
    }
  }
  connect(m.d, rd.p, cout.p) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [{"x": 615, "y": 225}, {"x": 20, "y": 225}], "E": -1},
        {"S": -1, "M": [{"x": 20, "y": 526}], "E": 2},
        {"S": -1, "M": [], "E": 3}
      ],
      "junctions": [{"x": 20, "y": 426}],
      "path": {}
    }
  }
  connect(gate.p, m.g) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 420, "y": 616}, {"x": 420, "y": 716}], "E": 2}],
      "path": {}
    }
  }
  connect(rd.n, cout.n, supply.n, gate.n, ground.g) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [{"x": 280, "y": 526}], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [], "E": -2},
        {"S": -2, "M": [{"x": 410, "y": 731}], "E": 3},
        {"S": -2, "M": [{"x": 410, "y": 316}], "E": -3},
        {"S": -3, "M": [{"x": 550, "y": 616}], "E": 4},
        {
          "S": 4,
          "M": [{"x": 550, "y": 616}, {"x": 550, "y": 20}, {"x": 620, "y": 20}],
          "E": 5
        }
      ],
      "junctions": [{"x": 280, "y": 426}, {"x": 410, "y": 426}, {"x": 550, "y": 316}],
      "path": {}
    }
  }
metadata {
  "Dyad": {
    "tests": {"case1": {"stop": 1, "expect": {"signals": ["m.d.i", "m.ugst", "cout.v"]}}}
  }
}
end


Test Cases ​

Test Case case1 ​

julia
plt

julia
plt

julia
plt