sch-rnd-aux knowledge pool

 

Project stances

stance by Tibor 'Igor2' Palinkas on 2023-07-02

Tags: howto, stance, stances, build, option, options, variant, model

node source

 

 

Abstract: This pool node is a guide on how to define and manage different build options from the same schematics.

 

Stances

Build options are called stances in sch-rnd. They are project level configuration because a project may have multiple sheets and the same configuration should be used for all sheets when exporting the netlist from the project.

The stances can be found in the config tree /stance. Each stance has two config nodes: the stance itself, e.g. "model" holds the current value, the node suffixed with "_values", e.g. "model_values", holds the list of recommended values. All values are abitrary, user chosen strings.

As of 2023, there are four stances in the config:

name usage
model for the simplest cases, this single stance selects which one of the build configurations is used (e.g. which model or variant of the board is made)
sub_major major subtype; if there's a build option that is orthogonal to the model, this stance should be used
sub_minor minor subtype; if there's a build option that is orthogonal to both the model and the sub_major stances, this stance should be used
test_bench used by the sim infrastructure to choose a test bench for simulation (controls which test bench adds sources and loads; which parts of the circuit should be included in the simulation)

Stances can be edited directly from the preferences dialog's config tree tab or using the dedicated dialog box: file menu, projects, project stances (select a stance and click on the edit button).

Conditional forge

Stances are typically used in conditional forge:

The forge system (implemented in plugin std_forge) is a powerful tool to manipulate abstract model attributes. The conditional forge variant allows such manipulation to happen conditionally, depending on how project stances are set. In other words, setting project stances selects differnet aspects of build options (which vairant of the design is dealt with) but the actual differences are executed using conditional forges in components and nets.

A few examples on how a conditional forge can be used to:

... depending on which vairant of the design is built.

The right click context menu over a symbol also has a conditional submenu that helps managing the most commonly used conditonals (dnp or omit) , by creating or changing the attributes forge-if/dnp or forge-if/omit . This is a shorthand for a narrow, but common use case.