create_current_map.py
optional arguments:
[ --def_path ] path to the def file, should end in .def
[ --current_path ] path to the simulated logic cell currents
[ --num_input_stimuli ] number of plaintexts
[ --target_area_x ] target simulated area in x axial direction
[ --target_area_y ] target simulated area in y axial direction
[ --num_probe_x_tiles ] number of point grid in x axial direction
[ --num_probe_y_tiles ] number of point grid in y axial direction
[ --layout_min_x ] Reference coordinate in x axial direction
[ --layout_min_y ] Reference coordinate in y axial direction
[ --start_points ] Start of sample point for each current trace
[ --sample_points ] End of sample point for each current trace
[ --current_map_train ] generate cell current map for GAN training
[ --current_map_test ] generate cell current map for EM prediction
电源网格地图
create_grid_map(2-pad).py
optional arguments:
[ --metal_layers ] target metal layers
[ --target_area_x ] target simulated area in x axial direction
[ --target_area_y ] target simulated area in y axial direction
[ --num_probe_x_tiles ] number of point grid in x axial direction
[ --num_probe_y_tiles ] number of point grid in y axial direction
[ --layout_min_x ] Reference coordinate in x axial direction
[ --layout_min_y ] Reference coordinate in y axial direction
[ --power_grid_map ] generate power grid map for GAN training and EM prediction
create_grid_map(4-pad).py
optional arguments:
[ --metal_layers ] target metal layers
[ --target_area_x ] target simulated area in x axial direction
[ --target_area_y ] target simulated area in y axial direction
[ --num_probe_x_tiles ] number of point grid in x axial direction
[ --num_probe_y_tiles ] number of point grid in y axial direction
[ --layout_min_x ] Reference coordinate in x axial direction
[ --layout_min_y ] Reference coordinate in y axial direction
对于一个版图级设计,只有一个电源网格地图,在模型训练和电磁预测阶段均使用该电网图。
注意
需要在版图级设计中获取 VDD 和 VSS 的坐标。
对于 2-pad 和 4-pad 的不同电源设计需要选择不同的脚本。
电磁地图
create_em_map.py
optional arguments:
[ --EM_path ] path to the simulated EM data
[ --num_input_stimuli ] number of plaintexts
[ --num_probe_x_tiles ] number of point grid in x axial direction
[ --num_probe_y_tiles ] number of point grid in y axial direction
[ --time_steps ] simulation time for each EM trace
[ --em_map_train ] generate em map for GAN training
[ --em_map_test ] generate em current map for EM prediction
GAN Model Training
GAN网络采用U-net结构搭建生成器,采用PatchGAN结构搭建判别器。
GAN4EM_training.py
optional arguments:
[ --num_probe_x_tiles ] number of point grid in x axial direction
[ --num_probe_y_tiles ] number of point grid in Y axial direction
[ --time_steps ] simulation time for each EM trace
[ --percent_valid_split ] 10% of training points is used for validation during training
[ --learning_rate_val ] learning rate decays exponentially from 0.0005
[ --num_input_stimuli ] number of plaintexts
[ --decay_rate_val ] learning rate with the discount factor 0.98
[ --epochs ] number of times the model worked on the entire training dataset
[ --batch_size ] number of samples processed per training epoch
[ --trained_model_path ] save the trained weight parameters
[ --training_current_map ] input cell current map for model training
[ --training_gird_map ] input power grid map for model training
[ --training_em_map ] input EM map for model training
EM Prediction
在电磁预测阶段,训练好的生成器被保留下来,用做推理模型。
GAN4EM_prediction.py
optional arguments:
[ --num_probe_x_tiles ] number of point grid in x axial direction
[ --num_probe_y_tiles ] number of point grid in Y axial direction
[ --time_steps ] simulation time for each EM trace
[ --percent_valid_split ] 10% of training points is used for validation during training
[ --learning_rate_val ] learning rate decays exponentially from 0.0005
[ --num_input_stimuli ] number of plaintexts
[ --decay_rate_val ] learning rate with the discount factor 0.98
[ --trained_model_path ] trained weight parameters
[ --test_current_map ] input cell current map for EM prediction
[ --test_gird_map ] input power grid map for EM prediction
[ --test_em_map ] input EM map for evaluate GAN model
EMSim+是一款基于生成对抗网络(GAN)的版图级芯片电磁仿真器,基于物理版图快速预测集成电路的电磁行为,辅助芯片电磁安全的硅前量化与验证,由天津大学智能感知与安全技术实验室开源和维护。
智能感知与安全技术实验室是国内第一批在硬件安全领域开展研究的团队,研究领域包括集成电路硬件安全、密码芯片设计与安全分析、硬件形式化建模与验证、面向智能传感的混合信号芯片与系统设计等方面。
若有任何意见或建议,欢迎通过issues或邮件(dochejj@tju.edu.cn, hc_ma@tju.edu.cn, jinyier@gmail.com, gaoyaya@tju.edu.cn, )与我们联系
环境配置
操作系统:Linux or Windows
依赖项:Python 3.8+ with PIP, TensorFlow2.4 with GPU
Table of contents
实现框架
EMSim+的实现框架包含特征提取,GAN模型训练和电磁预测三部分。
Current Analysis and Electromagnetic Computation
这两部分是使用EMSim完成的,参考链接:https://www.gitlink.org.cn/opendacs/EMSim 由Current Analysis and Electromagnetic Computation获得的单元电流信息、电源位置信息和电磁计算结果。
Feature Extraction
特征提取的目的是从芯片物理布局数据库中提取单元电流、电源网格和电磁信息,并将其转换为特征图。
单元电流地图
电源网格地图
对于一个版图级设计,只有一个电源网格地图,在模型训练和电磁预测阶段均使用该电网图。
电磁地图
GAN Model Training
GAN网络采用U-net结构搭建生成器,采用PatchGAN结构搭建判别器。
EM Prediction
在电磁预测阶段,训练好的生成器被保留下来,用做推理模型。
贡献者
版权声明
It is mainly intended for non-commercial use, such as academic research.
许可证
MIT License, see license in LICENSE.