Skip to content
Snippets Groups Projects
Commit 0cad1ef0 authored by David Lanzendörfer's avatar David Lanzendörfer
Browse files

Check for none statements

parent b87032fc
No related branches found
No related tags found
No related merge requests found
......@@ -138,20 +138,25 @@ def simulate_cell(
#assert False, "`voltage` must be either a float or {}".format(PieceWiseLinear)
# Create SPICE description of the input voltage sources.
active_signal_source_statements = "\n".join(
(
create_voltage_source_statement(net, wave)
for net, wave in input_voltages_active.items()
vcc_statement = create_voltage_source_statement(net, wave)
if vcc_statement not None:
active_signal_source_statements = "\n".join(
(
vcc_statement
for net, wave in input_voltages_active.items()
)
)
)
# Static inputs.
static_signal_source_statements = "\n".join(
(
create_voltage_source_statement(net, voltage)
for net, voltage in input_voltages_static.items()
vcc_statement = create_voltage_source_statement(net, voltage)
if vcc_statement not None:
static_signal_source_statements = "\n".join(
(
vcc_statement
for net, voltage in input_voltages_static.items()
)
)
)
# Load capacitance statements.
if output_load_capacitances is None:
......@@ -554,24 +559,28 @@ def simulate_cell_v2(
return f"V{net} {net} {ground_net} PWL({voltage.to_spice_pwl_string()}) DC=0"
elif isinstance(voltage, float):
return f"V{net} {net} {ground_net} {voltage}"
else:
assert False, "`voltage` must be either a float or {}".format(PieceWiseLinear)
#else:
# assert False, "`voltage` must be either a float or {}".format(PieceWiseLinear)
# Create SPICE description of the input voltage sources.
active_signal_source_statements = "\n".join(
(
create_voltage_source_statement(net, wave)
for net, wave in input_voltages_active.items()
vcc_statement = create_voltage_source_statement(net, wave)
if vcc_statement not None:
active_signal_source_statements = "\n".join(
(
vcc_statement
for net, wave in input_voltages_active.items()
)
)
)
# Static inputs.
static_signal_source_statements = "\n".join(
(
create_voltage_source_statement(net, voltage)
for net, voltage in input_voltages_static.items()
vcc_statement = create_voltage_source_statement(net, voltage)
if vcc_statement not None:
static_signal_source_statements = "\n".join(
(
vcc_statement
for net, voltage in input_voltages_static.items()
)
)
)
# Load capacitance statements.
if output_load_capacitances is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment