From 714e8f8fa56a1abd238e6a9d97e7f6a4eb8e82ac Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 5 Aug 2019 07:37:38 +0200 Subject: synth: add asserts in synth-values --- src/synth/synth-values.adb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/synth/synth-values.adb b/src/synth/synth-values.adb index c6b0b1ae5..fe0785023 100644 --- a/src/synth/synth-values.adb +++ b/src/synth/synth-values.adb @@ -166,6 +166,7 @@ package body Synth.Values is subtype Value_Type_Wire is Value_Type (Values.Value_Wire); function Alloc is new Areapools.Alloc_On_Pool_Addr (Value_Type_Wire); begin + pragma Assert (Wtype /= null); return To_Value_Acc (Alloc (Current_Pool, (Kind => Value_Wire, W => W, @@ -177,6 +178,7 @@ package body Synth.Values is subtype Value_Type_Net is Value_Type (Value_Net); function Alloc is new Areapools.Alloc_On_Pool_Addr (Value_Type_Net); begin + pragma Assert (Ntype /= null); return To_Value_Acc (Alloc (Current_Pool, Value_Type_Net'(Kind => Value_Net, N => N, Typ => Ntype))); @@ -202,6 +204,7 @@ package body Synth.Values is subtype Value_Type_Discrete is Value_Type (Value_Discrete); function Alloc is new Areapools.Alloc_On_Pool_Addr (Value_Type_Discrete); begin + pragma Assert (Vtype /= null); return To_Value_Acc (Alloc (Current_Pool, (Kind => Value_Discrete, Scal => Val, Typ => Vtype))); @@ -212,6 +215,7 @@ package body Synth.Values is subtype Value_Type_Float is Value_Type (Value_Float); function Alloc is new Areapools.Alloc_On_Pool_Addr (Value_Type_Float); begin + pragma Assert (Vtype /= null); return To_Value_Acc (Alloc (Current_Pool, (Kind => Value_Float, Typ => Vtype, @@ -253,6 +257,7 @@ package body Synth.Values is Res : Value_Acc; begin + pragma Assert (Bounds /= null); Res := To_Value_Acc (Alloc (Current_Pool, (Kind => Value_Array, Arr => Arr, Typ => Bounds))); -- cgit v1.2.3