From 71ff56302baff001ea7d491a486143f0229a289b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 11 Apr 2020 11:34:19 +0200 Subject: vhdl: handle pragma synthesis_on/synthesis_off. --- src/std_names.adb | 2 ++ src/std_names.ads | 4 +++- src/vhdl/vhdl-scanner.adb | 16 +++++++++------- 3 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/std_names.adb b/src/std_names.adb index ece86763f..056a77bf3 100644 --- a/src/std_names.adb +++ b/src/std_names.adb @@ -790,6 +790,8 @@ package body Std_Names is Def ("translate_off", Name_Translate_Off); Def ("translate_on", Name_Translate_On); Def ("translate", Name_Translate); + Def ("synthesis_off", Name_Synthesis_Off); + Def ("synthesis_on", Name_Synthesis_On); Def ("off", Name_Off); -- PSL keywords diff --git a/src/std_names.ads b/src/std_names.ads index 6ed7fb6d5..a736377b7 100644 --- a/src/std_names.ads +++ b/src/std_names.ads @@ -919,7 +919,9 @@ package Std_Names is Name_Translate_Off : constant Name_Id := Name_First_Comment + 4; Name_Translate_On : constant Name_Id := Name_First_Comment + 5; Name_Translate : constant Name_Id := Name_First_Comment + 6; - Name_Off : constant Name_Id := Name_First_Comment + 7; + Name_Synthesis_Off : constant Name_Id := Name_First_Comment + 7; + Name_Synthesis_On : constant Name_Id := Name_First_Comment + 8; + Name_Off : constant Name_Id := Name_First_Comment + 9; Name_Last_Comment : constant Name_Id := Name_Off; -- PSL words. diff --git a/src/vhdl/vhdl-scanner.adb b/src/vhdl/vhdl-scanner.adb index 214edc280..dc3cc2be0 100644 --- a/src/vhdl/vhdl-scanner.adb +++ b/src/vhdl/vhdl-scanner.adb @@ -1847,16 +1847,18 @@ package body Vhdl.Scanner is (Warnid_Pragma, "pragma translate must be followed by 'on' or 'off'"); end case; - when Name_Translate_Off => + when Name_Translate_Off + | Name_Synthesis_Off => Scan_Translate_Off; - when Name_Translate_On => + when Name_Translate_On + | Name_Synthesis_On => Scan_Translate_On; when Name_Label - | Name_Label_Applies_To - | Name_Return_Port_Name - | Name_Map_To_Operator - | Name_Type_Function - | Name_Built_In => + | Name_Label_Applies_To + | Name_Return_Port_Name + | Name_Map_To_Operator + | Name_Type_Function + | Name_Built_In => -- Used by synopsys, discarded. Skip_Until_EOL; when others => -- cgit v1.2.3