aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/synth/elab-vhdl_decls.adb2
-rw-r--r--src/synth/synth-vhdl_decls.adb3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/synth/elab-vhdl_decls.adb b/src/synth/elab-vhdl_decls.adb
index f8a82be14..897705e37 100644
--- a/src/synth/elab-vhdl_decls.adb
+++ b/src/synth/elab-vhdl_decls.adb
@@ -138,7 +138,7 @@ package body Elab.Vhdl_Decls is
Init := Exec_Expression_With_Type (Syn_Inst, Def, Obj_Typ);
Init := Exec_Subtype_Conversion (Init, Obj_Typ, False, Decl);
else
- Init := No_Valtyp;
+ Init := (Typ => Obj_Typ, Val => null);
end if;
Create_Object (Syn_Inst, Decl, Init);
end Elab_Variable_Declaration;
diff --git a/src/synth/synth-vhdl_decls.adb b/src/synth/synth-vhdl_decls.adb
index c7ab62d8e..8d38eaaff 100644
--- a/src/synth/synth-vhdl_decls.adb
+++ b/src/synth/synth-vhdl_decls.adb
@@ -429,6 +429,9 @@ package body Synth.Vhdl_Decls is
Val : Valtyp;
begin
Init := Get_Value (Syn_Inst, Decl);
+ if Init.Val = null then
+ Init := Create_Value_Default (Init.Typ);
+ end if;
Val := Create_Var_Wire (Syn_Inst, Decl, Wire_Variable, Init);
Mutate_Object (Syn_Inst, Decl, Val);