12. Targets

To facilitate encapsulation and reuse of schema parameters related to design targets, SiliconCompiler implements a load_target() function which can run scripts that set up common combinations of Flow, PDK, Library, and Checklist modules.

The load_target() function takes in a string targetname. Similar to most other SiliconCompiler modules, it will search for a targets.targetname module in the current directory and Python search path. A full list of built-in targets can be found on the Targets directory page.

All target modules must contain a function called setup(), which takes in a Chip object and can modify the Chip’s schema parameters in any way. It’s common for targets to load at least one flow, a PDK and at least one standard cell library if the design is being built as an ASIC. They can also set up default design parameters and tool options. Targets should also include a make_docs() function which provides a descriptive docstring and returns a Chip object with the target loaded.

SC supports additional levels of encapsulation through PDK, library, and flow modules. Unlike targets, these modules are imported as Python libraries and pulled into the Chip object with the use() method. See the PDK, Library, and Flow User Guide pages to learn more about what is expected to be configured in each of these modules.

Generally, these functions will be called by targets, and then a user will only have to call load_target() in their build script. However, the run() function requires all mandatory flowgraph, pdk, and tool settings to be defined prior to execution, so if a partial target is loaded, additional setup may be required.

The following example calls the load_target() function to load the built-in freepdk45_demo target.

chip.load_target('freepdk45_demo')

The following example demonstrates the functional equivalent at the command line:

sc hello.v -target "freepdk45_demo"

Targets can also be dedicated to individual projects or use cases, rather than general-purpose processing. For example, we ship a self-test target with SiliconCompiler, which builds a simple 8-bit counter to verify that everything is installed and configured correctly:

sc -target "asic_demo"

A full list of built-in demo targets can be found on the Targets directory page.