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>
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(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/$::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.
To run the script to create new (empty) configurations for a (PDK,STD_CELL_LIBRARY) pair:
python3 ./scripts/replicateDesignsConfigs.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/replicateDesignsConfigs.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:
Argument | Description |
---|---|
--designs | -d <design1 design2 design3 ...> (Optional) |
Specifies the designs to create/replicate the configs for. same as -design argument in flow.tcl Default is to update all designs under designs/ |
--from-pdk | -fp <PDK> (Optional) |
The name of the PDK that the replicated design configuration belongs to. if not specified along with from-std-cell-lib, the script will create a new configuration file for (pdkTo,to_std_cell_lib) that is empty. |
--from-std-cell-lib | -fscl <STD_CELL_LIBRARY> (Optional) |
The name of the STD_CELL_LIBRARY that the replicated design configuration belongs to. if not specified along with from_std_cell_lib, the script will create a new configuration file for (pdkTo,to_std_cell_lib) that is empty. |
--to-pdk | -tp <PDK> (Required) |
The name of the PDK that the created design configurations belongs to. |
--to-std-cell-lib | -tscl <STD_CELL_LIBRARY> (Required) |
The name of the STD_CELL_LIBRARY that the created design configurations belongs to. |
To run the script to update configurations for a (PDK,STD_CELL_LIBRARY) pair after an exploration:
python3 ./scripts/updateDesignsConfigs.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:
Argument | Description |
---|---|
--designs | -d <design1 design2 design3 ...> (Optional) |
Specifies the designs to update the configs for. Same us -design in flow.tcl. Default is to update all designs that exist in the given log file (_best.csv) |
--root | -r <dirctory> (Optional) |
Sets the root directory. The root should have the following folders under it: designs, logs, and scripts. Default is the assumption that the script is called from the openlane root. |
--pdk | -p <PDK> (Required) |
The name of the PDK that the updated design(s) configuration belongs to. |
--std-cell-lib | -scl <STD_CELL_LIBRARY> (Optional) |
The name of the STD_CELL_LIBRARY that the updated design(s) configuration belongs to. |
--best_results | -b <csv file> (Required) |
This is the log file containing the best run for each design in a specific exploration. The log file will be used to determine the name of the configuration file to update from. The csv file provided must one occurance of each design. To tolerate custom log files, the script only exctracts the name of the design, its corresponding configuration file path, and whether the design passed or not by reading the runtime. If there were more than one occurance of the same design, the last occurance will override others. |
--update_clock_period | -ucp (Boolean) |
Specifies whether or not to update the CLOCK_PERIOD of the design based on the suggested_clock_period parameter. Default value: False
|
--clean | -cl (Boolean) |
Specifies whether or not to delete the configuration file that the updated configuration file is updated from. Default value: False
|
Note: updateDesignsConfigs.py skips designs that fail during the exploration, which means their runtime will be -1
.
Important Note: The updateDesignsConfigs 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 replicateDesignsConfigs copies the whole file.