diff --git a/bindings/python/CompBindings.cpp b/bindings/python/CompBindings.cpp index 8eb02f134..16a7c66eb 100644 --- a/bindings/python/CompBindings.cpp +++ b/bindings/python/CompBindings.cpp @@ -73,8 +73,8 @@ void registerCompilation(py::module_& m) { .def_readwrite("paramOverrides", &CompilationOptions::paramOverrides) .def_readwrite("defaultLiblist", &CompilationOptions::defaultLiblist); - py::class_(m, "Compilation") - .def(py::init<>()) + py::class_ comp(m, "Compilation"); + comp.def(py::init<>()) .def(py::init(), "options"_a) .def_property_readonly("options", &Compilation::getOptions) .def_property_readonly("isFinalized", &Compilation::isFinalized) @@ -143,6 +143,12 @@ void registerCompilation(py::module_& m) { .def_property_readonly("typeRefType", &Compilation::getTypeRefType) .def_property_readonly("wireNetType", &Compilation::getWireNetType); + py::class_(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_(m, "ScriptSession") .def(py::init<>()) .def_readonly("compilation", &ScriptSession::compilation) diff --git a/bindings/python/SymbolBindings.cpp b/bindings/python/SymbolBindings.cpp index 48f8d0d8f..7fae50493 100644 --- a/bindings/python/SymbolBindings.cpp +++ b/bindings/python/SymbolBindings.cpp @@ -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_(m, "ConfigBlockSymbol"); } diff --git a/docs/command-line-ref.dox b/docs/command-line-ref.dox index 7ecd6e056..c6767959e 100644 --- a/docs/command-line-ref.dox +++ b/docs/command-line-ref.dox @@ -205,9 +205,16 @@ symbols are dumped. `--top ` -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. diff --git a/docs/language-support.dox b/docs/language-support.dox index c8486c1ae..3252074d9 100644 --- a/docs/language-support.dox +++ b/docs/language-support.dox @@ -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 diff --git a/source/ast/Compilation.cpp b/source/ast/Compilation.cpp index d66312a09..113cab355 100644 --- a/source/ast/Compilation.cpp +++ b/source/ast/Compilation.cpp @@ -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 diff --git a/source/ast/symbols/CompilationUnitSymbols.cpp b/source/ast/symbols/CompilationUnitSymbols.cpp index 28f0ebdde..fca9059ed 100644 --- a/source/ast/symbols/CompilationUnitSymbols.cpp +++ b/source/ast/symbols/CompilationUnitSymbols.cpp @@ -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