diff options
-rw-r--r-- | python/libghdl/thin/vhdl/nodes.py | 162 | ||||
-rw-r--r-- | src/synth/synth-expr.adb | 3 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.ads | 57 |
3 files changed, 116 insertions, 106 deletions
diff --git a/python/libghdl/thin/vhdl/nodes.py b/python/libghdl/thin/vhdl/nodes.py index 1df7f9445..dd79111ce 100644 --- a/python/libghdl/thin/vhdl/nodes.py +++ b/python/libghdl/thin/vhdl/nodes.py @@ -1274,87 +1274,87 @@ class Iir_Predefined: Ieee_Numeric_Std_Ne_Sgn_Sgn = 296 Ieee_Numeric_Std_Ne_Sgn_Int = 297 Ieee_Numeric_Std_Ne_Int_Sgn = 298 - Ieee_Numeric_Std_Min_Uns_Uns = 299 - Ieee_Numeric_Std_Min_Uns_Nat = 300 - Ieee_Numeric_Std_Min_Nat_Uns = 301 - Ieee_Numeric_Std_Min_Sgn_Sgn = 302 - Ieee_Numeric_Std_Min_Sgn_Int = 303 - Ieee_Numeric_Std_Min_Int_Sgn = 304 - Ieee_Numeric_Std_Max_Uns_Uns = 305 - Ieee_Numeric_Std_Max_Uns_Nat = 306 - Ieee_Numeric_Std_Max_Nat_Uns = 307 - Ieee_Numeric_Std_Max_Sgn_Sgn = 308 - Ieee_Numeric_Std_Max_Sgn_Int = 309 - Ieee_Numeric_Std_Max_Int_Sgn = 310 - Ieee_Numeric_Std_Match_Gt_Uns_Uns = 311 - Ieee_Numeric_Std_Match_Gt_Uns_Nat = 312 - Ieee_Numeric_Std_Match_Gt_Nat_Uns = 313 - Ieee_Numeric_Std_Match_Gt_Sgn_Sgn = 314 - Ieee_Numeric_Std_Match_Gt_Sgn_Int = 315 - Ieee_Numeric_Std_Match_Gt_Int_Sgn = 316 - Ieee_Numeric_Std_Match_Lt_Uns_Uns = 317 - Ieee_Numeric_Std_Match_Lt_Uns_Nat = 318 - Ieee_Numeric_Std_Match_Lt_Nat_Uns = 319 - Ieee_Numeric_Std_Match_Lt_Sgn_Sgn = 320 - Ieee_Numeric_Std_Match_Lt_Sgn_Int = 321 - Ieee_Numeric_Std_Match_Lt_Int_Sgn = 322 - Ieee_Numeric_Std_Match_Le_Uns_Uns = 323 - Ieee_Numeric_Std_Match_Le_Uns_Nat = 324 - Ieee_Numeric_Std_Match_Le_Nat_Uns = 325 - Ieee_Numeric_Std_Match_Le_Sgn_Sgn = 326 - Ieee_Numeric_Std_Match_Le_Sgn_Int = 327 - Ieee_Numeric_Std_Match_Le_Int_Sgn = 328 - Ieee_Numeric_Std_Match_Ge_Uns_Uns = 329 - Ieee_Numeric_Std_Match_Ge_Uns_Nat = 330 - Ieee_Numeric_Std_Match_Ge_Nat_Uns = 331 - Ieee_Numeric_Std_Match_Ge_Sgn_Sgn = 332 - Ieee_Numeric_Std_Match_Ge_Sgn_Int = 333 - Ieee_Numeric_Std_Match_Ge_Int_Sgn = 334 - Ieee_Numeric_Std_Match_Eq_Uns_Uns = 335 - Ieee_Numeric_Std_Match_Eq_Uns_Nat = 336 - Ieee_Numeric_Std_Match_Eq_Nat_Uns = 337 - Ieee_Numeric_Std_Match_Eq_Sgn_Sgn = 338 - Ieee_Numeric_Std_Match_Eq_Sgn_Int = 339 - Ieee_Numeric_Std_Match_Eq_Int_Sgn = 340 - Ieee_Numeric_Std_Match_Ne_Uns_Uns = 341 - Ieee_Numeric_Std_Match_Ne_Uns_Nat = 342 - Ieee_Numeric_Std_Match_Ne_Nat_Uns = 343 - Ieee_Numeric_Std_Match_Ne_Sgn_Sgn = 344 - Ieee_Numeric_Std_Match_Ne_Sgn_Int = 345 - Ieee_Numeric_Std_Match_Ne_Int_Sgn = 346 - Ieee_Numeric_Std_Shl_Uns_Nat = 347 - Ieee_Numeric_Std_Shr_Uns_Nat = 348 - Ieee_Numeric_Std_Shl_Sgn_Nat = 349 - Ieee_Numeric_Std_Shr_Sgn_Nat = 350 - Ieee_Numeric_Std_Sll_Uns_Int = 351 - Ieee_Numeric_Std_Sll_Sgn_Int = 352 - Ieee_Numeric_Std_Srl_Uns_Int = 353 - Ieee_Numeric_Std_Srl_Sgn_Int = 354 - Ieee_Numeric_Std_Sla_Uns_Int = 355 - Ieee_Numeric_Std_Sla_Sgn_Int = 356 - Ieee_Numeric_Std_Sra_Uns_Int = 357 - Ieee_Numeric_Std_Sra_Sgn_Int = 358 - Ieee_Numeric_Std_Rol_Uns_Nat = 359 - Ieee_Numeric_Std_Ror_Uns_Nat = 360 - Ieee_Numeric_Std_Rol_Sgn_Nat = 361 - Ieee_Numeric_Std_Ror_Sgn_Nat = 362 - Ieee_Numeric_Std_Not_Uns = 363 - Ieee_Numeric_Std_Not_Sgn = 364 - Ieee_Numeric_Std_Abs_Sgn = 365 - Ieee_Numeric_Std_And_Uns_Uns = 366 - Ieee_Numeric_Std_And_Sgn_Sgn = 367 - Ieee_Numeric_Std_Or_Uns_Uns = 368 - Ieee_Numeric_Std_Or_Sgn_Sgn = 369 - Ieee_Numeric_Std_Nand_Uns_Uns = 370 - Ieee_Numeric_Std_Nand_Sgn_Sgn = 371 - Ieee_Numeric_Std_Nor_Uns_Uns = 372 - Ieee_Numeric_Std_Nor_Sgn_Sgn = 373 - Ieee_Numeric_Std_Xor_Uns_Uns = 374 - Ieee_Numeric_Std_Xor_Sgn_Sgn = 375 - Ieee_Numeric_Std_Xnor_Uns_Uns = 376 - Ieee_Numeric_Std_Xnor_Sgn_Sgn = 377 - Ieee_Numeric_Std_Neg_Uns = 378 - Ieee_Numeric_Std_Neg_Sgn = 379 + Ieee_Numeric_Std_Match_Gt_Uns_Uns = 299 + Ieee_Numeric_Std_Match_Gt_Uns_Nat = 300 + Ieee_Numeric_Std_Match_Gt_Nat_Uns = 301 + Ieee_Numeric_Std_Match_Gt_Sgn_Sgn = 302 + Ieee_Numeric_Std_Match_Gt_Sgn_Int = 303 + Ieee_Numeric_Std_Match_Gt_Int_Sgn = 304 + Ieee_Numeric_Std_Match_Lt_Uns_Uns = 305 + Ieee_Numeric_Std_Match_Lt_Uns_Nat = 306 + Ieee_Numeric_Std_Match_Lt_Nat_Uns = 307 + Ieee_Numeric_Std_Match_Lt_Sgn_Sgn = 308 + Ieee_Numeric_Std_Match_Lt_Sgn_Int = 309 + Ieee_Numeric_Std_Match_Lt_Int_Sgn = 310 + Ieee_Numeric_Std_Match_Le_Uns_Uns = 311 + Ieee_Numeric_Std_Match_Le_Uns_Nat = 312 + Ieee_Numeric_Std_Match_Le_Nat_Uns = 313 + Ieee_Numeric_Std_Match_Le_Sgn_Sgn = 314 + Ieee_Numeric_Std_Match_Le_Sgn_Int = 315 + Ieee_Numeric_Std_Match_Le_Int_Sgn = 316 + Ieee_Numeric_Std_Match_Ge_Uns_Uns = 317 + Ieee_Numeric_Std_Match_Ge_Uns_Nat = 318 + Ieee_Numeric_Std_Match_Ge_Nat_Uns = 319 + Ieee_Numeric_Std_Match_Ge_Sgn_Sgn = 320 + Ieee_Numeric_Std_Match_Ge_Sgn_Int = 321 + Ieee_Numeric_Std_Match_Ge_Int_Sgn = 322 + Ieee_Numeric_Std_Match_Eq_Uns_Uns = 323 + Ieee_Numeric_Std_Match_Eq_Uns_Nat = 324 + Ieee_Numeric_Std_Match_Eq_Nat_Uns = 325 + Ieee_Numeric_Std_Match_Eq_Sgn_Sgn = 326 + Ieee_Numeric_Std_Match_Eq_Sgn_Int = 327 + Ieee_Numeric_Std_Match_Eq_Int_Sgn = 328 + Ieee_Numeric_Std_Match_Ne_Uns_Uns = 329 + Ieee_Numeric_Std_Match_Ne_Uns_Nat = 330 + Ieee_Numeric_Std_Match_Ne_Nat_Uns = 331 + Ieee_Numeric_Std_Match_Ne_Sgn_Sgn = 332 + Ieee_Numeric_Std_Match_Ne_Sgn_Int = 333 + Ieee_Numeric_Std_Match_Ne_Int_Sgn = 334 + Ieee_Numeric_Std_Sll_Uns_Int = 335 + Ieee_Numeric_Std_Sll_Sgn_Int = 336 + Ieee_Numeric_Std_Srl_Uns_Int = 337 + Ieee_Numeric_Std_Srl_Sgn_Int = 338 + Ieee_Numeric_Std_Sla_Uns_Int = 339 + Ieee_Numeric_Std_Sla_Sgn_Int = 340 + Ieee_Numeric_Std_Sra_Uns_Int = 341 + Ieee_Numeric_Std_Sra_Sgn_Int = 342 + Ieee_Numeric_Std_Rol_Uns_Nat = 343 + Ieee_Numeric_Std_Ror_Uns_Nat = 344 + Ieee_Numeric_Std_Rol_Sgn_Nat = 345 + Ieee_Numeric_Std_Ror_Sgn_Nat = 346 + Ieee_Numeric_Std_And_Uns_Uns = 347 + Ieee_Numeric_Std_And_Sgn_Sgn = 348 + Ieee_Numeric_Std_Or_Uns_Uns = 349 + Ieee_Numeric_Std_Or_Sgn_Sgn = 350 + Ieee_Numeric_Std_Nand_Uns_Uns = 351 + Ieee_Numeric_Std_Nand_Sgn_Sgn = 352 + Ieee_Numeric_Std_Nor_Uns_Uns = 353 + Ieee_Numeric_Std_Nor_Sgn_Sgn = 354 + Ieee_Numeric_Std_Xor_Uns_Uns = 355 + Ieee_Numeric_Std_Xor_Sgn_Sgn = 356 + Ieee_Numeric_Std_Xnor_Uns_Uns = 357 + Ieee_Numeric_Std_Xnor_Sgn_Sgn = 358 + Ieee_Numeric_Std_Not_Uns = 359 + Ieee_Numeric_Std_Not_Sgn = 360 + Ieee_Numeric_Std_Abs_Sgn = 361 + Ieee_Numeric_Std_Neg_Uns = 362 + Ieee_Numeric_Std_Neg_Sgn = 363 + Ieee_Numeric_Std_Min_Uns_Uns = 364 + Ieee_Numeric_Std_Min_Uns_Nat = 365 + Ieee_Numeric_Std_Min_Nat_Uns = 366 + Ieee_Numeric_Std_Min_Sgn_Sgn = 367 + Ieee_Numeric_Std_Min_Sgn_Int = 368 + Ieee_Numeric_Std_Min_Int_Sgn = 369 + Ieee_Numeric_Std_Max_Uns_Uns = 370 + Ieee_Numeric_Std_Max_Uns_Nat = 371 + Ieee_Numeric_Std_Max_Nat_Uns = 372 + Ieee_Numeric_Std_Max_Sgn_Sgn = 373 + Ieee_Numeric_Std_Max_Sgn_Int = 374 + Ieee_Numeric_Std_Max_Int_Sgn = 375 + Ieee_Numeric_Std_Shl_Uns_Nat = 376 + Ieee_Numeric_Std_Shr_Uns_Nat = 377 + Ieee_Numeric_Std_Shl_Sgn_Nat = 378 + Ieee_Numeric_Std_Shr_Sgn_Nat = 379 Ieee_Numeric_Std_Match_Log = 380 Ieee_Numeric_Std_Match_Uns = 381 Ieee_Numeric_Std_Match_Sgn = 382 diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index faebd7c93..c960b8867 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -1985,7 +1985,8 @@ package body Synth.Expr is Imp : constant Node := Get_Implementation (Expr); begin case Get_Implicit_Definition (Imp) is - when Iir_Predefined_Pure_Functions => + when Iir_Predefined_Pure_Functions + | Iir_Predefined_Ieee_Numeric_Std_Binary_Operators => return Synth_Operator_Function_Call (Syn_Inst, Expr); when Iir_Predefined_None => return Synth_User_Function_Call (Syn_Inst, Expr); diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads index 56407a607..50ffbfcb0 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -5498,6 +5498,7 @@ package Vhdl.Nodes is Iir_Predefined_Ieee_Numeric_Std_Resize_Uns_Uns, Iir_Predefined_Ieee_Numeric_Std_Resize_Sgn_Sgn, + -- Numeric_Std operators (Start) Iir_Predefined_Ieee_Numeric_Std_Add_Uns_Uns, Iir_Predefined_Ieee_Numeric_Std_Add_Uns_Nat, Iir_Predefined_Ieee_Numeric_Std_Add_Nat_Uns, @@ -5590,20 +5591,6 @@ package Vhdl.Nodes is Iir_Predefined_Ieee_Numeric_Std_Ne_Sgn_Int, Iir_Predefined_Ieee_Numeric_Std_Ne_Int_Sgn, - Iir_Predefined_Ieee_Numeric_Std_Min_Uns_Uns, - Iir_Predefined_Ieee_Numeric_Std_Min_Uns_Nat, - Iir_Predefined_Ieee_Numeric_Std_Min_Nat_Uns, - Iir_Predefined_Ieee_Numeric_Std_Min_Sgn_Sgn, - Iir_Predefined_Ieee_Numeric_Std_Min_Sgn_Int, - Iir_Predefined_Ieee_Numeric_Std_Min_Int_Sgn, - - Iir_Predefined_Ieee_Numeric_Std_Max_Uns_Uns, - Iir_Predefined_Ieee_Numeric_Std_Max_Uns_Nat, - Iir_Predefined_Ieee_Numeric_Std_Max_Nat_Uns, - Iir_Predefined_Ieee_Numeric_Std_Max_Sgn_Sgn, - Iir_Predefined_Ieee_Numeric_Std_Max_Sgn_Int, - Iir_Predefined_Ieee_Numeric_Std_Max_Int_Sgn, - Iir_Predefined_Ieee_Numeric_Std_Match_Gt_Uns_Uns, Iir_Predefined_Ieee_Numeric_Std_Match_Gt_Uns_Nat, Iir_Predefined_Ieee_Numeric_Std_Match_Gt_Nat_Uns, @@ -5646,11 +5633,6 @@ package Vhdl.Nodes is Iir_Predefined_Ieee_Numeric_Std_Match_Ne_Sgn_Int, Iir_Predefined_Ieee_Numeric_Std_Match_Ne_Int_Sgn, - Iir_Predefined_Ieee_Numeric_Std_Shl_Uns_Nat, - Iir_Predefined_Ieee_Numeric_Std_Shr_Uns_Nat, - Iir_Predefined_Ieee_Numeric_Std_Shl_Sgn_Nat, - Iir_Predefined_Ieee_Numeric_Std_Shr_Sgn_Nat, - Iir_Predefined_Ieee_Numeric_Std_Sll_Uns_Int, Iir_Predefined_Ieee_Numeric_Std_Sll_Sgn_Int, Iir_Predefined_Ieee_Numeric_Std_Srl_Uns_Int, @@ -5665,11 +5647,6 @@ package Vhdl.Nodes is Iir_Predefined_Ieee_Numeric_Std_Rol_Sgn_Nat, Iir_Predefined_Ieee_Numeric_Std_Ror_Sgn_Nat, - Iir_Predefined_Ieee_Numeric_Std_Not_Uns, - Iir_Predefined_Ieee_Numeric_Std_Not_Sgn, - - Iir_Predefined_Ieee_Numeric_Std_Abs_Sgn, - Iir_Predefined_Ieee_Numeric_Std_And_Uns_Uns, Iir_Predefined_Ieee_Numeric_Std_And_Sgn_Sgn, @@ -5687,11 +5664,38 @@ package Vhdl.Nodes is Iir_Predefined_Ieee_Numeric_Std_Xnor_Uns_Uns, Iir_Predefined_Ieee_Numeric_Std_Xnor_Sgn_Sgn, + -- Numeric_Std binary operators (end) -- Unary functions for numeric_std + Iir_Predefined_Ieee_Numeric_Std_Not_Uns, + Iir_Predefined_Ieee_Numeric_Std_Not_Sgn, + + Iir_Predefined_Ieee_Numeric_Std_Abs_Sgn, + Iir_Predefined_Ieee_Numeric_Std_Neg_Uns, Iir_Predefined_Ieee_Numeric_Std_Neg_Sgn, + -- Min and Max. + Iir_Predefined_Ieee_Numeric_Std_Min_Uns_Uns, + Iir_Predefined_Ieee_Numeric_Std_Min_Uns_Nat, + Iir_Predefined_Ieee_Numeric_Std_Min_Nat_Uns, + Iir_Predefined_Ieee_Numeric_Std_Min_Sgn_Sgn, + Iir_Predefined_Ieee_Numeric_Std_Min_Sgn_Int, + Iir_Predefined_Ieee_Numeric_Std_Min_Int_Sgn, + + Iir_Predefined_Ieee_Numeric_Std_Max_Uns_Uns, + Iir_Predefined_Ieee_Numeric_Std_Max_Uns_Nat, + Iir_Predefined_Ieee_Numeric_Std_Max_Nat_Uns, + Iir_Predefined_Ieee_Numeric_Std_Max_Sgn_Sgn, + Iir_Predefined_Ieee_Numeric_Std_Max_Sgn_Int, + Iir_Predefined_Ieee_Numeric_Std_Max_Int_Sgn, + + -- Shift and rotate functions. + Iir_Predefined_Ieee_Numeric_Std_Shl_Uns_Nat, + Iir_Predefined_Ieee_Numeric_Std_Shr_Uns_Nat, + Iir_Predefined_Ieee_Numeric_Std_Shl_Sgn_Nat, + Iir_Predefined_Ieee_Numeric_Std_Shr_Sgn_Nat, + -- Std_Match functions. Iir_Predefined_Ieee_Numeric_Std_Match_Log, Iir_Predefined_Ieee_Numeric_Std_Match_Uns, @@ -5985,6 +5989,11 @@ package Vhdl.Nodes is Iir_Predefined_Functions'Succ (Iir_Predefined_None) .. Iir_Predefined_Functions'Last; + subtype Iir_Predefined_Ieee_Numeric_Std_Binary_Operators + is Iir_Predefined_Functions range + Iir_Predefined_Ieee_Numeric_Std_Add_Uns_Uns .. + Iir_Predefined_Ieee_Numeric_Std_Xnor_Sgn_Sgn; + -- Size of scalar types. -- Their size is determined during analysis (using the range), so that -- all backends have the same view. |