From dbdfc99deb03b86e1d2f2b4a8a27e63fa279caab Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 20 Oct 2019 21:41:20 +0200 Subject: synth: fixes for value_const. --- src/synth/synth-context.adb | 5 +++++ src/synth/synth-expr.adb | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/synth/synth-context.adb b/src/synth/synth-context.adb index 726406f6d..7786de669 100644 --- a/src/synth/synth-context.adb +++ b/src/synth/synth-context.adb @@ -389,6 +389,11 @@ package body Synth.Context is Off : in out Uns32; Has_Zx : in out Boolean) is begin + if Val.Kind = Value_Const then + Value2net (Val.C_Val, Vec, Off, Has_Zx); + return; + end if; + case Val.Typ.Kind is when Type_Bit => declare diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 9be6d5182..b5e54c12c 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -55,6 +55,8 @@ package body Synth.Expr is case V.Kind is when Value_Discrete => return V.Scal; + when Value_Const => + return V.C_Val.Scal; when Value_Net => N := V.N; when Value_Wire => @@ -737,6 +739,8 @@ package body Synth.Expr is return Create_Value_Net (N, Dtype); when Value_Discrete => return Create_Value_Discrete (Val.Scal, Dtype); + when Value_Const => + return Create_Value_Discrete (Val.C_Val.Scal, Dtype); when others => raise Internal_Error; end case; @@ -745,6 +749,8 @@ package body Synth.Expr is case Val.Kind is when Value_Discrete => return Create_Value_Discrete (Val.Scal, Dtype); + when Value_Const => + return Create_Value_Discrete (Val.C_Val.Scal, Dtype); when Value_Net | Value_Wire => N := Get_Net (Val); -- cgit v1.2.3