aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-24 08:29:35 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-24 08:29:35 +0200
commit121b6579b633d814e27980e1c48c46582276885e (patch)
treea2a29131a6a458c0348e0ff8ea2b8823f632a2ed
parenta679e4d670f2dfea33753e03fdbff1d223f3034b (diff)
downloadghdl-121b6579b633d814e27980e1c48c46582276885e.tar.gz
ghdl-121b6579b633d814e27980e1c48c46582276885e.tar.bz2
ghdl-121b6579b633d814e27980e1c48c46582276885e.zip
synth: fix bad ordering in case statement.
-rw-r--r--src/synth/synth-stmts.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index d4a677f63..315944e37 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -498,6 +498,7 @@ package body Synth.Stmts is
-- Handle SEL bits by 2, so group case_element by 4.
for I in 1 .. Natural (Wd / 2) loop
+ -- Extract 2 bits from the selector.
Sub_Sel := Build_Extract (Build_Context,
Sel, Width (2 * (I - 1)), 2);
Mask := Shift_Left (not 0, Natural (2 * I));
@@ -672,7 +673,7 @@ package body Synth.Stmts is
case Get_Kind (Choice) is
when Iir_Kind_Choice_By_Expression =>
Choice_Idx := Choice_Idx + 1;
- Annex_Arr (Choice_Idx) := Int32 (Alt_Idx);
+ Annex_Arr (Choice_Idx) := Int32 (Choice_Idx);
declare
Choice_Expr : constant Node :=
Get_Choice_Expression (Choice);
@@ -830,7 +831,7 @@ package body Synth.Stmts is
case Get_Kind (Choice) is
when Iir_Kind_Choice_By_Expression =>
Choice_Idx := Choice_Idx + 1;
- Annex_Arr (Choice_Idx) := Int32 (Alt_Idx);
+ Annex_Arr (Choice_Idx) := Int32 (Choice_Idx);
declare
Choice_Expr : constant Node :=
Get_Choice_Expression (Choice);