File tree Expand file tree Collapse file tree 3 files changed +20
-11
lines changed
Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,20 @@ typet verilog_declaratort::merged_type(const typet &declaration_type) const
5050 return result;
5151}
5252
53+ static bool is_system_function_identifier (const exprt &function)
54+ {
55+ return function.id () == ID_symbol &&
56+ has_prefix (id2string (to_symbol_expr (function).get_identifier ()), " $" );
57+ }
58+
5359bool function_call_exprt::is_system_function_call () const
5460{
55- return function ().id () == ID_symbol &&
56- has_prefix (
57- id2string (to_symbol_expr (function ()).get_identifier ()), " $" );
61+ return is_system_function_identifier (function ());
62+ }
63+
64+ bool verilog_function_callt::is_system_function_call () const
65+ {
66+ return is_system_function_identifier (function ());
5867}
5968
6069void verilog_module_sourcet::show (std::ostream &out) const
Original file line number Diff line number Diff line change @@ -1443,6 +1443,7 @@ inline verilog_ift &to_verilog_if(exprt &expr)
14431443 return static_cast <verilog_ift &>(expr);
14441444}
14451445
1446+ // / task or function enable
14461447class verilog_function_callt :public verilog_statementt
14471448{
14481449public:
@@ -1460,7 +1461,9 @@ class verilog_function_callt:public verilog_statementt
14601461 {
14611462 return op0 ();
14621463 }
1463-
1464+
1465+ bool is_system_function_call () const ;
1466+
14641467 exprt::operandst &arguments ()
14651468 {
14661469 return op1 ().operands ();
Original file line number Diff line number Diff line change @@ -869,17 +869,14 @@ Function: verilog_typecheckt::convert_function_call_or_task_enable
869869void verilog_typecheckt::convert_function_call_or_task_enable (
870870 verilog_function_callt &statement)
871871{
872- irep_idt base_name=
873- to_symbol_expr (statement.function ()).get_identifier ();
874-
875- // We ignore everyting that starts with a '$',
876- // e.g., $display etc
877-
878- if (!base_name.empty () && base_name[0 ]==' $' )
872+ if (statement.is_system_function_call ())
879873 {
874+ // we ignore all of these
880875 }
881876 else
882877 {
878+ irep_idt base_name = to_symbol_expr (statement.function ()).get_identifier ();
879+
883880 // look it up
884881 const irep_idt full_identifier =
885882 id2string (module_identifier) + " ." + id2string (base_name);
You can’t perform that action at this time.
0 commit comments