From 10b2f5a4012ae368dfcf49628281e34674f913d7 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 30 Jun 2019 13:45:32 +0200 Subject: synth: handle 2 states fsms. --- src/synth/synth-stmts.adb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb index 2f2b85fe6..7ac5053e2 100644 --- a/src/synth/synth-stmts.adb +++ b/src/synth/synth-stmts.adb @@ -526,7 +526,11 @@ package body Synth.Stmts is -- If the width is not a multiple of 2, handle the last level. if Wd mod 2 = 1 then - Sub_Sel := Build_Extract_Bit (Build_Context, Sel, Wd - 1); + if Wd = 1 then + Sub_Sel := Sel; + else + Sub_Sel := Build_Extract_Bit (Build_Context, Sel, Wd - 1); + end if; Iels := Els'First; Oels := Els'First; while Iels <= Lels loop -- cgit v1.2.3