diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/simul/simul-vhdl_simul.adb | 8 | ||||
| -rw-r--r-- | src/synth/synth-vhdl_stmts.adb | 9 | 
2 files changed, 9 insertions, 8 deletions
| diff --git a/src/simul/simul-vhdl_simul.adb b/src/simul/simul-vhdl_simul.adb index 3eb3d2eed..0a07fc08b 100644 --- a/src/simul/simul-vhdl_simul.adb +++ b/src/simul/simul-vhdl_simul.adb @@ -1034,6 +1034,14 @@ package body Simul.Vhdl_Simul is                    Ch := Synth_Expression (Inst, Get_Choice_Expression (Sw));                    Eq := Is_Equal (Sel, Get_Memtyp (Ch));                 end; +            when Iir_Kind_Choice_By_Range => +               declare +                  Bnd : Discrete_Range_Type; +               begin +                  Elab.Vhdl_Types.Synth_Discrete_Range +                    (Inst, Get_Choice_Range (Sw), Bnd); +                  Eq := In_Range (Bnd, Read_Discrete (Sel)); +               end;              when Iir_Kind_Choice_By_Others =>                 Eq := True;              when others => diff --git a/src/synth/synth-vhdl_stmts.adb b/src/synth/synth-vhdl_stmts.adb index d53773ded..7b13214d2 100644 --- a/src/synth/synth-vhdl_stmts.adb +++ b/src/synth/synth-vhdl_stmts.adb @@ -1610,16 +1610,9 @@ package body Synth.Vhdl_Stmts is              when Iir_Kind_Choice_By_Range =>                 declare                    Bnd : Discrete_Range_Type; -                  Is_In : Boolean;                 begin                    Synth_Discrete_Range (Inst, Get_Choice_Range (Choice), Bnd); -                  case Bnd.Dir is -                     when Dir_To => -                        Is_In := Sel >= Bnd.Left and Sel <= Bnd.Right; -                     when Dir_Downto => -                        Is_In := Sel <= Bnd.Left and Sel >= Bnd.Right; -                  end case; -                  if Is_In then +                  if In_Range (Bnd, Sel) then                       return Stmts;                    end if;                 end; | 
