ADS interface
ADS Interface class
ADS Momentum simulation interface package for The System Development Kit
Provides utilities to import ads modules to python environment and automatically generate testbenches for the most common simulation cases.
Initially written by Veeti Lahtinen and Kaisa Ryynänen, 2021
- class ads.ads[source]
- property TL_mesh_cells
Integer
Defines the transmission line mesh density. Cells per line width
- property ads_submission
Defines ads submission prefix from thesdk.GLOBALS[‘LSFSUBMISSION’] for LSF submissions.
Usually something like ‘bsub -K’ and ‘bsub -I’.
- property adscmd
String
ADS Momentum simulation command string to be executed on the command line. Automatically generated.
- property adssimpath
String
Simulation path. (./Simulations/adssim/<runname>)
- property adssrc
String
Path to the input/configuration files generated (‘./ads/simulation’)
Automatically created by init.ael upon running the AEL program.
- property adssrcpath
String
Path to the ads source of the entity (‘./ads’).
- property distributed_run
Boolean (default False)
If True, distributes simulations into the LSF cluster. The number of subprocesses launched is set by self.num_processes.
- property edge_mesh_enable
Boolean (True or False)
Enables edge mesh
- property emsetupsrcpath
String
Path to the emSetup source of the virtuoso entity (‘VIRTUOSO_DIR/<sourcelib>/<name>/emSetup’).
- property fstep
Integer or float
Frequency step for the simulation.
- property fstep_unit
String
Frequency unit for fstep
- property fstop
Integer or float
Maximum frequency of the simulation.
- property fstop_unit
String
Frequency unit for fstop
- generate_input_files()[source]
Automatically called function to generate the input/configuration files using AEL
- property has_lsf
Returs True if LSF submissions are properly defined. Default False
- property interactive_ads
True | False (default)
Launch simulator in interactive mode, which means that the simulation progress is displayed on the screen.
- property mesh_cells
Integer
Defines the mesh density. Cells per fstop wavelength
- property name
String
Name of the module.
- property num_processes
integer
Maximum number of spawned child processes for distributed runs.
- property preserve_adsfiles
True | False (default)
If True, do not delete file IO files (proj) after simulations. Useful for debugging the file IO
- property runname
String
Automatically generated name for the simulation.
Formatted as timestamp_randomtag, i.e. ‘20201002103638_tmpdbw11nr4’. Can be overridden by assigning self.runname = ‘myname’.
- set_simulation_options(**kwargs)[source]
Automatically called function to set the simulation settings
When changing settings, always run ./configure first.
- property sourcelib
String
Sourcelib name. Currently defaults to nameofthemodule_generated, which is a BAG assumption
Can (and should) be set externally, if the sourcelib name is different than <entityname>_generated.
- property sourcelibpath
String
Path to the virtuoso entity (‘VIRTUOSO_DIR/<sourcelib>’).
- property sparam_filename
String
Changes the S-parameter output file name. Defaults to proj<i>, where i corresponds to the simulation repetition. E.g 0 -> first simulation, 1 -> 2nd. etc.
Should be given without the file type extension, because touchstone .sNp format extension depends on the number of ports in the layout. This is automatically generated by citi_to_touchstone.
Citi to Touchstone
Citifile to Touchstone fileformat converter
Currently tested with 1, 2, 3, 4, 10 and 17-port citifile generated by Momentum. The generated Touchstone .sNp files have been tested using Python scikit-rf library and ADS data file tool.
CITIFile documentation: http://literature.cdn.keysight.com/litweb/pdf/ads15/cktsim/ck2016.html
Touchstone documentation: http://literature.cdn.keysight.com/litweb/pdf/genesys200801/sim/linear_sim/sparams/touchstone_file_format.htm
Initially written by Veeti Lahtinen 2021
- class ads.citi_to_touchstone.citi_to_touchstone(**kwargs)[source]
This class parses a citifile (.cti) file and writes the data to a Touchstone (.sNp) file. This class is utilized by the main ads class.
- property comments
List
List of comments in the CITIfile. Automatically read from the citifile. This can not be changed manually.
- property data
Dictionary
Contains all the information about the data. The dictionary key is the data name, that can be retreived using self.data_names.
- The dictionary contains another dictionary containing the following keys:
‘format’ the format of the data. Should always be “RI” from a CITIfile ‘unit’ the unit of the data. Momentum does not seem to output the unit ‘data’ numpy array containing the parameter data. Lenght of this array can be found from self.var_nbr_of_points
Automatically read from the citifile. This can not be changed manually.
- property data_names
List
List containing all of the S-parameter and Port data names. The order is important, because Momentum does not return any data headers on the CITIfile, so this is used to determine which data vector corresponds to what parameter.
Automatically read from the citifile. This can not be changed manually.
- generate_contents()[source]
Externally called function to read the citifile data and generate the touchstone file.
- property input_file
String
Path to the CITIfile to convert (‘self.adssrc/proj.cti’)
Should be given in run_ads!
- property lines
List
Contains all of the lines in the citifile. If the citifile can not be found, it gives 5 tries with one second delays. IF the citifile is not found after the 5 tries, the citifile is not converted to touchstone.
Automatically read from the citifile. This should not be changed manually.
- property nbr_of_ports
Integer
Number of ports in the layout. Automatically read from the citifile. This should not be set manually.
- property normalization
Integer
Normalization value. Automatically read from the citifile. This should not be set manually.
- property output_file
String
Path to the output touchstone file to be generated (‘self.adssimpath/self.sparam_filename’)
Should be given in run_ads!
Give the sparam_filename without the .sNp extension, because the name depends on the number of ports in the layout! This is automatically generated in self.output_file_extension!!
- property output_file_extension
String
Output file extension. Always in the format .sNp, where N depends on the number of ports. Automatically read from the citifile. This should not be changed manually.
- property var_data
Numpy array
Frequency data read from the CITIfile. The lenght of this array is self.var_nbr_of_points.
Automatically read from the citifile. This should not be changed manually.
- property var_format
String
CITIfile VAR format. Should always be “MAG” after reading. Raises error if not. Automatically read from the citifile. This should not be changed manually.
- property var_name
String
CITIfile VAR name. Should always be “freq” from Momentum. Automatically read from the citifile. This should not be changed manually.
- property var_nbr_of_points
Integer
Number of frequency points in the CITIfile. This parameter is VERY important, since it is also used to determine the lenghts of the data vectors.
Automatically read from the citifile. This should not be changed manually.