aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-28 20:44:40 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-28 20:44:40 +0200
commit2068fb5a9eba5da625d2dd73fdcb47755487d9f3 (patch)
tree4e0d0be6b65e6e5f73b6db3243f802e137cab6f2 /src/synth
parent81e426a6d34e71c9f171673d33fcf16c250f060e (diff)
downloadghdl-2068fb5a9eba5da625d2dd73fdcb47755487d9f3.tar.gz
ghdl-2068fb5a9eba5da625d2dd73fdcb47755487d9f3.tar.bz2
ghdl-2068fb5a9eba5da625d2dd73fdcb47755487d9f3.zip
synth: remove extract_bound (trivial).
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/synth-decls.adb2
-rw-r--r--src/synth/synth-expr.adb10
-rw-r--r--src/synth/synth-stmts.adb2
-rw-r--r--src/synth/synth-values.adb5
-rw-r--r--src/synth/synth-values.ads2
5 files changed, 6 insertions, 15 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb
index 7f3afb623..ee9f49fa4 100644
--- a/src/synth/synth-decls.adb
+++ b/src/synth/synth-decls.adb
@@ -165,6 +165,8 @@ package body Synth.Decls is
Typ := Create_Float_Type (Rng);
Create_Object (Syn_Inst, Def, Create_Value_Subtype (Typ));
end;
+ when Iir_Kind_Array_Type_Definition =>
+ Synth_Array_Type_Definition (Syn_Inst, Def);
when others =>
Error_Kind ("synth_anonymous_type_definition", Def);
end case;
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index 21511e615..37e9a8a44 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -1120,9 +1120,8 @@ package body Synth.Expr is
function Index_To_Offset (Pfx : Value_Acc; Idx : Int64; Loc : Node)
return Uns32
is
- Rng : Type_Acc;
+ Rng : constant Type_Acc := Pfx.Typ;
begin
- Rng := Extract_Bound (Pfx);
if not In_Bounds (Rng.Vbound, Int32 (Idx)) then
Error_Msg_Synth (+Loc, "index not within bounds");
return 0;
@@ -1140,12 +1139,10 @@ package body Synth.Expr is
function Dyn_Index_To_Offset (Pfx : Value_Acc; Idx : Net; Loc : Node)
return Net
is
- Bnd : Type_Acc;
+ Bnd : constant Type_Acc := Pfx.Typ;
Off : Net;
Right : Net;
begin
- Bnd := Extract_Bound (Pfx);
-
-- TODO: handle width.
Right := Build_Const_UB32
(Build_Context, To_Uns32 (Bnd.Vbound.Right), 32);
@@ -1444,7 +1441,7 @@ package body Synth.Expr is
is
Pfx_Node : constant Node := Get_Prefix (Name);
Pfx : constant Value_Acc := Synth_Expression (Syn_Inst, Pfx_Node);
- Bnd : Type_Acc;
+ Bnd : constant Type_Acc := Pfx.Typ;
Res_Bnd : Type_Acc;
Inp : Net;
Step : Uns32;
@@ -1452,7 +1449,6 @@ package body Synth.Expr is
Wd : Uns32;
N : Net;
begin
- Bnd := Extract_Bound (Pfx);
Synth_Slice_Suffix (Syn_Inst, Name, Bnd, Res_Bnd, Inp, Step, Off, Wd);
if Inp /= No_Net then
N := Build_Dyn_Extract (Build_Context, Get_Net (Pfx),
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index f9494725d..3d779f54c 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -174,7 +174,7 @@ package body Synth.Stmts is
-- Only support assignment of vector.
raise Internal_Error;
end if;
- Synth_Slice_Suffix (Syn_Inst, Target, Extract_Bound (Targ),
+ Synth_Slice_Suffix (Syn_Inst, Target, Targ.Typ,
Res_Bnd, Inp, Step, Off, Wd);
Targ_Net := Get_Last_Assigned_Value (Targ.W);
V := Get_Net (Val);
diff --git a/src/synth/synth-values.adb b/src/synth/synth-values.adb
index c10afaf73..699705977 100644
--- a/src/synth/synth-values.adb
+++ b/src/synth/synth-values.adb
@@ -328,11 +328,6 @@ package body Synth.Values is
return Res;
end Unshare;
- function Extract_Bound (Val : Value_Acc) return Type_Acc is
- begin
- return Val.Typ;
- end Extract_Bound;
-
function Get_Type_Width (Atype : Type_Acc) return Width is
begin
case Atype.Kind is
diff --git a/src/synth/synth-values.ads b/src/synth/synth-values.ads
index 1a7e5df48..f754c73be 100644
--- a/src/synth/synth-values.ads
+++ b/src/synth/synth-values.ads
@@ -237,8 +237,6 @@ package Synth.Values is
function Unshare (Src : Value_Acc; Pool : Areapool_Acc)
return Value_Acc;
- function Extract_Bound (Val : Value_Acc) return Type_Acc;
-
function Get_Type_Width (Atype : Type_Acc) return Width;
procedure Init;