diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-10-20 21:41:20 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-10-20 21:41:20 +0200 |
commit | dbdfc99deb03b86e1d2f2b4a8a27e63fa279caab (patch) | |
tree | 088334005c1884926ce143dd766e7668232b77bc /src | |
parent | 9afe3137ceadd3bbd72351b7826bd196ba4b973b (diff) | |
download | ghdl-dbdfc99deb03b86e1d2f2b4a8a27e63fa279caab.tar.gz ghdl-dbdfc99deb03b86e1d2f2b4a8a27e63fa279caab.tar.bz2 ghdl-dbdfc99deb03b86e1d2f2b4a8a27e63fa279caab.zip |
synth: fixes for value_const.
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/synth-context.adb | 5 | ||||
-rw-r--r-- | src/synth/synth-expr.adb | 6 |
2 files changed, 11 insertions, 0 deletions
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); |