Skip to content

Latest commit

 

History

History
459 lines (311 loc) · 6.98 KB

File metadata and controls

459 lines (311 loc) · 6.98 KB

API Reference

Complete API reference for the ADS Testbench Development Framework.

PyAEDT Integration Module

HFSSDataExtractor

Extract data from HFSS simulations.

Constructor

HFSSDataExtractor(project_path: str, design_name: Optional[str] = None)

Parameters:

  • project_path: Path to HFSS .aedt project file
  • design_name: Name of design (uses active if None)

Methods

extract_s_parameters()
extract_s_parameters(
    setup_name: Optional[str] = None,
    sweep_name: Optional[str] = None
) -> Dict[str, np.ndarray]

Extract S-parameter data.

Returns: Dictionary with frequency and S-parameter arrays

export_touchstone()
export_touchstone(
    output_file: str,
    setup_name: Optional[str] = None,
    sweep_name: Optional[str] = None
) -> bool

Export S-parameters to Touchstone file.

Returns: True if successful

get_port_impedances()
get_port_impedances() -> Dict[str, complex]

Get port impedances.

Returns: Dictionary of port names to impedances

close()
close()

Close HFSS project and release resources.


MaxwellDataExtractor

Extract data from Maxwell simulations.

Constructor

MaxwellDataExtractor(project_path: str, design_name: Optional[str] = None)

Methods

extract_inductance_matrix()
extract_inductance_matrix(setup_name: Optional[str] = None) -> np.ndarray

Extract inductance matrix.

Returns: Inductance matrix as numpy array

extract_resistance_matrix()
extract_resistance_matrix(setup_name: Optional[str] = None) -> np.ndarray

Extract resistance matrix.

Returns: Resistance matrix as numpy array


AEDTtoADSConverter

Convert AEDT data to ADS formats.

Constructor

AEDTtoADSConverter(output_dir: Optional[str] = None)

Methods

convert_s_parameters()
convert_s_parameters(
    s_param_dict: Dict[str, np.ndarray],
    output_file: str,
    format_type: str = "touchstone"
) -> bool

Convert S-parameters to specified format.

Parameters:

  • s_param_dict: Dictionary with frequency and S-parameter data
  • output_file: Output file path
  • format_type: Format (touchstone, csv, matlab)

Returns: True if successful


ADS Automation Module

ADSController

Control ADS workspace and simulations.

Constructor

ADSController(ads_install_path: Optional[str] = None)

Methods

open_workspace()
open_workspace(workspace_path: str) -> bool

Open ADS workspace.

create_design()
create_design(design_name: str, design_type: str = "schematic") -> bool

Create new design.

Parameters:

  • design_name: Name for the design
  • design_type: Type (schematic, layout, data_display)
run_simulation()
run_simulation(
    simulation_name: str,
    parameters: Optional[Dict[str, Any]] = None
) -> bool

Run simulation.


ADSDataImporter

Import data into ADS.

Constructor

ADSDataImporter(workspace_path: str)

Methods

import_s_parameters()
import_s_parameters(
    source_file: str,
    component_name: str,
    description: str = ""
) -> bool

Import S-parameters from Touchstone file.

import_csv_data()
import_csv_data(
    csv_file: str,
    variable_name: str,
    column_mapping: Optional[Dict[str, str]] = None
) -> bool

Import data from CSV file.

import_pyaedt_data()
import_pyaedt_data(
    data_dict: Dict[str, np.ndarray],
    dataset_name: str
) -> bool

Import data from PyAEDT results.


TestbenchGenerator

Generate ADS testbenches.

Constructor

TestbenchGenerator(
    workspace_path: str,
    template_dir: Optional[str] = None
)

Methods

generate_s_parameter_testbench()
generate_s_parameter_testbench(
    component_file: str,
    testbench_name: str,
    freq_start: float,
    freq_stop: float,
    freq_points: int = 201
) -> bool

Generate S-parameter testbench.

generate_harmonic_balance_testbench()
generate_harmonic_balance_testbench(
    circuit_file: str,
    testbench_name: str,
    fundamental_freq: float,
    harmonics: int = 7,
    power_sweep: Optional[List[float]] = None
) -> bool

Generate Harmonic Balance testbench.

generate_from_template()
generate_from_template(
    template_name: str,
    testbench_name: str,
    parameters: Dict[str, Any]
) -> bool

Generate testbench from template.


Workflow Module

HFSStoADSWorkflow

Complete HFSS to ADS workflow automation.

Constructor

HFSStoADSWorkflow(
    hfss_project: str,
    ads_workspace: str,
    output_dir: Optional[str] = None
)

Methods

run()
run(
    component_name: str,
    create_testbench: bool = True,
    verify: bool = True
) -> bool

Run complete workflow.


MaxwelltoADSWorkflow

Complete Maxwell to ADS workflow automation.

Constructor

MaxwelltoADSWorkflow(
    maxwell_project: str,
    ads_workspace: str,
    output_dir: Optional[str] = None
)

Methods

run()
run(
    component_name: str,
    extract_type: str = "all"
) -> bool

Run complete workflow.

Parameters:

  • component_name: Name for component
  • extract_type: Type of data (all, inductance, resistance)

Utility Module

Logger Configuration

setup_logger()

setup_logger(
    log_file: str = "ads_testbench.log",
    level: str = "INFO",
    rotation: str = "10 MB",
    retention: int = 5
)

Set up logger with console and file output.

File Utils

find_files()

find_files(
    directory: str,
    pattern: str = "*",
    recursive: bool = True
) -> List[Path]

Find files matching pattern.

create_backup()

create_backup(
    file_path: str,
    backup_dir: Optional[str] = None
) -> Optional[Path]

Create backup copy of file.

Data Utils

load_config()

load_config(config_file: str) -> Dict[str, Any]

Load configuration from YAML or JSON.

save_results()

save_results(
    data: Dict[str, Any],
    output_file: str,
    format: str = "auto"
) -> bool

Save results to file.

validate_frequency_range()

validate_frequency_range(
    freq_start: float,
    freq_stop: float,
    freq_points: int
) -> bool

Validate frequency range parameters.


Type Definitions

Common types used throughout the API:

# S-parameter data dictionary
SParamData = Dict[str, np.ndarray]  # Keys: 'frequency', 'S11_mag', 'S11_phase', etc.

# Configuration dictionary
Config = Dict[str, Any]

# Simulation parameters
SimParams = Dict[str, Union[float, int, str]]

Constants

# Default frequency units
FREQ_UNITS = ["Hz", "kHz", "MHz", "GHz"]

# Default formats
DATA_FORMATS = ["touchstone", "csv", "matlab", "json"]

# Design types
DESIGN_TYPES = ["schematic", "layout", "data_display"]