Skip to content

Commit e0652c8

Browse files
author
Rafal Kapuscik
committed
Check for separate compilation before annotating
Signed-off-by: Rafal Kapuscik <[email protected]>
1 parent 0bc0d89 commit e0652c8

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

systemverilog-plugin/uhdmsurelogastfrontend.cc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@ struct UhdmSurelogAstFrontend : public UhdmCommonFrontend {
131131
}
132132
}
133133

134-
UHDM::Serializer serializer;
135-
UHDM::SynthSubset *synthSubset = new UHDM::SynthSubset(&serializer, this->shared.nonSynthesizableObjects, false);
136-
synthSubset->listenDesigns(uhdm_design);
137-
delete synthSubset;
138-
139134
SURELOG::shutdown_compiler(compiler);
140135
delete clp;
141136
delete symbolTable;
@@ -148,6 +143,17 @@ struct UhdmSurelogAstFrontend : public UhdmCommonFrontend {
148143
UhdmAst uhdm_ast(this->shared);
149144
if (this->shared.defer && !this->shared.link)
150145
return nullptr;
146+
147+
// FIXME: SynthSubset annotation is incompatible with separate compilation
148+
// `-defer` turns elaboration off, so check for it
149+
// Should be called 1. for normal flow 2. after finishing with `-link`
150+
if (!this->shared.defer) {
151+
UHDM::Serializer serializer;
152+
UHDM::SynthSubset *synthSubset = new UHDM::SynthSubset(&serializer, this->shared.nonSynthesizableObjects, false);
153+
synthSubset->listenDesigns(uhdm_design);
154+
delete synthSubset;
155+
}
156+
151157
AST::AstNode *current_ast = uhdm_ast.visit_designs(uhdm_design);
152158
if (!this->report_directory.empty()) {
153159
this->shared.report.write(this->report_directory);

0 commit comments

Comments
 (0)