Skip to content

Commit

Permalink
Cleanup and docs for configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePopoloski committed Mar 7, 2024
1 parent 19e56a2 commit ea14f8a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
10 changes: 8 additions & 2 deletions bindings/python/CompBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ void registerCompilation(py::module_& m) {
.def_readwrite("paramOverrides", &CompilationOptions::paramOverrides)
.def_readwrite("defaultLiblist", &CompilationOptions::defaultLiblist);

py::class_<Compilation>(m, "Compilation")
.def(py::init<>())
py::class_<Compilation> comp(m, "Compilation");
comp.def(py::init<>())
.def(py::init<const Bag&>(), "options"_a)
.def_property_readonly("options", &Compilation::getOptions)
.def_property_readonly("isFinalized", &Compilation::isFinalized)
Expand Down Expand Up @@ -143,6 +143,12 @@ void registerCompilation(py::module_& m) {
.def_property_readonly("typeRefType", &Compilation::getTypeRefType)
.def_property_readonly("wireNetType", &Compilation::getWireNetType);

py::class_<Compilation::DefinitionLookupResult>(comp, "DefinitionLookupResult")
.def(py::init<>())
.def_readwrite("definition", &Compilation::DefinitionLookupResult::definition)
.def_readwrite("configRoot", &Compilation::DefinitionLookupResult::configRoot)
.def_readwrite("configRule", &Compilation::DefinitionLookupResult::configRule);

py::class_<ScriptSession>(m, "ScriptSession")
.def(py::init<>())
.def_readonly("compilation", &ScriptSession::compilation)
Expand Down
2 changes: 2 additions & 0 deletions bindings/python/SymbolBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,4 +719,6 @@ void registerSymbols(py::module_& m) {
.def_readonly("options", &CoverCrossSymbol::options)
.def_readonly("targets", &CoverCrossSymbol::targets)
.def_property_readonly("iffExpr", &CoverCrossSymbol::getIffExpr);

py::class_<ConfigBlockSymbol, Symbol, Scope>(m, "ConfigBlockSymbol");
}
13 changes: 10 additions & 3 deletions docs/command-line-ref.dox
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,16 @@ symbols are dumped.

`--top <name>`

Specifies the name of a module that should be instantiated at the root of the design.
Can be specified more than once to instantiate multiple top-level modules. The module
specified must not have any non-defaulted parameters or interface ports.
Specifies the name of a module or program that should be instantiated at the root
of the design. Can be specified more than once to instantiate multiple top-level modules.
The module (or program) specified must not have any non-defaulted parameters or
interface ports.

Additionally, you can specify the name of one or more SystemVerilog configurations.
The cells specified in the `design` statement of those configurations will become
the top levels of the design. If the name of a configuration overlaps with that of
a module/interface/program definition, the latter will be taken by default. You can use
a `:config` suffix on the name to explicitly select the configuration.

If no top modules are specified manually, they will be automatically inferred by
finding all modules that are not instantiated elsewhere in the design.
Expand Down
8 changes: 4 additions & 4 deletions docs/language-support.dox
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,12 @@ IEEE 1800-2017 SystemVerilog Language Reference Manual (LRM).

{{w:15%}} LRM | Feature | {{w:15%}} Supported
--- | ------- | ---------
{{m-warning}} 33.2 | Overview | partial
{{m-success}} 33.2 | Overview | v6.0
{{m-success}} 33.3 | Libraries | v4.0
{{m-warning}} 33.4 | Configurations | partial
{{m-success}} 33.4 | Configurations | v6.0
{{m-success}} 33.5 | Using libraries and configs | v5.0
{{m-warning}} 33.6 | Configuration examples | partial
{{m-warning}} 33.7 | Displaying library binding information | partial
{{m-success}} 33.6 | Configuration examples | v6.0
{{m-success}} 33.7 | Displaying library binding information | v6.0
{{m-success}} 33.8 | Library mapping examples | v4.0

## 34. Protected envelopes
Expand Down
1 change: 0 additions & 1 deletion source/ast/Compilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,6 @@ void Compilation::insertDefinition(Symbol& symbol, const Scope& scope) {
// Duplicate in the same library. If they are both the same kind
// then we report a warning and take the first one, otherwise
// we give a hard error.
// TODO: take the second one instead of the first?
if (vSym->kind == symbol.kind) {
if (!warned) {
// We keep going after this because there might also
Expand Down
4 changes: 3 additions & 1 deletion source/ast/symbols/CompilationUnitSymbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,9 @@ void ConfigBlockSymbol::registerRules(const InstanceOverride& node) const {
}

void ConfigBlockSymbol::serializeTo(ASTSerializer&) const {
// TODO:
// We don't serialize config blocks; they're never visited as
// part of visiting the AST, they get resolved as part of
// elaboration looking up definitions.
}

} // namespace slang::ast

0 comments on commit ea14f8a

Please sign in to comment.