Contents
GCAT : Global Convergence Analysis Toolkit
GCAT is the acronym of Global Convergence Analysis Toolkit. It aids analog circuit designers to detect and to prevent global convergence failure (start-up failure) at the early simulation stage of circuit design. The toolkit is coded in python and operates over SPECTRE.
GCAT provides two main global convergence analyses, entropy based X estimation analysis and clustering split detection analysis. Clustering split detection analysis is intended to detect multiple number of operating modes (convergence states) in a circuit. Entropy based X estimation is intended to help circuit designers to follow X elimination procedure, which is similar to that in digital circuit. The analysis extracts X and helps designers to add proper resets to their circuit.
Clustering split detection analysis draws trajectories in the state space of the given circuit and tries to determine whether the system has one cluster or multiple clusters. Because a convergence state in a system forms a cluster in the state space, the number of clusters are reported as the number of detected convergence states in a system. However, it should be noted that the analysis can be false negative and false positive depending on its given parameters. To avoid false positive, the designer should set first simulation time duration of the circuit to be long enough so that the analysis will not detect false limit cycle. To avoid false negative, designer need to extract representatives of clusters and run them for enough time to determine the result is correct or not. In addition, sampling time (simulation time step) should be shorter than a period of any oscillating signal in a circuit.
Entropy based X estimation analysis provides a way to extract the unknown or undetermined state X from analog circuit. The analysis reports unsettled nodes X in a circuit after the user given simulation time, and guide designer to eliminate all Xs with additional information. The idea is that designer can prevent start-up failures by fixing the starting point of the system to the known point. In other words, designers are guided to remove all X before tapeout as all red X in gate simulation waveform should be removed in digital.
Documentation
Requirements
- Linux
- 'libc.so.6' should be set to 'libc-2.11.1.so'
- SPECTRE (should be available before running GCAT)
Quick Start
- gconv_ebx
- Entropy based X analysis
- Example
simGCONV_EBX gconv_ebx qsteps=8 num_pts=32 run_sim=True + num_steps=1 hist_range_st=-0.1 hist_range_end=1.3 + first_sim_time=1e-9 sim_time=50e-12 + icfc_dir="icfc" log_dir="log" plot_dir="mfile"
- Options
qsteps := unsigned(default=16), the number of histogram bins num_pts := unsigned(256) the number of sample simulation points run_sim := boolean(True), whether transient simulation to be run or not (if false, it assume data is already generated in 'data_import_path') num_steps := unsigned(2), the number of simulation steps to run hist_range_st := float(-0.1), minimum voltage value of range of histogram hist_range_end := float(1.3), maximum voltage value of range of histogram rand_range_st := float(None), minimum voltage value of range of uniform distribution for random initial condition generation. If None, it is set to be hist_range_st rand_range_end := float(None), maximum voltage value of range of uniform distribution, If None, it is set to be hist_range_end first_sim_time := float(103e-12), first transient simulation duration sim_time := float(17e-12), simulation time step after the first time step (only valid when num_pts>1) icfc_dir := string("./icfc"), directory where files which store initial/final conditions of a circuit to be saved log_dir := string("./log"), directory where log files to be saved plot_dir := string("./mfile"), directory where debugging plot matlab files to be saved data_import_path := string("./icfc"), this path should be set as a path to directory with simulated ic/fc files if run_sim is False start_tidx := unsigned(0), first time step index of dataset which ebx analysis to be executed stop_tidx := unsigned(0), last time step index of dataset which ebx analysis to be executed fixed_thrd := float(0.05), threshold value between 'settled' and 'unsettled' dep_thrd := float(0.05), threshold value between 'dependent' and not find_dep := boolean(False), If True, the analysis report possible dependent relationships in circuit nodes to result log file dep_elimination := boolean(False), If True, it eliminate dependent nodes from X list num_dep_cand := unsigned(8), If find_dep is True, num_dep_cand number of dependent candidates will be given for every node find_indep := boolean(False), If True, the analysis report possible independent relationships in circuit nodes to result log file maxstep := float(None), if this is set, maxstep parameter of SPECTRE transient analysis will have this value errpreset := float(None), if this is set, errpreset parameter of SPECTRE transient analysis will have this value
- gconv_csd
- Cluster split detection analysis
- Example
simGCONV_CSD gconv_csd max_sim_steps=128 clustering_analysis="K-nearest" + trace_based_termination=True resamp_div=4.0 + init_num_pts=64 first_sim_time=100e-12 sim_time=17e-12 + smrty_thrd=0.8 avg2max_ratio=2 max2min_ratio=2 min_num_samples=32 verifying_itr_num=4 + dbg_nlist="p1,n2,p3" idx_list="0,1,2" + icfc_dir="icfc" log_dir="log" plot_dir="mfile"
- gconv_rand
- Multiple transient analyses with random (uniform distribution) initial conditions. Report results to text files, final conditions of a circuit at every user-given simulation time steps
- Example
simGCONV_RAND gconv_rand num_pts=32 first_sim_time=13e-11 sim_time=13e-12 + icfc_dir="icfc"
- Options
num_pts := integer(16), the number of sample simulation points num_steps := integer(4), the number of simulation steps to run first_sim_time := float(0), first transient simulation duration sim_time := float(17e-12), simulation time step after the first time step (only valid when num_pts>1) vmax := float(1.2), minimum voltage value of range of uniform distribution for random initial condition generation. vmin := float(0), maximum voltage value of range of uniform distribution icfc_dir := string("./icfc"), directory where files which store initial/final conditions of a circuit to be saved log_dir := string("./log"), directory where log files to be saved plot_dir := string("./mfile"), directory where debugging plot matlab files to be saved
- gconv_rwgen
- Multiple transient analyses with random (uniform distribution) initial conditions. Report results to wave files.
- Example
simGCONV_RWGEN gconv_rwgen num_pts=32 sim_time=900e-12 + icfc_dir="icfc" outdir="outdir" save_list="p1,n2,p2"
- Options
num_pts := integer, the number of sample simulation points sim_time := float, simulation time save_list := string, list of names of nodes in a circuit to be saved in waveform, should be separate by comma icfc_dir := string, directory where files which store initial/final conditions of a circuit to be saved log_dir := string, directory where log files to be saved plot_dir := string, directory where debugging plot matlab files to be saved outdir := string, directory where waveform files to be saved
(NOTE) Syntax is similar to that of typical SPECTRE analysis
Tutorial
- Coupled ring oscillator example
- ringosc_embd.scs
simulator lang=spectre insensitive=yes * models and parameters include "model_130.scs" section=tt include "model_130.scs" section=tt_mos_cap_25 parameters Supply=1.2 parameters W1=4 W2=32 // one ring and two points parameters PNR=2 * ring oscillator subckt inv ( in out vdd gnd ) parameters wp=16 lp=2 wn=8 ln=2 m_0 ( out in gnd gnd ) nmos w=wn l=ln geo=1 + as=wn*5 ad=wn*3 ps=2*wn+2*5 pd=wn+2*3 nrd=3/wn nrs=3/wn m_1 ( out in vdd vdd ) pmos w=wp l=lp geo=1 + as=wp*5 ad=wp*3 ps=2*wp+2*5 pd=wp+2*3 nrd=3/wp nrs=3/wp ends inv xinv1p ( p1 p2 vdd gnd ) inv m=2 wp=W1*PNR lp=2 wn=W1 ln=2 xinv2p ( p2 p3 vdd gnd ) inv m=2 wp=W1*PNR lp=2 wn=W1 ln=2 xinv3p ( p3 p1 vdd gnd ) inv m=2 wp=W1*PNR lp=2 wn=W1 ln=2 xinv1n ( n1 n2 vdd gnd ) inv m=2 wp=W1*PNR lp=2 wn=W1 ln=2 xinv2n ( n2 n3 vdd gnd ) inv m=2 wp=W1*PNR lp=2 wn=W1 ln=2 xinv3n ( n3 n1 vdd gnd ) inv m=2 wp=W1*PNR lp=2 wn=W1 ln=2 xinv1cp ( p1 n3 vdd gnd ) inv m=2 wp=W2*PNR lp=2 wn=W2 ln=2 xinv2cp ( p2 n1 vdd gnd ) inv m=2 wp=W2*PNR lp=2 wn=W2 ln=2 xinv3cp ( p3 n2 vdd gnd ) inv m=2 wp=W2*PNR lp=2 wn=W2 ln=2 xinv1cn ( n1 p3 vdd gnd ) inv m=2 wp=W2*PNR lp=2 wn=W2 ln=2 xinv2cn ( n2 p1 vdd gnd ) inv m=2 wp=W2*PNR lp=2 wn=W2 ln=2 xinv3cn ( n3 p2 vdd gnd ) inv m=2 wp=W2*PNR lp=2 wn=W2 ln=2 * stimuli sources Vgnd ( gnd 0 ) vsource type=dc dc=0 Vdda ( vdd gnd ) vsource type=dc dc=Supply * analysis statement simOPTION options temp=60 scale=0.065u * entropy based X extraction simGCONV_EBX gconv_ebx qsteps=8 num_pts=32 run_sim=True + num_steps=1 hist_range_st=-0.1 hist_range_end=1.3 + first_sim_time=1e-9 sim_time=50e-12 + icfc_dir="icfc" log_dir="log" plot_dir="mfile" * cluster split detection analysis simGCONV_CSD gconv_csd max_sim_steps=128 clustering_analysis="K-nearest" + trace_based_termination=True resamp_div=4.0 + init_num_pts=64 first_sim_time=100e-12 sim_time=17e-12 + smrty_thrd=0.8 avg2max_ratio=2 max2min_ratio=2 min_num_samples=32 verifying_itr_num=4 + dbg_nlist="p1,n2,p3" idx_list="0,1,2" + icfc_dir="icfc" log_dir="log" plot_dir="mfile" * wave output files generation by multiple transient simulation starting at random (uniform) initial conditions simGCONV_RWGEN gconv_rwgen num_pts=32 sim_time=900e-12 + icfc_dir="icfc" outdir="wave" save_list="p1,n2,p2" * text output files generation by multiple transient simulation starting at random (uniform) initial conditions simGCONV_RAND gconv_rand num_pts=32 first_sim_time=13e-11 sim_time=13e-12 + icfc_dir="icfc" debug=True
- run global convergence analysis
gspectre ringosc_embd.scs
- results
unix> ls ./log csd_ringosc_embd_dbg.log ebx_ringosc_embd_dbg.log csd_ringosc_embd.res ebx_ringosc_embd.res dbg_rma_ebx_ringosc_embd_log.log rand_rmaic_dbg.log unix> cat ebx_ringosc_embd.res #ebx() result log file ###### Entropy based X extraction ###### number of nets = 58 number of nodes = 8 number of settled nodes = 2 number of unsettled nodes = 6 number of independent nodes = 0 number of dependent nodes = 6 ### Final Xs ### Xs = p3 : uncertainty=1.0 : independence=0.851910154026 n3 : uncertainty=1.0 : independence=0.467331826324 p1 : uncertainty=0.928362072395 : independence=0.791372774407 n1 : uncertainty=0.928362072395 : independence=0.649765642455 p2 : uncertainty=0.625262405223 : independence=0.544601197694 n2 : uncertainty=0.625262405223 : independence=0.720016300167 ###### 0 tidx ebx ended ###### unix> cat ebx_ringosc_embd_dbg.log # #debug ebx() log file ###### Entropy based X extraction ###### ### initial Xs (unsettled nodes) ### unsettled nodes= p3 : idx=6 : degree of uncertainty=1.0 : distribution=[0, 16, 0, 0, 0, 0, 0, 16] n3 : idx=3 : degree of uncertainty=1.0 : distribution=[0, 16, 0, 0, 0, 0, 0, 16] p1 : idx=4 : degree of uncertainty=0.928362072395 : distribution=[0, 21, 0, 0, 0, 0, 0, 11] n1 : idx=1 : degree of uncertainty=0.928362072395 : distribution=[0, 21, 0, 0, 0, 0, 0, 11] p2 : idx=5 : degree of uncertainty=0.625262405223 : distribution=[0, 27, 0, 0, 0, 0, 0, 5] n2 : idx=2 : degree of uncertainty=0.625262405223 : distribution=[0, 27, 0, 0, 0, 0, 0, 5] ### settled nodes ### settled nodes = gnd vdd ### Independent degree estimation ### number of independent nodes = 0 number of dependent nodes = 6 dependent nodes = [1, 2, 3, 4, 5, 6] dependent nodes = n1 n2 n3 p1 p2 p3 independent nodes = [] independent nodes = indepedent degree of (n3) = 0.467331826324 indepedent degree of (p2) = 0.544601197694 indepedent degree of (n1) = 0.649765642455 indepedent degree of (n2) = 0.720016300167 indepedent degree of (p1) = 0.791372774407 indepedent degree of (p3) = 0.851910154026 ### Final Xs ### unix> cat csd_ringosc_embd.res %result log of cluster split detection analysis ###### Cluster split detection analysis result ###### total simulation time = 1.28333333333e-10, total execution time = 23.377707243 number of points = 64 number of clusters = 3 cluster similarity = 0.916666666667 sizes of clusters = [47 16 1] clustering result = [['0', '1', '10', '12', '13', '14', '15', '16', '18', '19', '2', '20', '21', '23', '24', '26', '27', '28', '29', '3', '30', '32', '33', '34', '35', '37', '38', '4', '41', '43', '44', '45', '47', '48', '49', '5', '50', '51', '55', '56', '58', '60', '61', '63', '7', '8', '9'], ['11', '17', '22', '25', '36', '39', '40', '42', '46', '52', '53', '54', '57', '59', '6', '62'], ['31']] unix> cat csd_ringosc_embd.res %debug log of cluster split detection analysis DEBUG : csd() : first rand cast: average distance = 0.648277037308 DEBUG : csd() : init : sim time step = 1e-10 DEBUG : csd() : init : execution time(sim start=0)=5.33237814903 DEBUG : csd() : init : average distance = 0.648277037308 DEBUG : csd() : max_sim_steps=128, max_spacing=0.324138518654, min_spacing=0.162069259327, simtime_mfactor=1.5 DEBUG : csd() : 0th : steady_cnt=0, simtime_cnt=0, clt_test_cnt=0 DEBUG : csd() : 0th : average distance = 0.0796157908142, steady_cnt = 1, simtime_cnt = 0 DEBUG : csd() : 0th : sim time step = 1.13333333333e-11 DEBUG : csd() : 0th : POINTs CONVERGE TEST FAILED DEBUG : csd() : 0th : execution time(sim time step=1.13333333333e-11, tacc=1.11333333333e-10) = 4.44014191628 DEBUG : csd() : 0th : number of simulation points = 64 DEBUG : csd() : 0th : simtime_inc_gain = 2.1 DEBUG : csd() : 0th : avg_dist = 0.0796157908142 DEBUG : csd() : 1th : steady_cnt=1, simtime_cnt=0, clt_test_cnt=0 DEBUG : csd() : init K clustering : K = 4, clt_len=5 DEBUG : csd() : init K clustering : K = 5, clt_len=3 DEBUG : csd() : init K clustering : K = 6, clt_len=2 DEBUG : csd() : init K clustering : K = 7, clt_len=2 DEBUG : csd() : init K clustering : K = 8, clt_len=2 DEBUG : csd() : init K clustering : K = 9, clt_len=2 DEBUG : csd() : init K clustering : K = 10, clt_len=2 DEBUG : csd() : init K clustering : K = 11, clt_len=1 DEBUG : csd() : init K clustering : final K = 11 DEBUG : csd() : K clustering : i=1, clt_test_cnt=1, K = 11, clt_len=2 DEBUG : csd() : 1th : a cluster split! : RESAMPLING ALL DEBUG : csd() : 1th : clustering : clt_test_cnt=1, K=11, mutual_bonding=False, mutual_bonding2=True, reduced_net=False, num_points=64 DEBUG : csd() : 1th : clustering : len=2 clustering = [['0', '1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '3', '30', '32', '33', '34', '35', '36', '37', '38', '39', '4', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '5', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '6', '60', '61', '62', '63', '7', '8', '9'], ['31']] similarity=0 ... ###### Cluster split detection analysis result ###### total simulation time = 1.28333333333e-10, total execution time = 23.377707243 number of points = 64 number of clusters = 3 cluster similarity = 0.916666666667 sizes of clusters = [47 16 1] clustering result = [['0', '1', '10', '12', '13', '14', '15', '16', '18', '19', '2', '20', '21', '23', '24', '26', '27', '28', '29', '3', '30', '32', '33', '34', '35', '37', '38', '4', '41', '43', '44', '45', '47', '48', '49', '5', '50', '51', '55', '56', '58', '60', '61', '63', '7', '8', '9'], ['11', '17', '22', '25', '36', '39', '40', '42', '46', '52', '53', '54', '57', '59', '6', '62'], ['31']]
- ringosc_embd.scs
User guide
