@@ -176,68 +176,68 @@ exprt to_bitvector(const exprt &src)
176176
177177exprt verilog_lowering_system_function (const function_call_exprt &call)
178178{
179- auto identifier = to_symbol_expr (call.function ()).get_identifier ();
179+ auto base_name = to_verilog_identifier_expr (call.function ()).base_name ();
180180 auto &arguments = call.arguments ();
181181
182- if (identifier == " $signed" || identifier == " $unsigned" )
182+ if (base_name == " $signed" || base_name == " $unsigned" )
183183 {
184184 // lower to typecast
185185 DATA_INVARIANT (
186- arguments.size () == 1 , id2string (identifier ) + " takes one argument" );
186+ arguments.size () == 1 , id2string (base_name ) + " takes one argument" );
187187 return typecast_exprt{arguments[0 ], call.type ()};
188188 }
189- else if (identifier == " $rtoi" )
189+ else if (base_name == " $rtoi" )
190190 {
191191 DATA_INVARIANT (
192- arguments.size (), id2string (identifier ) + " takes one argument" );
192+ arguments.size (), id2string (base_name ) + " takes one argument" );
193193 // These truncate, and do not round.
194194 return floatbv_typecast_exprt{
195195 arguments[0 ],
196196 ieee_floatt::rounding_mode_expr (
197197 ieee_floatt::rounding_modet::ROUND_TO_ZERO),
198198 verilog_lowering (call.type ())};
199199 }
200- else if (identifier == " $itor" )
200+ else if (base_name == " $itor" )
201201 {
202202 DATA_INVARIANT (
203- arguments.size (), id2string (identifier ) + " takes one argument" );
203+ arguments.size (), id2string (base_name ) + " takes one argument" );
204204 // No rounding required, any 32-bit integer will fit into double.
205205 return floatbv_typecast_exprt{
206206 arguments[0 ],
207207 ieee_floatt::rounding_mode_expr (
208208 ieee_floatt::rounding_modet::ROUND_TO_ZERO),
209209 verilog_lowering (call.type ())};
210210 }
211- else if (identifier == " $bitstoreal" )
211+ else if (base_name == " $bitstoreal" )
212212 {
213213 DATA_INVARIANT (
214- arguments.size (), id2string (identifier ) + " takes one argument" );
214+ arguments.size (), id2string (base_name ) + " takes one argument" );
215215 // not a conversion -- this returns the given bit-pattern as a real
216216 return typecast_exprt{
217217 zero_extend_exprt{arguments[0 ], bv_typet{64 }},
218218 verilog_lowering (call.type ())};
219219 }
220- else if (identifier == " $bitstoshortreal" )
220+ else if (base_name == " $bitstoshortreal" )
221221 {
222222 DATA_INVARIANT (
223- arguments.size (), id2string (identifier ) + " takes one argument" );
223+ arguments.size (), id2string (base_name ) + " takes one argument" );
224224 // not a conversion -- this returns the given bit-pattern as a real
225225 return typecast_exprt{
226226 zero_extend_exprt{arguments[0 ], bv_typet{32 }},
227227 verilog_lowering (call.type ())};
228228 }
229- else if (identifier == " $realtobits" )
229+ else if (base_name == " $realtobits" )
230230 {
231231 DATA_INVARIANT (
232- arguments.size (), id2string (identifier ) + " takes one argument" );
232+ arguments.size (), id2string (base_name ) + " takes one argument" );
233233 // not a conversion -- this returns the given floating-point bit-pattern as [63:0]
234234 return zero_extend_exprt{
235235 typecast_exprt{arguments[0 ], bv_typet{64 }}, call.type ()};
236236 }
237- else if (identifier == " $shortrealtobits" )
237+ else if (base_name == " $shortrealtobits" )
238238 {
239239 DATA_INVARIANT (
240- arguments.size (), id2string (identifier ) + " takes one argument" );
240+ arguments.size (), id2string (base_name ) + " takes one argument" );
241241 // not a conversion -- this returns the given floating-point bit-pattern as [31:0]
242242 return zero_extend_exprt{
243243 typecast_exprt{arguments[0 ], bv_typet{32 }}, call.type ()};
@@ -350,8 +350,8 @@ exprt verilog_lowering(exprt expr)
350350 auto &call = to_function_call_expr (expr);
351351 if (call.is_system_function_call ())
352352 {
353- auto identifier = to_symbol_expr (call.function ()).get_identifier ();
354- if (identifier == " $typename" )
353+ auto base_name = to_verilog_identifier_expr (call.function ()).base_name ();
354+ if (base_name == " $typename" )
355355 {
356356 // Don't touch.
357357 // Will be expanded by elaborate_constant_system_function_call,
0 commit comments