aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristos Gentsos <christos.gentsos@cern.ch>2019-06-06 13:58:57 +0200
committerTristan Gingold <tgingold@free.fr>2019-06-06 19:06:49 +0200
commitcf86026d150c01cd6d8bf9a70975157f1a01e197 (patch)
tree0a55dabfecd463e7bdddcfee5e9825dadfd9de6f /src
parentbec60c58f045c667f3656a00bf0aeb0261c45d6f (diff)
downloadghdl-cf86026d150c01cd6d8bf9a70975157f1a01e197.tar.gz
ghdl-cf86026d150c01cd6d8bf9a70975157f1a01e197.tar.bz2
ghdl-cf86026d150c01cd6d8bf9a70975157f1a01e197.zip
synth: handle numeric_std unsigned - unsigned add and sub
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-expr.adb22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index 7dd855f97..74ca80a01 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -493,6 +493,17 @@ package body Synth.Expr is
Synth_Uresize (Right, Get_Width (Left))),
Create_Res_Range (Left, L));
end;
+ when Iir_Predefined_Ieee_Numeric_Std_Add_Uns_Uns =>
+ -- "+" (Unsigned, Unsigned)
+ -- FIXME: are they of the same width ?
+ declare
+ L : constant Net := Get_Net (Left);
+ begin
+ return Create_Value_Net
+ (Build_Dyadic (Build_Context, Id_Add,
+ L, Get_Net (Right)),
+ Create_Res_Range (Left, L));
+ end;
when Iir_Predefined_Ieee_Numeric_Std_Sub_Uns_Nat =>
-- "-" (Unsigned, Natural)
declare
@@ -504,6 +515,17 @@ package body Synth.Expr is
Synth_Uresize (Right, Get_Width (Left))),
Create_Res_Range (Left, L));
end;
+ when Iir_Predefined_Ieee_Numeric_Std_Sub_Uns_Uns =>
+ -- "-" (Unsigned, Unsigned)
+ -- FIXME: like above
+ declare
+ L : constant Net := Get_Net (Left);
+ begin
+ return Create_Value_Net
+ (Build_Dyadic (Build_Context, Id_Sub,
+ L, Get_Net (Right)),
+ Create_Res_Range (Left, L));
+ end;
when Iir_Predefined_Ieee_Numeric_Std_Eq_Uns_Nat =>
-- "=" (Unsigned, Natural)
return Create_Value_Net