From 5683e56f38579d0094a23a0ec4d74280415a67af Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 10 Jan 2015 08:26:55 +0100 Subject: sdf annotation: handle tremoval, handle negative values. From Kim Taylor. --- src/grt/grt-sdf.adb | 21 ++++++++++++++++++++- src/grt/grt-sdf.ads | 1 + src/grt/grt-vital_annotate.adb | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) (limited to 'src/grt') diff --git a/src/grt/grt-sdf.adb b/src/grt/grt-sdf.adb index 73534e3..67f2f64 100644 --- a/src/grt/grt-sdf.adb +++ b/src/grt/grt-sdf.adb @@ -231,8 +231,10 @@ package body Grt.Sdf is function Scan_Number return Sdf_Token_Type is Has_Dot : Boolean; + Is_Negative : Boolean; begin Has_Dot := False; + Is_Negative := False; Scan_Int := 0; Scan_Exp := 0; loop @@ -252,6 +254,14 @@ package body Grt.Sdf is Has_Dot := True; end if; Pos := Pos + 1; + when '-' => + if Is_Negative then + Error_Bad_Character; + return Tok_Error; + else + Is_Negative := True; + end if; + Pos := Pos + 1; when EOT => if Pos /= Buf_Len then Error_Bad_Character; @@ -264,6 +274,9 @@ package body Grt.Sdf is exit; end case; end loop; + if Is_Negative then + Scan_Int := -Scan_Int; + end if; if Has_Dot then return Tok_Rnumber; else @@ -385,7 +398,8 @@ package body Grt.Sdf is | 'A' .. 'Z' => Scan_Identifier; return Tok_Identifier; - when '0' .. '9' => + when '0' .. '9' + | '-' => return Scan_Number; when others => Error_Bad_Character; @@ -972,6 +986,8 @@ package body Grt.Sdf is Start ("tsetup"); when Timingcheck_Recovery => Start ("trecovery"); + when Timingcheck_Removal => + Start ("tremoval"); when Timingcheck_Skew => Start ("tskew"); when Timingcheck_Width => @@ -1280,6 +1296,8 @@ package body Grt.Sdf is Start_Generic_Name (Timingcheck_Setuphold); elsif Is_Ident ("RECOVERY") then Start_Generic_Name (Timingcheck_Recovery); + elsif Is_Ident ("REMOVAL") then + Start_Generic_Name (Timingcheck_Removal); elsif Is_Ident ("SKEW") then Start_Generic_Name (Timingcheck_Skew); elsif Is_Ident ("WIDTH") then @@ -1304,6 +1322,7 @@ package body Grt.Sdf is when Timingcheck_Setup | Timingcheck_Hold | Timingcheck_Recovery + | Timingcheck_Removal | Timingcheck_Skew | Timingcheck_Setuphold | Timingcheck_Nochange => diff --git a/src/grt/grt-sdf.ads b/src/grt/grt-sdf.ads index fd05b9e..096f7c0 100644 --- a/src/grt/grt-sdf.ads +++ b/src/grt/grt-sdf.ads @@ -54,6 +54,7 @@ package Grt.Sdf is Timingcheck_Setup, Timingcheck_Hold, Timingcheck_Recovery, + Timingcheck_Removal, Timingcheck_Skew, Timingcheck_Nochange, Timingcheck_Setuphold diff --git a/src/grt/grt-vital_annotate.adb b/src/grt/grt-vital_annotate.adb index 93ecb81..3ff0890 100644 --- a/src/grt/grt-vital_annotate.adb +++ b/src/grt/grt-vital_annotate.adb @@ -432,6 +432,7 @@ package body Grt.Vital_Annotate is if Vhpi_Compare_Handles (Gen_Basetype, VitalDelayType01) or else Vhpi_Compare_Handles (Gen_Basetype, VitalDelayType01Z) or else Vhpi_Compare_Handles (Gen_Basetype, VitalDelayType01ZX) + or else Vhpi_Compare_Handles (Gen_Basetype, VitalDelayType) then Ok := Write_Td_Delay_Generic (Context, Gen); elsif Vhpi_Compare_Handles (Gen_Basetype, VitalDelayArrayType01) -- cgit