aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-06-23 15:55:28 +0200
committerTristan Gingold <tgingold@free.fr>2019-06-23 15:55:28 +0200
commitab9c1d8425d2bc4d1d8993b9004f6c36e2a646c8 (patch)
tree7c715fffc6142860a3f134c2739fc7ab03112345 /src
parentffb34fb0bdd37e4a57d66a4b4ecb095e394283df (diff)
downloadghdl-ab9c1d8425d2bc4d1d8993b9004f6c36e2a646c8.tar.gz
ghdl-ab9c1d8425d2bc4d1d8993b9004f6c36e2a646c8.tar.bz2
ghdl-ab9c1d8425d2bc4d1d8993b9004f6c36e2a646c8.zip
synth: remove unused Value_Logic.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-context.adb8
-rw-r--r--src/synth/synth-expr.adb18
-rw-r--r--src/synth/synth-values.adb10
-rw-r--r--src/synth/synth-values.ads7
4 files changed, 5 insertions, 38 deletions
diff --git a/src/synth/synth-context.adb b/src/synth/synth-context.adb
index c06f89f6b..a4b6add54 100644
--- a/src/synth/synth-context.adb
+++ b/src/synth/synth-context.adb
@@ -233,14 +233,6 @@ package body Synth.Context is
I0 => Get_Net (Val.M_F, Vtype),
I1 => Get_Net (Val.M_T, Vtype));
end;
- when Value_Logic =>
- if Val.Log_Zx = 0 then
- return Build_Const_UB32
- (Build_Context, Val.Log_Val, 1);
- else
- return Build_Const_UL32
- (Build_Context, Val.Log_Val, Val.Log_Zx, 1);
- end if;
when Value_Discrete =>
declare
Btype : constant Node := Get_Base_Type (Vtype);
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index 6c329668e..fe9f83cda 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -43,8 +43,7 @@ package body Synth.Expr is
function Is_Const (Val : Value_Acc) return Boolean is
begin
case Val.Kind is
- when Value_Logic
- | Value_Discrete =>
+ when Value_Discrete =>
return True;
when Value_Net
| Value_Wire
@@ -59,8 +58,6 @@ package body Synth.Expr is
function Get_Width (Val : Value_Acc) return Uns32 is
begin
case Val.Kind is
- when Value_Logic =>
- return 1;
when Value_Wire
| Value_Net =>
return Get_Width (Get_Net (Val, Null_Node));
@@ -69,12 +66,7 @@ package body Synth.Expr is
end case;
end Get_Width;
- function Is_Logic (Val : Value_Acc) return Boolean is
- begin
- return Val.Kind = Value_Logic;
- end Is_Logic;
-
- procedure From_Std_Logic (Enum : Int64; Val : out Uns32; Zx : out Uns32) is
+ procedure From_Std_Logic (Enum : Int64; Val : out Uns32; Zx : out Uns32) is
begin
case Enum is
when Vhdl.Ieee.Std_Logic_1164.Std_Logic_0_Pos
@@ -317,10 +309,10 @@ package body Synth.Expr is
Off := 0;
while Idx <= Val.Arr.Len
and then Off < 32
- and then Is_Logic (Val.Arr.V (Idx))
+ and then Is_Const (Val.Arr.V (Idx))
+ and then Is_Bit_Type (Etype)
loop
- B_Va := Val.Arr.V (Idx).Log_Val;
- B_Zx := Val.Arr.V (Idx).Log_Zx;
+ To_Logic (Val.Arr.V (Idx).Scal, Etype, B_Va, B_Zx);
W_Zx := W_Zx or Shift_Left (B_Zx, Off);
W_Va := W_Va or Shift_Left (B_Va, Off);
Off := Off + 1;
diff --git a/src/synth/synth-values.adb b/src/synth/synth-values.adb
index c603bdf1c..45e9cf4e6 100644
--- a/src/synth/synth-values.adb
+++ b/src/synth/synth-values.adb
@@ -64,16 +64,6 @@ package body Synth.Values is
(Kind => Value_Mux2, M_Cond => Cond, M_T => T, M_F => F)));
end Create_Value_Mux2;
- function Create_Value_Logic (Val, Zx : Uns32) return Value_Acc
- is
- subtype Value_Type_Logic is Value_Type (Value_Logic);
- function Alloc is new Areapools.Alloc_On_Pool_Addr (Value_Type_Logic);
- begin
- return To_Value_Acc
- (Alloc (Current_Pool,
- (Kind => Value_Logic, Log_Val => Val, Log_Zx => Zx)));
- end Create_Value_Logic;
-
function Create_Value_Discrete (Val : Int64) return Value_Acc
is
subtype Value_Type_Discrete is Value_Type (Value_Discrete);
diff --git a/src/synth/synth-values.ads b/src/synth/synth-values.ads
index d60484c25..01b522440 100644
--- a/src/synth/synth-values.ads
+++ b/src/synth/synth-values.ads
@@ -41,9 +41,6 @@ package Synth.Values is
Value_Mux2,
- -- A bit/logic value (boolean, bit, std_logic)
- Value_Logic,
-
-- A discrete value (integer or enumeration).
Value_Discrete,
@@ -126,9 +123,6 @@ package Synth.Values is
M_Cond : Value_Acc;
M_T : Value_Acc;
M_F : Value_Acc;
- when Value_Logic =>
- Log_Val : Uns32;
- Log_Zx : Uns32;
when Value_Discrete =>
Scal : Int64;
when Value_Float =>
@@ -171,7 +165,6 @@ package Synth.Values is
function Create_Value_Mux2 (Cond : Value_Acc; T : Value_Acc; F : Value_Acc)
return Value_Acc;
- function Create_Value_Logic (Val, Zx : Uns32) return Value_Acc;
function Create_Value_Discrete (Val : Int64) return Value_Acc;
function Create_Value_Float (Val : Fp64) return Value_Acc;