Measurement
The Measurement API allows you to measure characteristics of a net's waveform in real-time.
Average Voltage
from lager import Net, NetType
sck = Net.get('I2C.SCK',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(sck.measurement.voltage_average())
~ lager analog I2C.SCK measure vavg --dut 1
Maximum Voltage
from lager import Net, NetType
sck = Net.get('I2C.SCK',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(sck.measurement.voltage_max())
~ lager analog I2C.SCK measure vmax --dut 1
Minimum Voltage
from lager import Net, NetType
sck = Net.get('I2C.SCK',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(sck.measurement.voltage_min())
~ lager analog I2C.SCK measure vmin --dut 1
Peak to Peak Voltage
from lager import Net, NetType
sck = Net.get('I2C.SCK',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(sck.measurement.voltage_peak_to_peak())
~ lager analog I2C.SCK measure vpp --dut 1
RMS Voltage
from lager import Net, NetType
sck = Net.get('I2C.SCK',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(sck.measurement.voltage_rms())
~ lager analog I2C.SCK measure vrms --dut 1
Waveform Period
from lager import Net, NetType
sck = Net.get('I2C.SCK',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(sck.measurement.period())
~ lager analog I2C.SCK measure period --dut 1
Waveform Frequency
from lager import Net, NetType
sck = Net.get('I2C.SCK',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(sck.measurement.frequency())
~ lager analog I2C.SCK measure freq --dut 1
Duty Cycle
Positive Duty Cycle
from lager import Net, NetType
pwm = Net.get('PWM',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(pwm.measurement.duty_cycle_positive())
~ lager analog PWM measure dc-pos --dut 1
Negative Duty Cycle
from lager import Net, NetType
pwm = Net.get('PWM',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(pwm.measurement.duty_cycle_negative())
~ lager analog PWM measure dc-neg --dut 1
Pulse Width
Positive Pulse Width
from lager import Net, NetType
button = Net.get('BTN',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(button.measurement.pulse_width_positive())
~ lager analog PWM measure pw-pos --dut 1
Negative Pulse Width
from lager import Net, NetType
button = Net.get('BTN',
type=NetType.Analog,
setup_function=setup_nets,
teardown_function=teardown_nets)
print(button.measurement.pulse_width_negative())
~ lager analog PWM measure pw-neg --dut 1