Skip to content

xz-group/ZeroSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZeroSim

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 generation
  • scripts/: dataset preprocessing
  • repository root: model training and testing

Environment Setup

For the CUDA environment, refer to the AnalogGym RGNN_RL setup guide: https://github.com/CODA-Team/AnalogGym/tree/main/RGNN_RL

Workflow

1. Dataset Generation

The dataset is available at Xun49/Amplifer60.

Raw data generation is handled in circuit_ga/.

The current repository includes:

  • AMP.py: simulation environment
  • random_AMP.py: random sampling for dataset collection
  • transfer_to_yaml.py: converts SPICE/netlist files into YAML configuration files
  • dev_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.yaml

Generate 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.spice

Run random sampling to collect simulation data:

python random_AMP.py --name AMP_NMCF --output_dir /path/to/generated_dataset --n_samples 60000

2. Dataset Preprocessing

Preprocessing is handled in scripts/.

The preprocessing flow is:

  1. Convert netlists into graph representations with preprocess_topology.py.
  2. Add sampled parameter values and performance targets with preprocess_params.py.
  3. 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.json

Attach 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_samples

Split 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.json

3. Model Training And Testing

Training 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.py

Evaluate a saved checkpoint:

python test.py checkpoint_path=/path/to/checkpoint

Citation

If 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}
}

About

The implementation for paper ZeroSim: Zero-Shot Analog Circuit Evaluation with Unified Transformer Embeddings

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages