Core API¶
COBRA¶
COBRA is the orchestration class for the optimization pipeline.
Constructor¶
COBRA(
netlist_parser,
component_onnx_mapping,
optimizer=OptunaOptimizer(),
circuit_simulator=XyceSimulator(),
palace_fine_tuning_command=None,
fine_tuning_iterations=3,
fine_tuning_optimizer="reuse",
)
Required Inputs¶
netlist_parser: parsed netlist object with component discovery.component_onnx_mapping: dictionary mapping every parsed component name to a model path (.onnxor.sNp).
Main Method¶
cobra.run(
netlist,
design_goals,
optimization_parameters,
max_iterations=500,
orca_geometry=None,
callback=None,
results_name=None,
)
run(...) Responsibilities¶
- create a timestamped run directory,
- copy and patch netlist for simulation,
- execute iterative optimization stages,
- track timings and iteration history,
- save context JSON and generated artifacts.
Practical Notes¶
Warning
COBRA validates that every parsed component has a corresponding mapping entry. Missing mappings stop execution early.
Note
If goals are not achieved within budget, COBRA re-evaluates best known parameters for final context consistency.