Imports a lib file that corresponds to an installed CML with the variant options defined in the lib file to the models in the current project file. This command can run in the setup script to pre-set the models, and it also works for protected models. One of the key applications of this script command is to run corner analysis.
Syntax |
Description |
---|---|
?importlib; |
Returns the lib files in the installed CML folders. All the installed CML lib files will be returned to a string and separated by newline character "\n". |
?importlib("lib_file_name"); |
Returns the variant options that are defined in the lib file "lib_file_name". The variant options will be returned to a string and separated by "\n". |
importlib("lib_file_name", "statistical option", struct_option); |
Imports the "lib_file_name" lib file and applies the statistical option "statistical_option" to the CML. "struct_option" is optional. It is a struct that contains the "seed" option (number) and "correlation" option (boolean). If "seed" is provided, the variant parameters will be defined based on the specified seed; otherwise a random seed is used. If "correlation" is set to true, the spatial correlation between the elements are calculated and applied. If user selects a non-Monte Carlo option such as the 'NOMINAL' option then instead of randomly generating the parameter values, the script will simply apply the parameter values defined in the .lib file (for that option) to all relevant elements in the project file. |
Example 1 (Corner Analysis)
This example imports the "PAM4_library.lib" file and runs simulation for 'corner_1' and then switches all elements back to 'nominal'. This lib file is the same one used in the INTERCONNECT Statistical Simulation - PAM4 transceiver example.
?importlib; # prints libfile path+name
C:/Users/interconnect-statistical-simulation-pam4-transceiver/PAM4_library.lib
lib_file = "interconnect-statistical-simulation-pam4-transceiver/PAM4_library.lib"
?importlib(lib_file); # prints the different options/corners in the lib file
nominal
statistical
corner_1
corner_2
importlib(lib_file, "corner_1"); # sets all relevant element to 'corner_1'
run;
T_corner = getresult("ONA_1","input 1/mode 1/transmission");
switchtodesign;
importlib(lib_file, "nominal"); # sets all elements back to 'nominal'
T_nominal = getresult("ONA_1","input 1/mode 1/transmission");
Example 2 (Monte Carlo Analysis)
This example imports the "PAM4_library.lib" file and runs Monte Carlo analysis using the importlib command.
?importlib; # prints libfile path+name
C:/Users/interconnect-statistical-simulation-pam4-transceiver/PAM4_library.lib
lib_file = "interconnect-statistical-simulation-pam4-transceiver/PAM4_library.lib"
?importlib(lib_file); # prints the different options/corners in the lib file
nominal
statistical
corner_1
corner_2
rand_seed = rand(1,100,2); #generate random numbers for MC sweep
T_peak = matrix(100,1);
for(i=1:100){
switchtodesign;
importlib(lib_file, "statistical", {"seed":rand_seed(i), "correlation":true}); # sets up random parameters
run;
T_peak(i) = getresult("ONA_1","input 1/mode 1/peak/transmission");
}
For more information on Monte Carlo analysis with spatial correlations, please visit the page Monte Carlo analysis with spatial correlations.