hspice语法
前提
1、spice网表
2、vcs-xa工具
3、verdi等dump波形工具
混仿配置文件
xavcs.ctrl
mix_sim.cfg
phy.spi
文档资料
Mixed_Signal Simulation User Guide.pdf
customsim command reference.pdf
混仿CFG文件
//XaVcs.ctrl xa工具仿真配置文件
set_bus_format <%d>;
//设置bus的映射格式(wrie连线)
use_spice -cell HXXXXXX100_A port_map(*=>snps_by_name);
/*
根据名称建立spice网表顶层和rtl连线关系
use_spice -cell xxxxxxxV100_A port_map(cr_para_addr => {cr_para_addr[1],cr_para_addr[0]});
use_spice -cell subcricuit_name[-inst instance_name][port_map(port_map_list)]
一般来讲,不使用inst参数,port_map_list中左侧为subckt的信号,右侧为rtl信号
use_verilog -module module_name [-inst instance_name][port_map(port_list)]
我们可以在exec/uvm_test_simv.msv/interface_element.rpt找到对应node顶层信息
*/
choose xa -nspectre $XXX_VERIFY_ANA_DIR/XXX.spi -c $XXX_VERIFY_ANA_DIR/mix_sim.cfg -o $ANA_O_DIR
//选择仿真器 xa工具
print_thru_net all;
duplicate_net_inst_name enable;
d2a hiv=0.75 lov=0.0 node=
a2d loth=0.45 hith =0.55 hiz_off node=
//转换电压
//mix_sim.cfg
set_sim_level -level 4
//精度范围1~7,默认3,常使用4
set_duplicate_rule -select_subckt first
//定义spice网表重复定义是选择相应例化以防止报错
set_sim_case -case sensitive
//例化名字是否考虑大小写
enable_print_statement yes
//。print将信息打印到文件中,否则默认打印到波形汇总
set_waveform_option -size 800
set_waveform_option -flush 1us
set_waveform_option -format fsdb
set_message_option -limit 5000
//最大warning数量
probe_wave_form_voltage -vsub harness.U_*.U_*_0.* -level 6
//模拟网表仿真电压层次,dump模拟乡下6曾电压波形
probe_wave_form_voltage -vsub * -subckt XXX_RX_DATA_XXX -limit 1
probe_wave_form_current -isub harness.U_*.U_*_0.* -level 6
//模拟网表仿真电流层次,dump模拟乡下6曾电压波形
probe_wave_form_voltage -isub * -subckt XXX_RX_DATA_XXX -limit 1
set_multi_core -core 4
//使用核数量
cmp_opt= -ad=path/XaVcs.ctrl
.temp 25.0 与cornor配合使用
.lib 'path/cornor_usage.l' text
.inc 'path/xxx.cdl'
关键信息日志
//hierarchy.rpt 记录网表中subckt的层级路径
//interface_element.rpt 记录a2d和d2a的转换命令
//port.rpt 记录subckt和module顶层和 use_spice、use_verilog下接口映射关系
//name_map.rpt 记录spice网表顶层和数字顶层的映射关系
warning检查
- shorted 短路检查
- unconnected node
- division-by zero
优化建议
- 使用use_verilog替换PLL
- set_sim_level调整
- spcie网表替换成理想vco模型
v1 vcoclk<0> vss pulse(0,0.9 1/8*2.976) 10p 10p ....
- 精简dump波形
- 精简TC用例