HeteroSTA API Reference

1. heterosta_init_license

bool heterosta_init_license(const char *lic);

Description

Initializes and validates the license for the HeteroSTA library. This is the first function that must be called before any other library operations. If the license is not successfully initialized, subsequent calls to heterosta_new will fail and return a NULL pointer.

You can obtain a license key by following the instructions in our getting started page.

Return Value

Returns true if the license key is valid and successfully initialized. Returns false otherwise.

Arguments

  • lic: A null-terminated C string containing the full license key provided for the HeteroSTA library.

2. STAHoldings

typedef struct STAHoldings STAHoldings;

An opaque pointer to the STAHoldings environment, which serves as the central database and context for all static timing analysis operations. This struct owns all necessary STA-related data structures and provides the main procedural interface for the library.

3. heterosta_new

struct STAHoldings *heterosta_new(void);

Description

Allocates and initializes a new STAHoldings environment on the heap. This environment serves as the primary context for all subsequent Static Timing Analysis (STA) operations. Creating an environment is the first step when using the HeteroSTA library. The returned pointer must be passed to other heterosta_* API functions.

Return Value

A pointer to the newly created STAHoldings environment.

4. heterosta_free

void heterosta_free(struct STAHoldings *sta);

Description

Frees all memory resources associated with a STAHoldings environment previously created by heterosta_new. This routine should be called once you are finished with an environment to prevent memory leaks.

Arguments

  • sta: A pointer to the STAHoldings environment to be freed.

Usage Note

For robust resource management, particularly in C++, it is recommended to manage the STAHoldings pointer using an automatic mechanism, such as std::unique_ptr, to ensure the environment is freed correctly.

5. heterosta_read_liberty

bool heterosta_read_liberty(struct STAHoldings *sta, TimerEarlyOrLate el, const char *path);

Description

Reads a single Liberty library file from the specified path and loads it for a specific timing corner. To ensure a complete analysis setup, you must load libraries for both the early (el = 0) and late (el = 1) corners.

  • If you have separate library files for different corners (e.g., fast.lib and slow.lib), call this function once for each file with the corresponding el value.
  • If you use a single library file for both corners (e.g., typical.lib), you must call this function twice with the same path: once with el set to 0 and a second time with el set to 1.

Return Value

Returns true if the Liberty library file was read successfully, and false otherwise.

Arguments

  • sta: A pointer to the STAHoldings environment where the library data will be stored.
  • el: The timing corner to associate with this library. Use 0 for the early corner and 1 for the late corner.
  • path: A null-terminated string containing the file path to the Liberty library file.

6. heterosta_batch_read_liberty

bool heterosta_batch_read_liberty(struct STAHoldings *sta,
                                  TimerEarlyOrLate el,
                                  const char *const *paths,
                                  uintptr_t num_libs);

Description

Reads multiple Liberty library files from the specified paths in parallel and loads them for a specific timing corner. This function processes the specified library files concurrently to improve performance. Successfully parsed libraries are merged into the STA database for the specified corner. To ensure a complete analysis setup, you must load libraries for both the early (el = 0) and late (el = 1) corners.

Return Value

Returns true if at least one of the specified Liberty library files is loaded successfully. Returns false only if parsing fails for all provided paths.

Arguments

  • sta: A pointer to the STAHoldings environment where the library data will be stored.
  • el: The timing corner to associate with this set of libraries. Use 0 for the early corner and 1 for the late corner.
  • paths: An array of null-terminated strings, where each string is a path to a Liberty library file.
  • num_libs: The total number of file paths contained in the paths array.

7. heterosta_read_netlist

bool heterosta_read_netlist(struct STAHoldings *sta, const char *path, const char *top_module);

Description

Reads a Verilog netlist from the specified file path and populates the internal design database within the STAHoldings environment. This function must be called after all necessary Liberty library files have been loaded. The top_module parameter controls how the root of the design is determined. As an alternative, the netlist can be provided directly using heterosta_set_netlistdb.

Return Value

Returns true if the netlist file was read and processed successfully. Returns false on failure, which may occur if the file is not found, contains syntax errors, or if a specified top_module does not exist.

Arguments

  • sta: A pointer to the STAHoldings environment that the netlist data will be loaded into.
  • path: A null-terminated string containing the file path to the Verilog netlist file.
  • top_module: A null-terminated string specifying the name of the top-level module. Pass NULL to enable automatic detection.

8. heterosta_set_netlistdb

void heterosta_set_netlistdb(struct STAHoldings *sta, struct NetlistDB *netlist_ptr);

Description

Provides an alternative to heterosta_read_netlist for populating the STAHoldings environment with netlist data. This function directly accepts a pointer to a NetlistDB object that you construct manually. It must be called after all necessary Liberty library files have been loaded.

To use this function, you must first parse the Verilog netlist into a custom data structure. From this data, you then populate a NetlistDBCppInterface struct and call the netlistdb_new() function to create the NetlistDB instance. The required definitions for these items can be found in netlistdb.h. A demo is provided that illustrates the use of this function alongside heterosta_read_netlist. This approach is recommended for advanced users who need fine-grained control over the netlist data structure.

Arguments

  • sta: A pointer to the STAHoldings environment that the netlist data will be loaded into.
  • netlist_ptr: A pointer to a previously created NetlistDB object.

Note on Pin Indexing

A key advantage of this method is control over pin indexing. The internal pin IDs within the STAHoldings environment will directly correspond to the indices you define when constructing the NetlistDBCppInterface. This avoids the need to remap pin indices when interfacing with other functions, such as heterosta_extract_rc_from_placement.

9. heterosta_init_logger

void heterosta_init_logger(void (*dreamplace_print_callback)(uint8_t level, const char *message));

Description

Initializes the library's internal logging system and redirects all log messages to a user-provided callback function. This function allows for the seamless integration of the library's logging output into the host application's logging framework. It should be called once at the beginning of your application. The default log level is Debug.

Arguments

  • print_callback: A pointer to a callback function that will receive log messages. The function must conform to the signature: void your_function_name(uint8_t level, const char *message);
    • level: A uint8_t representing the severity: 1: ERROR, 2: WARN, 3: INFO, 4: DEBUG, 5: TRACE.
    • message: A null-terminated C string containing the log message. The callback must not modify or free it.
    • Example callback definition:
      extern "C" void cpp_log_callback(uint8_t level, const char* message) {
          const char* level_str;
          switch (level) {
              case 1: level_str = "ERROR"; break;
              case 2: level_str = "WARN "; break;
              case 3: level_str = "INFO "; break;
              case 4: level_str = "DEBUG"; break;
              case 5: level_str = "TRACE"; break;
              default: level_str = "UNKNW"; break;
          }
          if (level <= 2) { // ERROR and WARN to stderr
              std::cerr << "[" << level_str << "] " << message << std::endl;
          } else { // INFO, DEBUG, TRACE to stdout
              std::cout << "[" << level_str << "] " << message << std::endl;
          }
      }

10. heterosta_set_delay_calculator_*

void heterosta_set_delay_calculator_elmore(struct STAHoldings *sta);
void heterosta_set_delay_calculator_elmore_scaled(struct STAHoldings *sta);
void heterosta_set_delay_calculator_arnoldi(struct STAHoldings *sta);

Description

The delay calculator is a fundamental component of STA. One of the functions in this group must be called before performing any timing analysis operations, such as heterosta_update_timing. The selection of a calculator will directly impact the results of the timing analysis.

Available Calculators

  • elmore: A classical, simple, and fast Elmore delay calculator.
    • Accuracy vs. PrimeTime: 0.81 R², 16% MRE.
  • elmore_scaled: A classical Elmore delay calculator with an applied delay scale factor.
    • Accuracy vs. PrimeTime: 0.956 R², 24% MRE.
  • arnoldi: An accurate Arnoldi delay calculator that uses the Model-Order Reduction (MOR) method.
    • Accuracy vs. PrimeTime: 0.982 R², 7.4% MRE.

Arguments

  • sta: A pointer to the STAHoldings environment where the delay calculator will be set.

11. heterosta_flatten_all

void heterosta_flatten_all(struct STAHoldings *sta);

Description

Finalizes the design setup by converting all loaded data into a performance-optimized, "flattened" representation. This is a crucial one-time conversion from a modifiable format to a contiguous, cache-friendly format required by high-performance analysis operations. This function must be called after all design and library data has been loaded, and before building the timing graph with heterosta_build_graph. Once flattened, the databases cannot be modified.

Arguments

  • sta: A pointer to the STAHoldings environment whose internal data will be finalized.

12. heterosta_build_graph

void heterosta_build_graph(struct STAHoldings *sta);

Description

Constructs the core data structures required for static timing analysis. This is a critical step in the STA workflow. It must be called after loading the Liberty libraries and the netlist (and after heterosta_flatten_all), but before applying any SDC constraints or performing delay calculations. Parasitic information is not required for this step.

Arguments

  • sta: A pointer to the STAHoldings environment. The function will modify this environment by building and storing the necessary analysis graphs within it.

13. heterosta_get_is_endpoint

void heterosta_get_is_endpoint(const struct STAHoldings *sta, bool *is_endpoint);

Description

This routine populates a user-provided array with boolean flags that identify which pins in the design are timing endpoints. A timing endpoint is typically a primary output or the input pin of a sequential cell. This function must be called after the timing graph has been built. The resulting data is often used in calculating metrics like Total Negative Slack (TNS).

Arguments

  • sta: A pointer to the STAHoldings environment.
  • is_endpoint: A pointer to a pre-allocated boolean array, which will be filled with the result.

14. heterosta_extract_rc_from_placement

void heterosta_extract_rc_from_placement(struct STAHoldings *sta,
                                         const float *xs,
                                         const float *ys,
                                         float unit_cap_x,
                                         float unit_cap_y,
                                         float unit_res_x,
                                         float unit_res_y,
                                         float via_res,
                                         uint32_t flute_accuracy,
                                         float pdr_alpha,
                                         uint8_t use_flute_or_pdr,
                                         bool use_cuda);

Description

Estimates parasitic resistance (R) and capacitance (C) for each net based on pin placement data. This function constructs Steiner trees for each net using one of two available algorithms (FLUTE or PDR) and applies user-provided unit RC values to calculate parasitics. The results are stored within the sta environment. The computation can be accelerated on a compatible NVIDIA GPU by setting use_cuda to true.

This function is primarily intended for use in placement-driven flows where exact parasitics are not yet available. For standard timing analysis where detailed parasitic data is available, it is recommended to load parasitics directly from a SPEF file using the heterosta_read_spef function.

Note on Pin Indexing

The input coordinate arrays xs and ys must be ordered according to the tool's internal pin ID. If you used heterosta_read_netlist, you may need to reorder your data using heterosta_lookup_pin. If you used heterosta_set_netlistdb, the pin order is determined by you and no reordering is needed.

Note on Units

Physical units are user-defined. However, the unit-based parameters must be scaled consistently to ensure resulting parasitics are in femtofarads (fF) and kilo-ohms (kΩ).

  • unit_cap * distance = Capacitance in fF (1e-15 F)
  • unit_res * distance = Resistance in kΩ (1e3 Ω)

Arguments

  • sta: A pointer to the STAHoldings environment.
  • xs: A pointer to an array of X coordinates for each pin, ordered by internal pin ID. Must point to GPU memory if use_cuda is true.
  • ys: A pointer to an array of Y coordinates for each pin, ordered by internal pin ID. Must point to GPU memory if use_cuda is true.
  • unit_cap_x: Capacitance per unit distance along the X axis.
  • unit_cap_y: Capacitance per unit distance along the Y axis.
  • unit_res_x: Resistance per unit distance along the X axis.
  • unit_res_y: Resistance per unit distance along the Y axis.
  • via_res: The resistance of a via in kilo-ohms (kΩ). A typical value is 0.0 for the normal case when via resistance is not considered.
  • flute_accuracy: Accuracy level for the FLUTE algorithm. A higher value results in a more accurate approximation of the Rectilinear Steiner Minimal Tree (RSMT), generally leading to shorter wirelength. A typical value is 8.
  • pdr_alpha: A parameter for the PDR algorithm that balances wirelength against path depth. Larger values prioritize shallower trees (closer to a shortest-path tree), while smaller values prioritize shorter total wirelength. A typical value is 0.3.
  • use_flute_or_pdr: Selects the Steiner tree construction algorithm. Use 0 for FLUTE or 1 for PDR.
  • use_cuda: A boolean flag. If true, computation is attempted on the GPU.

15. heterosta_read_spef

bool heterosta_read_spef(struct STAHoldings *sta, const char *path);

Description

Reads a Standard Parasitic Exchange Format (SPEF) file and loads the parasitic resistance (R) and capacitance (C) data into the STAHoldings environment. This is the standard method for incorporating detailed, accurate parasitics from an extraction tool into the timing analysis flow.

This function can be called before or after the netlist is loaded, and for efficiency, its execution can be parallelized with heterosta_read_netlist.

Return Value

Returns true if the SPEF file was found, successfully parsed, and the parasitic data was applied. Returns false if the file cannot be opened or contains fatal syntax errors.

Arguments

  • sta: A pointer to the STAHoldings environment where the parasitic data will be loaded.
  • path: A null-terminated string representing the file path to the SPEF file.

16. heterosta_read_sdc

bool heterosta_read_sdc(struct STAHoldings *sta, const char *path);

Description

Reads a Synopsys Design Constraints (SDC) file and applies the specified timing constraints. This function must be called after the timing graph has been built (via heterosta_build_graph), but before running any timing updates (e.g., heterosta_update_arrivals).

Return Value

Returns true if the SDC file was parsed and applied successfully. Returns false if the file cannot be opened, contains invalid syntax, or refers to non-existent objects.

Arguments

  • sta: A pointer to the STAHoldings environment where constraints will be applied.
  • path: A null-terminated string representing the file path to the SDC file.

17. heterosta_lookup_pin

uintptr_t heterosta_lookup_pin(const struct STAHoldings *sta, const char *pin_name);

Description

Translates a hierarchical pin name into its corresponding unique internal integer ID. This function is the primary bridge between human-readable names and the tool's internal data structures. The name can include hierarchy (/) and bit selectors ([]). This function must be called after the netlist database has been populated. Multiple calls can be safely executed in parallel.

Return Value

  • On Success: Returns the internal pin ID as a uintptr_t.
  • On Failure: If the pin name is not found, returns UINTPTR_MAX (defined in <stdint.h>).

Arguments

  • sta: A const pointer to the STAHoldings environment containing the netlist data.
  • pin_name: A null-terminated string containing the full, hierarchical name of the pin.

18. heterosta_update_delay

void heterosta_update_delay(struct STAHoldings *sta, bool use_cuda);

Description

Calculates the delay for all timing arcs (cell arcs and net arcs) in the design in parallel, using the previously selected delay calculator. This is a core analysis step and is a prerequisite for propagating arrival times. It must be called after any changes to parasitics and before heterosta_update_arrivals.

Arguments

  • sta: A pointer to the STAHoldings environment. It is modified in-place with the newly calculated delay values.
  • use_cuda: A boolean flag to select the execution backend: true for GPU (CUDA), false for CPU.

19. heterosta_update_arrivals

void heterosta_update_arrivals(struct STAHoldings *sta, bool use_cuda);

Description

Propagates timing information through the design to calculate the Arrival Time (AT) and Required Arrival Time (RAT) for every pin. This function consumes arc delay values computed by heterosta_update_delay and performs a level-by-level traversal of the timing graph. It is the final prerequisite before slack can be reported or gradients can be computed.

Arguments

  • sta: A pointer to the STAHoldings environment. It is modified in-place with the newly calculated AT and RAT values.
  • use_cuda: A boolean flag to select the execution backend: true for GPU (CUDA), false for CPU.

20. heterosta_report_slacks_at_max

void heterosta_report_slacks_at_max(struct STAHoldings *sta, float (*slack)[2], bool use_cuda);

Description

Calculates and reports the slack for each pin under the max (longest path) timing condition. For data path pins, this corresponds to setup slack. A negative slack indicates a timing violation where the signal arrives too late. This function must be called after timing has been propagated via heterosta_update_arrivals.

Arguments

  • sta: A pointer to the STAHoldings environment containing the AT and RAT data.
  • slack: A pointer to a user-allocated buffer to receive the slack values.
    • The buffer must be sized for num_pins * 2 floats, structured as an array of [rise_slack, fall_slack] pairs.
    • The array is indexed by the internal pin ID.
    • Must point to GPU memory if use_cuda is true.
  • use_cuda: A boolean flag to select the execution backend: true for GPU (CUDA), false for CPU.

21. heterosta_report_slacks_at_min

void heterosta_report_slacks_at_min(const struct STAHoldings *sta,
                                    float (*slack)[2],
                                    bool use_cuda);

Description

Calculates and reports the slack for each pin under the min (shortest path) timing condition. For data path pins, this corresponds to hold slack. A negative slack indicates a timing violation where the signal arrives too early. This function must be called after timing has been propagated via heterosta_update_arrivals.

Arguments

  • sta: A pointer to the STAHoldings environment containing the AT and RAT data.
  • slack: A pointer to a user-allocated buffer to receive the slack values.
    • The buffer must be sized for num_pins * 2 floats, structured as an array of [rise_slack, fall_slack] pairs.
    • The array is indexed by the internal pin ID.
    • Must point to GPU memory if use_cuda is true.
  • use_cuda: A boolean flag to select the execution backend: true for GPU (CUDA), false for CPU.

22. heterosta_zero_slew

void heterosta_zero_slew(struct STAHoldings *sta);

Description

Initializes the slew (transition time) of all primary input ports of the design to an ideal value of zero.

This routine provides a default slew value for inputs before any timing constraints are applied. It ensures that all input ports have a defined transition time, which is essential for accurate delay calculation on the first level of logic.

This function should optionally be called before loading design constraints via heterosta_read_sdc. If an SDC file subsequently applies an explicit set_input_transition constraint to a port, that value will override the zero set by this function. The initialization is applied to the data for both the early and late timing corners.

Arguments

  • sta: A pointer to the STAHoldings environment. The transition times for primary input ports within this environment will be modified.

23. heterosta_report_wns_tns

bool heterosta_report_wns_tns(const struct STAHoldings *sta,
                              float *wns,
                              float *tns,
                              bool use_cuda);

Description

Computes two critical top-level timing metrics for the design under the max (setup) condition:

  • Worst Negative Slack (WNS): The single most negative slack value across all timing endpoints.
  • Total Negative Slack (TNS): The sum of all negative slack values across all timing endpoints.

This function provides a quick summary of the overall timing health of the design. It must be called after timing has been fully propagated via heterosta_update_arrivals and heterosta_update_delay.

Return Value

Returns true on successful calculation. Returns false if the required timing data is not available in the environment.

Arguments

  • sta: A pointer to the STAHoldings environment containing the calculated timing data.
  • wns: A pointer to a float that will be populated with the WNS value.
  • tns: A pointer to a float that will be populated with the TNS value.
  • use_cuda: A boolean flag to select the execution backend: true for GPU (CUDA), false for CPU.

24. heterosta_dump_paths_setup_to_file

void heterosta_dump_paths_setup_to_file(const struct STAHoldings *sta,
                                        uintptr_t num_paths,
                                        uintptr_t nworst,
                                        const char *file_path,
                                        bool split_endpoint_rf,
                                        bool use_cuda);

Description

Generates a timing report for the first num_paths setup timing paths and writes it to a file.

Arguments

  • sta: A pointer to the STAHoldings environment containing the timing data.
  • num_paths: The maximum total number of violating paths to include in the report.
  • nworst: The maximum number of distinct paths to report for any single timing endpoint.
  • file_path: A null-terminated string containing the path to the output report file.
  • split_endpoint_rf: If true, rise and fall transitions at a pin are treated as distinct endpoints. This affects nworst path calculations.
  • use_cuda: A boolean flag to select the execution backend.

25. heterosta_report_delay_sdf

bool heterosta_report_delay_sdf(const struct STAHoldings *sta, const char *path);

Description

Generates a Standard Delay Format (SDF) file containing the calculated delays for timing arcs in the design. The output file can be used for interoperability with other EDA tools for simulation or further analysis.

Return Value

Returns true if the SDF file was written successfully. Returns false on failure (e.g., file could not be opened).

Arguments

  • sta: A pointer to the STAHoldings environment containing the calculated delay data.
  • path: A null-terminated string representing the file path for the output SDF file.

26. heterosta_report_paths_setup

struct PBAPathCollectionCppInterface *heterosta_report_paths_setup(const struct STAHoldings *sta,
                                                                   uintptr_t num_paths,
                                                                   uintptr_t nworst,
                                                                   float slack_lesser_than,
                                                                   bool split_endpoint_rf,
                                                                   bool use_cuda,
                                                                   bool result_use_cuda);

Description

Collects detailed information about the most critical setup paths and organizes it into a PBAPathCollectionCppInterface structure for programmatic access, allowing external C/C++ applications to directly process the timing path data. The PBAPathCollectionCppInterface structure is defined in the heterosta.h header file.

Return Value

A pointer to a newly allocated PBAPathCollectionCppInterface object. The caller assumes ownership of this pointer and must free it using heterosta_free_pba_path_collection to avoid memory leaks.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • num_paths: The maximum total number of paths to collect.
  • nworst: The maximum number of paths to collect per endpoint.
  • slack_lesser_than: The exclusive slack upper bound; only paths with slack less than this value will be collected.
  • split_endpoint_rf: If true, rise and fall transitions at a pin are treated as distinct endpoints. This affects nworst path calculations.
  • use_cuda: A boolean flag to select the backend for path analysis computation.
  • result_use_cuda: A boolean flag specifying the memory location of the output data structure. If true, the data arrays within the returned struct will reside on the GPU.

Usage Note

If result_use_cuda is set to true, the data pointers within the returned structure will point to GPU memory. To access this data on the CPU, you must perform an explicit memory copy from the GPU to the host.

27. heterosta_free_pba_path_collection

void heterosta_free_pba_path_collection(struct PBAPathCollectionCppInterface *pba_path_collection_ptr);

Description

Frees all memory resources associated with a PBAPathCollectionCppInterface object that was previously allocated by heterosta_report_paths_setup.

Arguments

  • pba_path_collection_ptr: A pointer to the path collection object to be freed.

28. heterosta_is_clock_network_net

bool heterosta_is_clock_network_net(const struct STAHoldings *sta, uintptr_t netid);

Description

A query function that determines whether a given net, specified by its internal ID, is part of a clock network.

Return Value

Returns true if the specified netid is found in the clock_network_nets set. Returns false otherwise.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • netid: The internal ID of the net to check.

29. heterosta_debug_dump_netlist_pin_names

void heterosta_debug_dump_netlist_pin_names(const struct STAHoldings *sta,
                                                     const char *path);
```**Description**
 
A utility function for debugging that writes a CSV file containing two columns: the internal pin ID and the corresponding full hierarchical pin name for every pin in the design. The file will contain a single column with the header "pin_name" followed by all pin names. This is useful for understanding the internal pin ordering required by other API functions.
 
**Arguments**
 
-   **sta**: A pointer to the `STAHoldings` environment containing the netlist database.
-   **path**: A null-terminated string containing the path for the output CSV file. The file will be created if it does not exist, or overwritten if it does.
 
---
***New APIs Added Below***
---
 
## 30. heterosta_logger_set_max_print_count
```c
void heterosta_logger_set_max_print_count(uint64_t c);

Description

Set the max print count for tagged Rust logger.

Return Value

This function does not return a value.

Arguments

  • c: The maximum number of times a tagged log message should be printed.

31. heterosta_reset

void heterosta_reset(struct STAHoldings *sta);

Description

Keep liberty and clear all other data.

Return Value

This function does not return a value.

Arguments

  • sta: A pointer to the STAHoldings environment to reset.

32. heterosta_build_flatten_parasitics

void heterosta_build_flatten_parasitics(struct STAHoldings *sta,
                                        const struct FlattenedParasiticsFFI *ffi,
                                        bool use_cuda);

Description

Build FlattenedParasitics from FFI struct.

Return Value

This function does not return a value.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • ffi: A pointer to the FlattenedParasiticsFFI structure.
  • use_cuda: A boolean flag to select the execution backend.

33. heterosta_write_spef

bool heterosta_write_spef(const struct STAHoldings *sta, const char *spef_path);

Description

Reconstruct FlattenedParasitics back into SPEF at the specified file path. Should ensure that FlattenedParasitics has been constructed before calling, that means it should be called after read_spef or extract_rc_from_placement is finished.

Return Value

Returns true if the write has succeeded. Returns false otherwise.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • spef_path: The path to the output SPEF file.

34. heterosta_update_timing_grad

void heterosta_update_timing_grad(struct STAHoldings *sta,
                                  float gamma,
                                  bool use_cuda);

Description

Update the timing gradient for all cells in parallel. This function computes the timing gradient (with respect to cell positions or other variables) for all cells in the design, using the specified gamma parameter. After updating, it also reports the gradient at the cell with the maximum value.

Return Value

This function does not return a value.

Arguments

  • sta: Mutable reference to the STAHoldings structure containing timing data.
  • gamma: The smoothing parameter for the gradient calculation.
  • use_cuda: Whether to use CUDA (GPU) for computation (true) or CPU (false).

35. heterosta_set_skip_net_with_pin

void heterosta_set_skip_net_with_pin(struct STAHoldings *sta, uintptr_t pin_id);

Description

Set a net to be skipped during placement rc extraction, given a pin index contained in that net.

Return Value

This function does not return a value.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • pin_id: The internal ID of a pin within the net to be skipped.

36. heterosta_launch_debug_shell

void heterosta_launch_debug_shell(struct STAHoldings *sta);

Description

Launch a debug Tcl shell. In the shell, you can use commands like internal_debug_pin_arrivals to print useful debug info.

Return Value

This function does not return a value.

Arguments

  • sta: A pointer to the STAHoldings environment.

37. heterosta_clone

struct STAHoldings *heterosta_clone(const struct STAHoldings *sta);

Description

Clone a timer instance.

Return Value

Returns a pointer to a new STAHoldings instance that is a copy of the original.

Arguments

  • sta: A pointer to the STAHoldings environment to be cloned.

38. heterosta_get_port_drivers

const struct LibPinInfo *heterosta_get_port_drivers(const struct STAHoldings *sta,
                                                    TimerEarlyOrLate early_or_late,
                                                    bool use_cuda);

Description

Obtain a pointer to the internal pininfo tensor state. pininfo contains pin capacitances (rise/fall), and delay and slew thresholds (0 to 1).

Return Value

Returns a pointer to the LibPinInfo structure.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • early_or_late: The timing corner to query (0 for early, 1 for late).
  • use_cuda: A boolean flag indicating if the data resides on the GPU.

39. heterosta_query_macro_pin

const struct LibPinInfo *heterosta_query_macro_pin(const struct STAHoldings *sta,
                                                   TimerEarlyOrLate early_or_late,
                                                   const char *celltype,
                                                   const char *pintype);

Description

Query the liberty pin info (caps, etc) of a macro pin.

Return Value

On success, returns a pointer to LibPinInfo on CPU. On failure, returns NULL.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • early_or_late: The timing corner to query (0 for early, 1 for late).
  • celltype: The cell type name.
  • pintype: The pin type name.

40. heterosta_get_clock_network_nets

uintptr_t heterosta_get_clock_network_nets(const struct STAHoldings *sta, uintptr_t *nets);

Description

This function get all net index associated with the clock network. The ideal network consists of both ideal clock networks and non-ideal clock networks.

Return Value

Returns the total number of clock network nets. The caller can use this value to determine how many elements in the nets array are valid.

Arguments

  • sta: A reference to the STAHoldings structure, which holds static timing data.
  • nets: A mutable pointer to an array of uintptr_t. This array will be populated with the indices of the clock network nets. It must be large enough to hold all the indices.

41. heterosta_get_sdc_ideal_network_nets

uintptr_t heterosta_get_sdc_ideal_network_nets(const struct STAHoldings *sta,
                                               uintptr_t *nets);

Description

This function get all net index associated with the ideal_network in the SDC of set_ideal_network. The sdc ideal network currently includes nes configured as propagated networks through the set_ideal_network SDC.

Return Value

Returns the total number of ideal network nets. The caller can use this value to determine how many elements in the nets array are valid.

Arguments

  • sta: A reference to the STAHoldings structure, which holds static timing data.
  • nets: A mutable pointer to an array of uintptr_t. This array will be populated with the indices of the ideal network nets in the sdc of set_ideal_network. It must be large enough to hold all the indices.

42. heterosta_query_pin_load

float heterosta_query_pin_load(const struct STAHoldings *sta,
                               TimerEarlyOrLate early_or_late,
                               uintptr_t pinid);

Description

Query the pin capacitance value by pin index.

Return Value

On success, returns the capacitance value on the net where the pin is located. On failure, returns 0.

Arguments

  • sta: Reference to the STAHoldings structure.
  • early_or_late: Timing context (0: early, 1: late).
  • pinid: The pin index.

43. heterosta_query_pin_upstream_res

float heterosta_query_pin_upstream_res(const struct STAHoldings *sta,
                                       TimerEarlyOrLate early_or_late,
                                       uintptr_t pinid);

Description

Query the pin upstream resistance value by pin index (as an Elmore model perspective).

Return Value

On success, returns the upstream resistance of the pin, which is the total resistance from the source to the sink in the RC tree. On failure, returns 0.

Arguments

  • sta: Reference to the STAHoldings structure.
  • early_or_late: Timing context (0: early, 1: late).
  • pinid: The pin index.

44. heterosta_query_pin_max_load

float heterosta_query_pin_max_load(const struct STAHoldings *sta,
                                   TimerEarlyOrLate early_or_late,
                                   uintptr_t pinid);

Description

Query the maximum capacitance of a pin as recorded in Liberty. This value is taken from the max_cap recorded in Liberty. If set_max_capacitance is specified in the SDC file, the minimum value between the SDC and Liberty will be used. If the liberty does not record a default_max_capacitance, the function will return NaN.

Return Value

On success, returns the pin's maximum capacitance. On failure, returns NaN.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • early_or_late: The timing corner to query (0 for early, 1 for late).
  • pinid: The internal ID of the pin.

45. heterosta_query_pin_transition

float heterosta_query_pin_transition(const struct STAHoldings *sta,
                                     TimerEarlyOrLate early_or_late,
                                     TimerRiseOrFall rise_or_fall,
                                     uintptr_t pinid);

Description

Query the real transition time by pin index. If you want slew instead, you should multiply it by your slew_derate.

Return Value

Returns the transition time for the specified pin.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • early_or_late: The timing corner to query (0 for early, 1 for late).
  • rise_or_fall: The transition direction to query (0 for rise, 1 for fall).
  • pinid: The internal ID of the pin.

46. heterosta_query_pin_max_transition

float heterosta_query_pin_max_transition(const struct STAHoldings *sta,
                                         TimerEarlyOrLate early_or_late,
                                         uintptr_t pinid);

Description

Query the maximum transition of a pin as recorded in Liberty. This value is taken from the max_tran recorded in Liberty. If set_max_transition is specified in the SDC file, the minimum value between the SDC and Liberty will be used. If the liberty does not record a default_max_transition, the function will return NaN.

Return Value

On success, returns the pin's maximum transition. On failure, returns NaN.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • early_or_late: The timing corner to query (0 for early, 1 for late).
  • pinid: The internal ID of the pin.

47. heterosta_query_pin_cap

float heterosta_query_pin_cap(const struct STAHoldings *sta,
                              TimerEarlyOrLate early_or_late,
                              TimerRiseOrFall rise_or_fall,
                              uintptr_t pinid);

Description

Query the input capacitance of a pin as recorded in Liberty. This value is taken from the capacitance recorded in Liberty. The unit is in femtofarads (fF). If the pin is an input port or output port, the function will return NaN. If the input or output load is set using set_load in the SDC, the function will return the load value.

Return Value

On success, returns the pin's capacitance. On failure, returns NaN.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • early_or_late: The timing corner to query (0 for early, 1 for late).
  • rise_or_fall: The transition direction to query (0 for rise, 1 for fall).
  • pinid: The internal ID of the pin.

48. heterosta_query_pin_max_fanout

float heterosta_query_pin_max_fanout(const struct STAHoldings *sta,
                                     TimerEarlyOrLate early_or_late,
                                     uintptr_t pinid);

Description

Query the maximum fanout of a pin as recorded in Liberty. This value is taken from the max_fanout recorded in Liberty. If set_max_fanout is specified in the SDC file, the minimum value between the SDC and Liberty will be used. If the liberty does not record a default_max_fanout, the function will return NaN.

Return Value

On success, returns the pin's maximum fanout. On failure, returns NaN.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • early_or_late: The timing corner to query (0 for early, 1 for late).
  • pinid: The internal ID of the pin.

49. heterosta_get_celltype_of_pin

const char *heterosta_get_celltype_of_pin(const struct STAHoldings *sta, uintptr_t pinid);

Description

Query the cell type by pin index. The returned string reference is valid up to your next API call that updates the timer database.

Return Value

On success, returns the cell type where the pin is located. On failure, returns NULL. It is recommended to wrap the returned pointer in a std::string or manage its memory carefully to prevent memory leaks.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • pinid: The internal index of the pin to query.

50. heterosta_get_cellid_of_pin

uintptr_t heterosta_get_cellid_of_pin(const struct STAHoldings *sta, uintptr_t pinid);

Description

Query the cell id by pin index.

Return Value

On success, returns the cell id where the pin is located. On failure, returns UINTPTR_MAX.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • pinid: The internal index of the pin to query.

51. heterosta_get_cellname_by_id

const char *heterosta_get_cellname_by_id(const struct STAHoldings *sta, uintptr_t cellid);

Description

Query the cell name by cell id. The returned string reference is valid up to your next API call that updates the timer database.

Return Value

On success, returns the cell name. On failure, returns NULL. It is recommended to wrap the returned pointer in a std::string or manage its memory carefully to prevent memory leaks.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • cellid: The internal ID of the cell.

52. heterosta_get_celltype_by_id

const char *heterosta_get_celltype_by_id(const struct STAHoldings *sta, uintptr_t cellid);

Description

Query the cell type by cell id. The returned string reference is valid up to your next API call that updates the timer database.

Return Value

On success, returns the cell type. On failure, returns NULL. It is recommended to wrap the returned pointer in a std::string or manage its memory carefully to prevent memory leaks.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • cellid: The internal ID of the cell.

53. heterosta_get_pintype_of_pin

const char *heterosta_get_pintype_of_pin(const struct STAHoldings *sta, uintptr_t pinid);

Description

Query the pin type by pin index. The returned string reference is valid up to your next API call that updates the timer database.

Return Value

On success, returns the pin type where the pin is located. On failure, returns NULL. It is recommended to wrap the returned pointer in a std::string or manage its memory carefully to prevent memory leaks.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • pinid: The internal index of the pin to query.

54. heterosta_get_libname_of_pin

const char *heterosta_get_libname_of_pin(const struct STAHoldings *sta, uintptr_t pinid);```
**Description**
 
Query the liberty name by pin index. The returned string reference is valid up to your next API call that updates the timer database.
 
**Return Value**
 
On success, returns the liberty name where the pin is located. On failure, returns NULL. It is recommended to wrap the returned pointer in a `std::string` or manage its memory carefully to prevent memory leaks.
 
**Arguments**
 
-   **sta**: A pointer to the `STAHoldings` environment.
-   **pinid**: The internal index of the pin to query.
 
## 55. heterosta_query_macro_arc
```c
const struct TimingArcPointer *heterosta_query_macro_arc(const struct STAHoldings *sta,
                                                         TimerEarlyOrLate early_or_late,
                                                         const char *celltype,
                                                         const char *pintype,
                                                         const char *from_pintype,
                                                         bool use_cuda);

Description

Query the liberty arc info (caps, etc) of a macro arc. The returned string reference is valid up to your next API call that updates the timer database.

Return Value

On success, returns a pointer to TimingArcPointer. On failure, returns NULL.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • early_or_late: The timing corner to query (0 for early, 1 for late).
  • celltype: The cell type name.
  • pintype: The 'to' pin type name of the arc.
  • from_pintype: The 'from' pin type name of the arc.
  • use_cuda: A boolean flag to select the execution backend.

56. heterosta_reset_pba

void heterosta_reset_pba(struct STAHoldings *sta);

Description

Reset the PBA environment in timer. This allows you to apply a different SDC without re-initializing the netlist or library database.

Return Value

This function does not return a value.

Arguments

  • sta: A pointer to the STAHoldings environment.

57. heterosta_get_total_leakage_power

float heterosta_get_total_leakage_power(const struct STAHoldings *sta,
                                        TimerEarlyOrLate early_or_late);

Description

Get total leakage power. Before calling this, heterosta_update_power should be called.

Return Value

Returns the total leakage power, otherwise NaN will be returned.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • early_or_late: The timing corner to query (0 for early, 1 for late).

58. heterosta_update_power

void heterosta_update_power(struct STAHoldings *sta);

Description

Update design power information. Currently only leakage power is supported.

Return Value

This function does not return a value.

Arguments

  • sta: A pointer to the STAHoldings environment.

59. heterosta_fast_update_celltype_by_cellid

bool heterosta_fast_update_celltype_by_cellid(struct STAHoldings *sta,
                                              uintptr_t cellid,
                                              const char *cellname);

Description

Quickly changes the cell type of the given node in the netlist. This function changes the cell type associated with a specific node ID using the provided cellname. If the function and footprint of the new cell type are the same as the existing cell type, it updates the corresponding timing arcs for the cell. After calling this function, you should call heterosta_update_delay to update timing analysis.

Return Value

Returns true if the update was successful, false otherwise.

Arguments

  • sta: A mutable reference to the STAHoldings structure.
  • cellid: The index of the cell in the timer's netlist database.
  • cellname: A C-style string pointer representing the name of the cell to be assigned to the node.

60. heterosta_batch_update_celltypes

uintptr_t heterosta_batch_update_celltypes(struct STAHoldings *sta,
                                           const char *const *celltypes,
                                           uintptr_t num_cells);

Description

Batch update cell types for all cells in the design. This function receives an array of cell type names, compares each with the current cell type in the netlist database, and updates the cell type if it is different. The update logic is the same as heterosta_fast_update_celltype_by_cellid.

Return Value

The number of cells that were updated.

Arguments

  • sta: Mutable reference to the STAHoldings structure containing timing data.
  • celltypes: Pointer to an array of C string pointers, each representing a cell type name.
  • num_cells: The number of cells (length of the celltypes array).

61. heterosta_get_cell_footprints

struct CellFootprints heterosta_get_cell_footprints(const struct STAHoldings *sta,
                                                    TimerEarlyOrLate early_or_late);

Description

Retrieves and constructs a CellFootprints structure based on the internal data. This function gathers information about cell footprints, including their names, associated cell types, and cell type properties, and organizes the data into a CellFootprints structure.

Return Value

Returns a CellFootprints structure. The caller must call heterosta_free_cell_footprints to release the allocated memory.

Arguments

  • sta: A pointer to the STAHoldings environment.
  • early_or_late: The timing corner to query (0 for early, 1 for late).

62. heterosta_free_cell_footprints

void heterosta_free_cell_footprints(struct CellFootprints *footprints);

Description

Free a previously created CellFootprints instance.

Return Value

This function does not return a value.

Arguments

  • footprints: A pointer to the CellFootprints instance to be freed.

63. heterosta_calc_cell_arc_delay_nldm_with_macro_pin

float heterosta_calc_cell_arc_delay_nldm_with_macro_pin(const struct STAHoldings *sta,
                                                        const char *celltype,
                                                        const char *from_pintype,
                                                        const char *to_pintype,
                                                        TimerRiseOrFall from_rf,
                                                        TimerRiseOrFall to_rf,
                                                        float input_transition,
                                                        float output_load);

Description

Calculate the NLDM arc delay of a cell based on the specified input/output points and conditions. This function computes the cell arc delay between the specified from and to pin types, considering the given input transition time and output load.

Return Value

The calculated cell arc delay as a float (ps). Returns NaN if timing arc is invalid.

Arguments

  • sta: Pointer to the STAHoldings object.
  • celltype: C string representing the cell type.
  • from_pintype: C string representing the starting pin type.
  • to_pintype: C string representing the destination pin type.
  • from_rf: Rise/Fall state of the from point (0: rise, 1: fall).
  • to_rf: Rise/Fall state of the to point (0: rise, 1: fall).
  • input_transition: Input transition time (in time units).
  • output_load: Output load (in capacitance units).

64. heterosta_calc_cell_arc_delay_nldm_with_netlist_driver_pin_rf

float heterosta_calc_cell_arc_delay_nldm_with_netlist_driver_pin_rf(const struct STAHoldings *sta,
                                                                    uintptr_t driver_pin_id,
                                                                    TimerRiseOrFall driver_rf,
                                                                    float output_load,
                                                                    TimerEarlyOrLate early_or_late);

Description

Calculate the arc delay of a cell based on the specified driver pin rf and output load. This function computes the cell arc delay for the most critical input pin of the specified driver pin rf.

Return Value

The calculated cell arc delay as a float (ps). Returns 0.0 if timing arc is invalid.

Arguments

  • sta: Pointer to the STAHoldings object.
  • driver_pin_id: The driver pin id.
  • driver_rf: The rise/fall state of the driver pin (0: rise, 1: fall).
  • output_load: The output load (in capacitance units).
  • early_or_late: early lib or late lib (0: early, 1: late).

65. heterosta_calc_output_transition_nldm

float heterosta_calc_output_transition_nldm(const struct STAHoldings *sta,
                                            const char *celltype,
                                            const char *from_pintype,
                                            const char *to_pintype,
                                            TimerRiseOrFall from_rf,
                                            TimerRiseOrFall to_rf,
                                            float input_transition,
                                            float output_load,
                                            TimerEarlyOrLate early_or_late);

Description

Calculate the NLDM output transition time based on cell type and pin configuration. This function computes the output transition time for a specific cell, considering the input and output pins, their rise/fall states, input transition, and output load.

Return Value

The calculated output transition time. Returns NaN if the timing arc is not found or invalid.

Arguments

  • sta: Reference to the STAHoldings structure containing timing data.
  • celltype: C string representing the cell type name.
  • from_pintype: C string representing the input pin name.
  • to_pintype: C string representing the output pin name.
  • from_rf: Rise (0) or fall (1) state of the input signal.
  • to_rf: Rise (0) or fall (1) state of the output signal.
  • input_transition: Input transition time (in time units).
  • output_load: Output load capacitance (in capacitance units).
  • early_or_late: Whether to use early (0) or late (1) timing data.

66. heterosta_calc_output_transition_nldm_with_pin_rf

float heterosta_calc_output_transition_nldm_with_pin_rf(const struct STAHoldings *sta,
                                                        uintptr_t driver_pin_id,
                                                        TimerRiseOrFall driver_rf,
                                                        float output_load,
                                                        TimerEarlyOrLate early_or_late,
                                                        bool *output_transition_legal,
                                                        bool *downstream_input_transition_legal);

Description

Calculate the NLDM output transition time for a specific driver pin with given rise/fall state. This function identifies the critical input pin with minimum slack that drives the specified output pin, and computes the output transition time based on the actual input slew and provided output load.

Return Value

The calculated output transition time. Returns NaN if no valid timing arc is found.

Arguments

  • sta: Reference to the STAHoldings structure containing timing data.
  • driver_pin_id: ID of the driver pin (output pin).
  • driver_rf: Rise (0) or fall (1) state of the driver pin.
  • output_load: Output load capacitance (in capacitance units).
  • early_or_late: Whether to use early (0) or late (1) timing data.
  • output_transition_legal: (out) Boolean indicating if the output transition is legal.
  • downstream_input_transition_legal: (out) Boolean indicating if the downstream input transition is legal.

67. heterosta_get_cell_arc_delay

float heterosta_get_cell_arc_delay(const struct STAHoldings *sta,
                                   uintptr_t from_pin_rf,
                                   uintptr_t to_pin_rf);

Description

This function return the arc delay in timing path.

Return Value

Returns the arc delay in timing path (ps). If the pins are invalid (no timing arc or incorrect direction), the function returns NaN.

Arguments

  • sta: A reference to the STAHoldings object.
  • from_pin_rf: The "from" pin with a rise/fall flag. The actual pin ID is extracted by shifting right (>> 1).
  • to_pin_rf: The "to" pin with a rise/fall flag. The actual pin ID is extracted by shifting right (>> 1).

68. heterosta_get_cell_intrinsic_delay

float heterosta_get_cell_intrinsic_delay(const struct STAHoldings *sta,
                                         const char *celltype,
                                         const char *from_pintype,
                                         const char *to_pintype,
                                         TimerRiseOrFall from_rf,
                                         TimerRiseOrFall to_rf);

Description

Calculate the intrinsic delay of a cell based on the specified input/output points and conditions.

Return Value

The intrinsic delay as a float.

Arguments

  • sta: Pointer to the STAHoldings object.
  • celltype: C string representing the cell type.
  • from_pintype: C string representing the starting pin type.
  • to_pintype: C string representing the destination pin type.
  • from_rf: Rise/Fall state of the from point (0: rise, 1: fall).
  • to_rf: Rise/Fall state of the to point (0: rise, 1: fall).

69. heterosta_query_drive_resistance

float heterosta_query_drive_resistance(const struct STAHoldings *sta,
                                       const char *celltype,
                                       const char *from_pintype,
                                       const char *to_pintype,
                                       TimerRiseOrFall from_rf,
                                       TimerRiseOrFall to_rf,
                                       TimerEarlyOrLate early_or_late);
```**Description**
 
Query the drive resistance of a cell based on the specified input/output points.
 
**Return Value**
 
The drive resistance as a float, NAN if nonexists.
 
**Arguments**
 
-   **sta**: Pointer to the STAHoldings object.
-   **celltype**: C string representing the cell type.
-   **from_pintype**: C string representing the starting pin type.
-   **to_pintype**: C string representing the destination pin type.
-   **from_rf**: Rise/Fall state of the `from` point (0: rise, 1: fall).
-   **to_rf**: Rise/Fall state of the `to` point (0: rise, 1: fall).
-   **early_or_late**: early lib or late lib (0: early, 1: late).
 
## 70. heterosta_get_footprint_by_celltype
```c
const char *heterosta_get_footprint_by_celltype(const struct STAHoldings *sta,
                                                const char *celltype,
                                                TimerEarlyOrLate early_or_late);

Description

Get the footprint of a cell based on its type. This function retrieves the footprint (physical representation) of a cell based on the provided cell type and timing context.

Return Value

A pointer to a C string containing the footprint, or null if the cell type is not found. It is recommended to wrap the returned pointer in a std::string or manage its memory carefully to prevent memory leaks.

Arguments

  • sta: Reference to the STAHoldings object containing cell data.
  • celltype: C string representing the cell type.
  • early_or_late: Timing context (0: early, 1: late).

71. heterosta_get_celltypes_by_footprint

const char *const *heterosta_get_celltypes_by_footprint(const struct STAHoldings *sta,
                                                        const char *footprint,
                                                        uintptr_t *output_len,
                                                        TimerEarlyOrLate early_or_late);

Description

Get a list of cell types associated with a given footprint. This function retrieves a list of cell types that share the same footprint. Will skip dont_use and dont_touch cell.

Return Value

A pointer to an array of C strings containing the cell types, or null if the footprint is not found. The caller must free this list using heterosta_free_celltypes_list.

Arguments

  • sta: Reference to the STAHoldings object containing cell data.
  • footprint: C string representing the footprint.
  • output_len: Pointer to a variable where the length of the returned array will be stored.
  • early_or_late: Timing context (0: early, 1: late).

72. heterosta_free_celltypes_list

void heterosta_free_celltypes_list(const char *const *celltypes, uintptr_t len);

Description

Free a previously allocated list of cell types returned by heterosta_get_celltypes_by_footprint.

Return Value

This function does not return a value.

Arguments

  • celltypes: Pointer to the array of C strings to be freed.
  • len: Length of the array.

73. heterosta_get_version

const char *heterosta_get_version(void);

Description

Get the git version description string.

Return Value

Returns a pointer to a null-terminated C string containing version information obtained from git during build. This pointer is valid for the lifetime of the application and should not be freed. It is recommended to wrap the returned pointer in a std::string or manage its memory carefully to prevent memory leaks.

74. heterosta_logger_enable_print_count_limit

void heterosta_logger_enable_print_count_limit(bool enable);

Description

Enables or disables the print count limit for the logger. This is useful for debugging or when you want to see all log messages without restrictions.

Return Value

This function does not return a value.

Arguments

  • enable: If true, the logger will limit the number of printed messages. If false, the logger will print all messages without any limit.

75. heterosta_logger_enable_timer_prefix

void heterosta_logger_enable_timer_prefix(const char *prefix);

Description

Enables timer logs for a specific prefix.

Return Value

This function does not return a value.

Arguments

  • prefix: The string prefix to enable logging for.

76. heterosta_logger_reset_print_count_limit

void heterosta_logger_reset_print_count_limit(void);

Description

Resets the print count limit for the logger. This function clears the internal counter that tracks the number of log messages printed. It is useful for scenarios where you want to start fresh and count log messages from a clean state.

Return Value

This function does not return a value.

77. heterosta_free_c_string

void heterosta_free_c_string(char *s);

Description

Free a C string allocated by Rust. It is important to ensure that the pointer passed to this function was indeed allocated by Rust to avoid undefined behavior.

Return Value

This function does not return a value.

Arguments

  • s: The C string pointer to be freed.

78. heterosta_query_sdc_design_wide_max_transition

float heterosta_query_sdc_design_wide_max_transition(const struct STAHoldings *sta,
                                                     TimerEarlyOrLate early_or_late);

Description

Query the design-wide maximum transition limit from SDC constraints.

Return Value

The maximum allowed transition time (in time units) for the entire design.

Arguments

  • sta: A reference to the STAHoldings structure.
  • early_or_late: Timing context (0: early, 1: late).

79. heterosta_query_sdc_design_wide_max_fanout

float heterosta_query_sdc_design_wide_max_fanout(const struct STAHoldings *sta,
                                                 TimerEarlyOrLate early_or_late);

Description

Query the design-wide maximum fanout limit from SDC constraints.

Return Value

The maximum allowed fanout for the entire design.

Arguments

  • sta: A reference to the STAHoldings structure.
  • early_or_late: Timing context (0: early, 1: late).