diff options
Diffstat (limited to 'src/synth/synth-expr.adb')
-rw-r--r-- | src/synth/synth-expr.adb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 6fdd413a5..4d443d999 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -43,6 +43,10 @@ with Netlists.Builders; use Netlists.Builders; with Netlists.Locations; use Netlists.Locations; package body Synth.Expr is + -- As log2(3m) is directly referenced, the program must be linked with -lm + -- (math library) on unix systems. + pragma Linker_Options ("-lm"); + function Synth_Name (Syn_Inst : Synth_Instance_Acc; Name : Node) return Value_Acc; @@ -373,7 +377,9 @@ package body Synth.Expr is end if; end loop; when Iir_Kind_Choice_By_Name => - Pos := Natural (Get_Element_Position (Get_Name (Assoc))); + Pos := Natural (Get_Element_Position + (Get_Named_Entity + (Get_Choice_Name (Assoc)))); Set_Elem (Pos); when others => Error_Msg_Synth @@ -586,7 +592,8 @@ package body Synth.Expr is case Get_Kind (Bound) is when Iir_Kind_Range_Expression => return Synth_Discrete_Range_Expression (Syn_Inst, Bound); - when Iir_Kind_Integer_Subtype_Definition => + when Iir_Kind_Integer_Subtype_Definition + | Iir_Kind_Enumeration_Subtype_Definition => if Get_Type_Declarator (Bound) /= Null_Node then -- This is a named subtype, so it has been evaluated. return Get_Value_Type (Syn_Inst, Bound).Drange; @@ -1394,6 +1401,8 @@ package body Synth.Expr is return Synth_Vec_Reduce_Monadic(Id_Red_And); when Iir_Predefined_Ieee_1164_Vector_Or_Reduce => return Synth_Vec_Reduce_Monadic(Id_Red_Or); + when Iir_Predefined_Ieee_1164_Condition_Operator => + return Operand; when others => Error_Msg_Synth (+Loc, |