get_default_values(...) - get_default_values(...) - 2026.1 English - UG1781

Python Scripting Guide for PDM Tool (UG1781)

Document_ID
UG1781
Release_Date
2026-06-23
Version
2026.1 English
Revision

Description

Get dictionary of specified record names mapped to dictionaries of specified writable field names to default value mappings, if defaults vary across records and all_records is True, otherwise, a dictionary of specified writable field names to default value mappings for the resource. Read-only fields are excluded even if specified.

Syntax

get_default_values([<field_names>], [<record_names>], all_records=False)

Returns

Dictionary in a format {record: {field: default_value, ...}, ...}, if all_records is True or {field: default_value, ...}, otherwise.

Parameters

Name Description
[<field_names>] List of field names.

Default: All fields

[<record_names>] List of record names. If specified, the all_records flag is ignored and only records in the list are considered.

Default: Depends on the value of all_records.

[all_records] Enables returning defaults of each record if True, considering that defaults can vary for the same field across different records, otherwise, only the resource uniform defaults.

Default: False

Examples

# Get default values for the resource (shared across all records)
proj = open_project('my_design.pdm')
io_config = proj.get_block('io').get_resource('io_config')
defaults = io_config.get_default_values()
# defaults == {'io_type': 'XP', 'io_standard': 'LVCMOS 1.5V 12mA', 'input_pins': 0, ...}
# Get default values for specific fields only
defaults = io_config.get_default_values(['io_type', 'toggle_rate'])
# Get default values per record (may differ from resource-level defaults)
all_defaults = io_config.get_default_values(all_records=True)
# all_defaults == {'io_inst1': {'io_type': 'XP', 'io_standard': 'LVCMOS 1.5V 12mA', ...}, ...}