Skip to content

Commit e765ef2

Browse files
committed
SVA: use declaration for sequence and property symbols
SVA named sequences and properties are now stored using the full declaration, to enable support for ports.
1 parent 79dc900 commit e765ef2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/verilog/verilog_synthesis.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ exprt verilog_synthesist::synth_expr_rec(exprt expr, symbol_statet symbol_state)
7575
{
7676
auto &instance = to_sva_sequence_property_instance_expr(expr);
7777
const symbolt &symbol = ns.lookup(instance.symbol());
78-
return synth_expr(symbol.value, symbol_state);
78+
auto &declaration =
79+
to_verilog_sequence_property_declaration_base(symbol.value);
80+
return synth_expr(declaration.cond(), symbol_state);
7981
}
8082
else if(expr.id() == ID_hierarchical_identifier)
8183
{

src/verilog/verilog_typecheck.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,14 +1805,14 @@ void verilog_typecheckt::convert_property_declaration(
18051805
convert_sva(declaration.property());
18061806
require_sva_property(declaration.property());
18071807

1808+
// The symbol uses the full declaration as value
18081809
auto type = verilog_sva_property_typet{};
18091810
symbolt symbol{full_identifier, type, mode};
18101811

18111812
symbol.module = module_identifier;
18121813
symbol.base_name = base_name;
18131814
symbol.pretty_name = strip_verilog_prefix(symbol.name);
1814-
symbol.is_macro = true;
1815-
symbol.value = declaration.cond();
1815+
symbol.value = declaration;
18161816
symbol.location = declaration.source_location();
18171817

18181818
add_symbol(std::move(symbol));
@@ -1840,13 +1840,13 @@ void verilog_typecheckt::convert_sequence_declaration(
18401840
convert_sva(sequence);
18411841
require_sva_sequence(sequence);
18421842

1843+
// The symbol uses the full declaration as value
18431844
symbolt symbol{full_identifier, sequence.type(), mode};
18441845

18451846
symbol.module = module_identifier;
18461847
symbol.base_name = base_name;
18471848
symbol.pretty_name = strip_verilog_prefix(symbol.name);
1848-
symbol.is_macro = true;
1849-
symbol.value = declaration.sequence();
1849+
symbol.value = declaration;
18501850
symbol.location = declaration.source_location();
18511851

18521852
add_symbol(std::move(symbol));

0 commit comments

Comments
 (0)