From 6fcdde1aff1115a683d48235d1533a41f0ffaba5 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 5 Sep 2019 09:22:18 +0200 Subject: synth: handle non-constant array aggregates. --- src/synth/netlists-concats.ads | 2 +- src/synth/synth-context.adb | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/synth/netlists-concats.ads b/src/synth/netlists-concats.ads index 3b1e9cb93..7f3e81898 100644 --- a/src/synth/netlists-concats.ads +++ b/src/synth/netlists-concats.ads @@ -24,7 +24,7 @@ with Netlists.Builders; use Netlists.Builders; package Netlists.Concats is type Concat_Type is limited private; - -- Append net N to C. + -- Append net N to C. The first net appended will be at offset 0. procedure Append (C : in out Concat_Type; N : Net); -- Get the concatenation of all nets in C. Reset C. diff --git a/src/synth/synth-context.adb b/src/synth/synth-context.adb index 0024c3bb9..b87f9b06b 100644 --- a/src/synth/synth-context.adb +++ b/src/synth/synth-context.adb @@ -24,7 +24,9 @@ with Types; use Types; with Tables; with Types_Utils; use Types_Utils; with Vhdl.Errors; use Vhdl.Errors; + with Netlists.Builders; use Netlists.Builders; +with Netlists.Concats; with Synth.Errors; use Synth.Errors; with Synth.Expr; use Synth.Expr; @@ -410,6 +412,18 @@ package body Synth.Context is end; end if; end; + when Value_Array => + declare + use Netlists.Concats; + C : Concat_Type; + Res : Net; + begin + for I in Val.Arr.V'Range loop + Append (C, Get_Net (Val.Arr.V (I))); + end loop; + Build (Build_Context, C, Res); + return Res; + end; when others => raise Internal_Error; end case; -- cgit v1.2.3