-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Labels
Description
The current way is somewhat clumsy: For the tolerance you can specify a tolerance this way (put these statements right before compare):
# specifies an absolute tolerance of 0.02 (µm) for the L parameter of "P250_1V8" devices:
netlist.device_class_by_name("P250_1V8").equal_parameters = RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_L, 0.02, 0.0)
For a resistor that would be (assuming "RES" is the device name) for a 100 Ohm tolerance:
netlist.device_class_by_name("RES").equal_parameters = RBA::EqualDeviceParameters::new(RBA::DeviceClassResistor::PARAM_R, 100, 0.0)
The first argument to "RBA::EqualDeviceParameters::new" is the parameter ID, the second the absolute tolerance and the third is the relative tolerance (whichever is larger). So to give it a 1% tolerance for the resistance you can use:
netlist.device_class_by_name("RES").equal_parameters = RBA::EqualDeviceParameters::new(RBA::DeviceClassResistor::PARAM_R, 0.0, 0.01)
If you want to specify a tolerance for two parameters, combine the tolerance specs with "+":
netlist.device_class_by_name("P250_1V8").equal_parameters =
RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_L, 0.02, 0.0) +
RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_W, 0.01, 0.0)
which gives L a 20nm and W a 10nm tolerance.
Leaner notation
An imperative, leaner style was:
tolerance("P250_1V8", "L", 0.02)
tolerance("P250_1V8", "W", 0.01)
tolerance("RES", "R", :relative => 0.01, :absolute => 10)
with the general scheme:
tolerance(device_class_name, param_name, absolute_tolerance [, relative_tolerance ])
tolerance(device_class_name, param_name [, :absolute => absolute_tolerance] [, :relative => relative_tolerance])
Reactions are currently unavailable