This repository contains the code for the paper
ZeroSim: Zero-Shot Analog Circuit Evaluation with Unified Transformer Embeddings.
The repository is organized into three parts:
circuit_ga/: circuit simulation and raw dataset generationscripts/: dataset preprocessing- repository root: model training and testing
For the CUDA environment, refer to the AnalogGym RGNN_RL setup guide: https://github.com/CODA-Team/AnalogGym/tree/main/RGNN_RL
The dataset is available at
Xun49/Amplifer60.
Raw data generation is handled in circuit_ga/.
The current repository includes:
AMP.py: simulation environmentrandom_AMP.py: random sampling for dataset collectiontransfer_to_yaml.py: converts SPICE/netlist files into YAML configuration filesdev_params.py: generates device-parameter extraction scripts
Run from circuit_ga/:
Create a YAML configuration from the netlist and parameter file:
cd circuit_ga
python transfer_to_yaml.py AMP_new/AMP_NMCF/AMP_NMCF_Pin_3.txt AMP_new/AMP_NMCF/AMP_NMCF_vars.spice AMP_new/AMP_NMCF/AMP_NMCF.yamlGenerate the device-parameter extraction script:
python dev_params.py --config_file AMP_new/AMP_NMCF/AMP_NMCF.yaml --file_name AMP_new/AMP_NMCF/AMP_NMCF_op --output_file AMP_new/AMP_NMCF/AMP_NMCF_dev_params.spiceRun random sampling to collect simulation data:
python random_AMP.py --name AMP_NMCF --output_dir /path/to/generated_dataset --n_samples 60000Preprocessing is handled in scripts/.
The preprocessing flow is:
- Convert netlists into graph representations with
preprocess_topology.py. - Add sampled parameter values and performance targets with
preprocess_params.py. - Split the processed samples into train, validation, and test sets with
split_datasets.py.
Convert a list of netlists into graph topologies:
python scripts/preprocess_topology.py /path/to/netlist_files.txt /path/to/topology.jsonAttach parameter values and performance targets to each topology:
python scripts/preprocess_params.py --topology_filename /path/to/topology.json --n_sample 60000 --netlist_path /path/to/netlists --dataset_path /path/to/generated_dataset --output_path /path/to/processed_samplesSplit processed samples into train, validation, and test sets:
python scripts/split_datasets.py --file_dir /path/to/processed_samples/ --train_ratio 0.8 --val_ratio 0.1 --test_ratio 0.1 --train_output /path/to/train_samples.json --val_output /path/to/val_samples.json --test_output /path/to/test_samples.jsonTraining and testing are run from the repository root. Update configs/config.yaml before launching experiments.
Start training with the configuration in configs/config.yaml:
python train.pyEvaluate a saved checkpoint:
python test.py checkpoint_path=/path/to/checkpointIf you find this is helpful for your research, please cite our paper:
@INPROCEEDINGS{11240890,
author={Yang, Xiaomeng and Gao, Jian and Wang, Yanzhi and Zhang, Xuan},
booktitle={2025 IEEE/ACM International Conference On Computer Aided Design (ICCAD)},
title={ZeroSim: Zero-Shot Analog Circuit Evaluation with Unified Transformer Embeddings},
year={2025},
volume={},
number={},
pages={1-9},
doi={10.1109/ICCAD66269.2025.11240890}
}