aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-09-30 06:53:59 +0200
committerTristan Gingold <tgingold@free.fr>2022-09-30 06:53:59 +0200
commitfe092cdc810cc559ed484f480d2072c43513a04a (patch)
tree7e5b9067e46e6d6f40fb64601b44527cb640de17 /src/synth
parent3e23191c0ec808b588b11989b75985dc4ba1cfb1 (diff)
downloadghdl-fe092cdc810cc559ed484f480d2072c43513a04a.tar.gz
ghdl-fe092cdc810cc559ed484f480d2072c43513a04a.tar.bz2
ghdl-fe092cdc810cc559ed484f480d2072c43513a04a.zip
synth: factorize code
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/synth-vhdl_stmts.adb9
1 files changed, 1 insertions, 8 deletions
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;