piel.tools.openlane.parse#

These functions aim to provide functionality to parse data from any OpenLanes v1 design into Python.

They are ported from the old: github.com/daquintero/porf

Submodules#

Package Contents#

Functions#

filter_timing_sta_files(file_list)

Filter the timing sta files from the list of files

filter_power_sta_files(file_list)

Filter the power sta files from the list of files

get_all_timing_sta_files(run_directory)

This function aims to list and perform analysis on all the relevant files in a particular run between all the corners.

get_all_power_sta_files(run_directory)

This function aims to list and perform analysis on all the relevant files in a particular run between all the corners.

calculate_max_frame_amount(file_lines_data)

Calculate the maximum frame amount based on the frame IDs in the DataFrame

calculate_propagation_delay_from_file(file_path)

Calculate the propagation delay for each frame in the file

calculate_propagation_delay_from_timing_data(...)

Calculate the propagation delay between two nets

configure_timing_data_rows(file_lines_data)

Identify the timing data lines for each frame and creates a metadata dictionary for frames.

configure_frame_id(file_lines_data)

Identify the frame delimiters and assign frame ID to each line in the file

filter_timing_data_by_net_name_and_type(timing_data, ...)

Filter the timing data by net name and type

get_frame_meta_data(file_lines_data)

Get the frame metadata

get_frame_lines_data(file_path)

Calculate the timing data for each frame in the file

get_frame_timing_data(file, frame_meta_data[, frame_id])

Extract the timing data from the file

get_all_timing_data_from_file(file_path)

Calculate the timing data for each frame in the file

read_sta_rpt_fwf_file(file, frame_meta_data[, frame_id])

Read the fixed width file and return a DataFrame

contains_in_lines(file_lines_data, keyword)

Check if the keyword is contained in the file lines

create_file_lines_dataframe(file_lines_raw)

Create a DataFrame from the raw lines of a file

get_file_line_by_keyword(file_lines_data, keyword, regex)

Extract the data from the file lines using the given keyword and regex

read_file_lines(file_path)

Extract lines from the file

filter_timing_sta_files(file_list)[source]#

Filter the timing sta files from the list of files

Parameters:

file_list (list) – List containing the file paths

Returns:

List containing the timing sta files

Return type:

timing_sta_files (list)

filter_power_sta_files(file_list)[source]#

Filter the power sta files from the list of files

Parameters:

file_list (list) – List containing the file paths

Returns:

List containing the power sta files

Return type:

power_sta_files (list)

get_all_timing_sta_files(run_directory)[source]#

This function aims to list and perform analysis on all the relevant files in a particular run between all the corners.

Parameters:

run_directory (str, optional) – The run directory to perform the analysis on. Defaults to None.

Returns:

List of all the .rpt files in the run directory.

Return type:

timing_sta_files_list (list)

get_all_power_sta_files(run_directory)[source]#

This function aims to list and perform analysis on all the relevant files in a particular run between all the corners.

Parameters:

run_directory (str, optional) – The run directory to perform the analysis on. Defaults to None.

Returns:

List of all the .rpt files in the run directory.

Return type:

power_sta_files_list (list)

calculate_max_frame_amount(file_lines_data: pandas.DataFrame)[source]#

Calculate the maximum frame amount based on the frame IDs in the DataFrame

Parameters:

file_lines_data (pd.DataFrame) – Dataframe containing the file lines

Returns:

Maximum number of frames in the file

Return type:

maximum_frame_amount (int)

calculate_propagation_delay_from_file(file_path: str | pathlib.Path)[source]#

Calculate the propagation delay for each frame in the file

Parameters:

file_path (str | pathlib.Path) – Path to the file

Returns:

Dictionary containing the propagation delay

Return type:

propagation_delay (dict)

calculate_propagation_delay_from_timing_data(net_name_in: str, net_name_out: str, timing_data: pandas.DataFrame)[source]#

Calculate the propagation delay between two nets

Parameters:
  • net_name_in (str) – Name of the input net

  • net_name_out (str) – Name of the output net

  • timing_data (pd.DataFrame) – Dataframe containing the timing data

Returns:

Dataframe containing the propagation delay

Return type:

propagation_delay_dataframe (pd.DataFrame)

configure_timing_data_rows(file_lines_data: pandas.DataFrame)[source]#

Identify the timing data lines for each frame and creates a metadata dictionary for frames.

Parameters:

file_lines_data (pd.DataFrame) – Dataframe containing the file lines

Returns:

Dictionary containing the frame metadata

Return type:

frame_meta_data (dict)

configure_frame_id(file_lines_data: pandas.DataFrame)[source]#

Identify the frame delimiters and assign frame ID to each line in the file

Parameters:

file_lines_data (pd.DataFrame) – Dataframe containing the file lines

Returns:

Dataframe containing the file lines

Return type:

file_lines_data (pd.DataFrame)

filter_timing_data_by_net_name_and_type(timing_data: pandas.DataFrame, net_name: str, net_type: str)[source]#

Filter the timing data by net name and type

Parameters:
  • timing_data (pd.DataFrame) – DataFrame containing the timing data

  • net_name (str) – Net name to be filtered

  • net_type (str) – Net type to be filtered

Returns:

DataFrame containing the timing data

Return type:

timing_data (pd.DataFrame)

get_frame_meta_data(file_lines_data)[source]#

Get the frame metadata

Parameters:

file_lines_data (pd.DataFrame) – DataFrame containing the file lines

Returns:

DataFrame containing the start point name end_point_name (pd.DataFrame): DataFrame containing the end point name path_group_name (pd.DataFrame): DataFrame containing the path group name path_type_name (pd.DataFrame): DataFrame containing the path type name

Return type:

start_point_name (pd.DataFrame)

get_frame_lines_data(file_path: str | pathlib.Path)[source]#

Calculate the timing data for each frame in the file

Parameters:

file_path (str | pathlib.Path) – Path to the file

Returns:

DataFrame containing the file lines

Return type:

file_lines_data (pd.DataFrame)

get_frame_timing_data(file: str | pathlib.Path, frame_meta_data: dict, frame_id: int = 0)[source]#

Extract the timing data from the file

Parameters:
  • file (str | pathlib.Path) – Address of the file

  • frame_meta_data (dict) – Dictionary containing the frame metadata

  • frame_id (int) – Frame ID to be read

Returns:

DataFrame containing the timing data

Return type:

timing_data (pd.DataFrame)

get_all_timing_data_from_file(file_path: str | pathlib.Path)[source]#

Calculate the timing data for each frame in the file

Parameters:

file_path (str | pathlib.Path) – Path to the file

Returns:

Dictionary containing the timing data for each frame

Return type:

frame_timing_data (dict)

read_sta_rpt_fwf_file(file: str | pathlib.Path, frame_meta_data: dict, frame_id: int = 0)[source]#

Read the fixed width file and return a DataFrame

Parameters:
  • file (str | pathlib.Path) – Address of the file

  • frame_meta_data (dict) – Dictionary containing the frame metadata

  • frame_id (int) – Frame ID to be read

Returns:

DataFrame containing the file data

Return type:

file_data (pd.DataFrame)

contains_in_lines(file_lines_data: pandas.DataFrame, keyword: str)[source]#

Check if the keyword is contained in the file lines

Parameters:
  • file_lines_data (pd.DataFrame) – Dataframe containing the file lines

  • keyword (str) – Keyword to search for

Returns:

Dataframe containing the file lines

Return type:

file_lines_data (pd.DataFrame)

create_file_lines_dataframe(file_lines_raw)[source]#

Create a DataFrame from the raw lines of a file

Parameters:

file_lines_raw (list) – list containing the file lines

Returns:

Dataframe containing the file lines

Return type:

file_lines_data (pd.DataFrame)

get_file_line_by_keyword(file_lines_data: pandas.DataFrame, keyword: str, regex: str)[source]#

Extract the data from the file lines using the given keyword and regex

Parameters:
  • file_lines_data (pd.DataFrame) – Dataframe containing the file lines

  • keyword (str) – Keyword to search for

  • regex (str) – Regex to extract the data

Returns:

Dataframe containing the extracted values

Return type:

extracted_values (pd.DataFrame)

read_file_lines(file_path: str | pathlib.Path)[source]#

Extract lines from the file

Parameters:

file_path (str | pathlib.Path) – Path to the file

Returns:

list containing the file lines

Return type:

file_lines_raw (list)