aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/evaluation.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-02-10 04:58:49 +0100
committerTristan Gingold <tgingold@free.fr>2016-02-10 07:52:53 +0100
commit8f82f32b357d5c5a9211d677b11297022336b038 (patch)
tree9e1f8e144ca464b36ead5e66bd4293aeb76d9469 /src/vhdl/evaluation.adb
parent1db60a0e91a18ddcc7c4d0c08e5c07adc8c59831 (diff)
downloadghdl-8f82f32b357d5c5a9211d677b11297022336b038.tar.gz
ghdl-8f82f32b357d5c5a9211d677b11297022336b038.tar.bz2
ghdl-8f82f32b357d5c5a9211d677b11297022336b038.zip
simul: handle generic override.
Diffstat (limited to 'src/vhdl/evaluation.adb')
-rw-r--r--src/vhdl/evaluation.adb22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/vhdl/evaluation.adb b/src/vhdl/evaluation.adb
index 8f93d379d..850691045 100644
--- a/src/vhdl/evaluation.adb
+++ b/src/vhdl/evaluation.adb
@@ -2177,7 +2177,6 @@ package body Evaluation is
when Iir_Kind_Value_Attribute =>
declare
Param : Iir;
- Param_Type : Iir;
begin
Param := Get_Parameter (Expr);
Param := Eval_Static_Expr (Param);
@@ -2187,25 +2186,8 @@ package body Evaluation is
Warning_Msg_Sem ("'value argument not a string", Expr);
return Build_Overflow (Expr);
else
- -- what type are we converting the string to?
- Param_Type := Get_Base_Type (Get_Type (Expr));
- declare
- Value : constant String := Image_String_Lit (Param);
- begin
- case Get_Kind (Param_Type) is
- when Iir_Kind_Integer_Type_Definition =>
- return Build_Discrete (Iir_Int64'Value (Value), Expr);
- when Iir_Kind_Enumeration_Type_Definition =>
- return Build_Enumeration_Value (Value, Param_Type,
- Expr);
- when Iir_Kind_Floating_Type_Definition =>
- return Build_Floating (Iir_Fp64'value (Value), Expr);
- when Iir_Kind_Physical_Type_Definition =>
- return Build_Physical_Value (Value, Param_Type, Expr);
- when others =>
- Error_Kind ("eval_static_expr('value)", Param);
- end case;
- end;
+ return Eval_Value_Attribute
+ (Image_String_Lit (Param), Get_Type (Expr), Expr);
end if;
end;