Designs, Their Configuration, useful utilties:

Adding a design

To add a new design, the following command creates a configuration file for your design:

./flow.tcl -design <design_name> -init_design_config

This will create the following directory structure:

designs/<design_name>
├── config.tcl

In the configuration file, you should edit the required variables and the optional variables, if needed. Further information about the variables can be found here

Also, the <design_name> could be replaced by the <design_directory>, which will allow you to run any design on your machine.

Note: config.tcl is a global configuration for all PDKs. For more information about design configuration files please visit this section

It is recommended to place the design‘s verilog files in a src directory inside the design’s folder as following:

designs/<design_name>
├── config.tcl
├── src
   ├── design.v

However, you can point to the src files while initializing the design and they will be pointed to automatically in the configuration file and will also be automatically copied to the src directory creating the same structure shown above.

./flow.tcl -design <design_name> -init_design_config -src <list_verilog_files>

Optionally, you can specify the configuration file name (without the extension) by using:

./flow.tcl -design <design_name> -init_design_config -tag <config_name>

After adding the design, you can specify the design name using a -design argument:

./flow.tcl -design <design_name>

Finally, you can specify the configuration file (belonging to that design) the flow should use:

./flow.tcl -design <design_name> -config <config_name>

Configuration files

For each design there is a global config.tcl and other config files one for each PDK:

designs/<design_name>
├── config.tcl
├── skywater-pdk_sky130_fd_sc_hs_config.tcl
├── skywater-pdk_sky130_fd_sc_hd_config.tcl
├── src
   ├── design.v

The general rule generated by using -init_design_config when adding a design is that the global config.tcl should end with:

set filename $::env(DESIGN_DIR)/$::env(PDK)_$::env(STD_CELL_LIBRARY)_config.tcl
if { [file exists $filename] == 1} {
	source $filename
}

This implies that if the (PDK)_(STD_CELL_LIBRARY)_config.tcl doesn't exist the flow would resume normally with only the global config.tcl.

This structure allows for storing the best configurations for a given design on all different PDKs and their STD_CELL_LIBRARYs. The best configuration for a given design differ from one PDK and STD_CELL_LIBRARY to another. For this reason, upon installing a new PDK/STD_CELL_LIBRARY or a new design, an exploration should be run on different configuration parameters to reach the best configuration. The script that enables this is here. After running the exploration, you will find in the logs two .csv newly generated files: {tag}{timestamp}.csv and {tag}{timestamp}_best.csv. The configuration name reported in the _best.csv file contains the best added configurations to the current run of the given design using the specified PDK/STD_CELL_LIBRARY.

Two scripts were created for this purpose:

  • A script to create a new configuration file for a given (PDK, STD_CELL_LIBRARY) pair, or replicate the configuration of a (PDK, STD_CELL_LIBRARY) to another (PDK, STD_CELL_LIBRARY).
  • A script to update the configuration of a given (PDK, STD_CELL_LIBRARY) according to an exploration result provided by a {tag}_best.csv file.

Replicate/Create Design Configs for a (PDK,STD_CELL_LIBRARY) Pair:

To run the script to create new (empty) configurations for a (PDK,STD_CELL_LIBRARY) pair:

    python3 ./scripts/replicate_design_configs.py --to-pdk PDK --to-std-cell-lib STD_CELL_LIBRARY

To run the script to replicate configurations from one (PDK,STD_CELL_LIBRARY) pair to another:

    python3 ./scripts/replicate_design_configs.py --from-pdk PDK_FROM --from-std-cell-lib STD_CELL_LIBRARY_FROM --to-pdk PDK --to-std-cell-lib STD_CELL_LIBRARY

The following is the list of flags used with the script:

Update Design Configs for a (PDK,STD_CELL_LIBRARY) Pair after an Exploration:

To run the script to update configurations for a (PDK,STD_CELL_LIBRARY) pair after an exploration:

    python3 ./scripts/update_designs_configs.py --pdk PDK --std-cell-lib STD_CELL_LIBRARY --best_results SW_exploration_best.csv

Check this for more details on the log files.

The following is the list of flags used with the script:

Note: update_designs_configs.py skips designs that fail during the exploration, which means their flow_status is not flow_completed.

Important Note: The update_designs_configs script only copies new configuration to the file. The new configurations are marked with a preceeding “# Regression” comment that is automatically written before them by the exploration script. However, the replicate_design_configs script copies the whole file.