aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-14 07:56:43 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-14 07:56:43 +0100
commitea76787585564f7ebb113d3989f87d34d0a4e7f7 (patch)
tree9ed67775d9e73e975200f4ce1c65c0f83feb3d52
parent559c6166f3c639330502f714babddb0bd6d986b4 (diff)
downloadghdl-ea76787585564f7ebb113d3989f87d34d0a4e7f7.tar.gz
ghdl-ea76787585564f7ebb113d3989f87d34d0a4e7f7.tar.bz2
ghdl-ea76787585564f7ebb113d3989f87d34d0a4e7f7.zip
synth: preliminary work to support intrinsic procedures.
-rw-r--r--python/libghdl/thin/vhdl/nodes.py347
-rw-r--r--src/synth/synth-stmts.adb23
-rw-r--r--src/vhdl/translate/trans_be.adb21
-rw-r--r--src/vhdl/vhdl-nodes.ads5
4 files changed, 214 insertions, 182 deletions
diff --git a/python/libghdl/thin/vhdl/nodes.py b/python/libghdl/thin/vhdl/nodes.py
index b51808578..57ea761ab 100644
--- a/python/libghdl/thin/vhdl/nodes.py
+++ b/python/libghdl/thin/vhdl/nodes.py
@@ -1048,178 +1048,181 @@ class Iir_Predefined:
Endfile = 169
Now_Function = 170
PNone = 171
- Ieee_1164_Scalar_And = 172
- Ieee_1164_Scalar_Nand = 173
- Ieee_1164_Scalar_Or = 174
- Ieee_1164_Scalar_Nor = 175
- Ieee_1164_Scalar_Xor = 176
- Ieee_1164_Scalar_Xnor = 177
- Ieee_1164_Scalar_Not = 178
- Ieee_1164_Vector_And = 179
- Ieee_1164_Vector_Nand = 180
- Ieee_1164_Vector_Or = 181
- Ieee_1164_Vector_Nor = 182
- Ieee_1164_Vector_Xor = 183
- Ieee_1164_Vector_Xnor = 184
- Ieee_1164_Vector_Not = 185
- Ieee_1164_To_Bitvector = 186
- Ieee_1164_Rising_Edge = 187
- Ieee_1164_Falling_Edge = 188
- Ieee_1164_Vector_And_Reduce = 189
- Ieee_1164_Vector_Or_Reduce = 190
- Ieee_1164_Condition_Operator = 191
- Ieee_Numeric_Std_Toint_Uns_Nat = 192
- Ieee_Numeric_Std_Toint_Sgn_Int = 193
- Ieee_Numeric_Std_Touns_Nat_Nat_Uns = 194
- Ieee_Numeric_Std_Touns_Nat_Uns_Uns = 195
- Ieee_Numeric_Std_Tosgn_Int_Nat_Sgn = 196
- Ieee_Numeric_Std_Tosgn_Int_Sgn_Sgn = 197
- Ieee_Numeric_Std_Resize_Uns_Nat = 198
- Ieee_Numeric_Std_Resize_Sgn_Nat = 199
- Ieee_Numeric_Std_Resize_Uns_Uns = 200
- Ieee_Numeric_Std_Resize_Sgn_Sgn = 201
- Ieee_Numeric_Std_Add_Uns_Uns = 202
- Ieee_Numeric_Std_Add_Uns_Nat = 203
- Ieee_Numeric_Std_Add_Nat_Uns = 204
- Ieee_Numeric_Std_Add_Uns_Log = 205
- Ieee_Numeric_Std_Add_Log_Uns = 206
- Ieee_Numeric_Std_Add_Sgn_Sgn = 207
- Ieee_Numeric_Std_Add_Sgn_Int = 208
- Ieee_Numeric_Std_Add_Int_Sgn = 209
- Ieee_Numeric_Std_Add_Sgn_Log = 210
- Ieee_Numeric_Std_Add_Log_Sgn = 211
- Ieee_Numeric_Std_Sub_Uns_Uns = 212
- Ieee_Numeric_Std_Sub_Uns_Nat = 213
- Ieee_Numeric_Std_Sub_Nat_Uns = 214
- Ieee_Numeric_Std_Sub_Sgn_Sgn = 215
- Ieee_Numeric_Std_Sub_Sgn_Int = 216
- Ieee_Numeric_Std_Sub_Int_Sgn = 217
- Ieee_Numeric_Std_Mul_Uns_Uns = 218
- Ieee_Numeric_Std_Mul_Uns_Nat = 219
- Ieee_Numeric_Std_Mul_Nat_Uns = 220
- Ieee_Numeric_Std_Mul_Sgn_Sgn = 221
- Ieee_Numeric_Std_Mul_Sgn_Int = 222
- Ieee_Numeric_Std_Mul_Int_Sgn = 223
- Ieee_Numeric_Std_Div_Uns_Uns = 224
- Ieee_Numeric_Std_Div_Uns_Nat = 225
- Ieee_Numeric_Std_Div_Nat_Uns = 226
- Ieee_Numeric_Std_Div_Sgn_Sgn = 227
- Ieee_Numeric_Std_Div_Sgn_Int = 228
- Ieee_Numeric_Std_Div_Int_Sgn = 229
- Ieee_Numeric_Std_Gt_Uns_Uns = 230
- Ieee_Numeric_Std_Gt_Uns_Nat = 231
- Ieee_Numeric_Std_Gt_Nat_Uns = 232
- Ieee_Numeric_Std_Gt_Sgn_Sgn = 233
- Ieee_Numeric_Std_Gt_Sgn_Int = 234
- Ieee_Numeric_Std_Gt_Int_Sgn = 235
- Ieee_Numeric_Std_Lt_Uns_Uns = 236
- Ieee_Numeric_Std_Lt_Uns_Nat = 237
- Ieee_Numeric_Std_Lt_Nat_Uns = 238
- Ieee_Numeric_Std_Lt_Sgn_Sgn = 239
- Ieee_Numeric_Std_Lt_Sgn_Int = 240
- Ieee_Numeric_Std_Lt_Int_Sgn = 241
- Ieee_Numeric_Std_Le_Uns_Uns = 242
- Ieee_Numeric_Std_Le_Uns_Nat = 243
- Ieee_Numeric_Std_Le_Nat_Uns = 244
- Ieee_Numeric_Std_Le_Sgn_Sgn = 245
- Ieee_Numeric_Std_Le_Sgn_Int = 246
- Ieee_Numeric_Std_Le_Int_Sgn = 247
- Ieee_Numeric_Std_Ge_Uns_Uns = 248
- Ieee_Numeric_Std_Ge_Uns_Nat = 249
- Ieee_Numeric_Std_Ge_Nat_Uns = 250
- Ieee_Numeric_Std_Ge_Sgn_Sgn = 251
- Ieee_Numeric_Std_Ge_Sgn_Int = 252
- Ieee_Numeric_Std_Ge_Int_Sgn = 253
- Ieee_Numeric_Std_Eq_Uns_Uns = 254
- Ieee_Numeric_Std_Eq_Uns_Nat = 255
- Ieee_Numeric_Std_Eq_Nat_Uns = 256
- Ieee_Numeric_Std_Eq_Sgn_Sgn = 257
- Ieee_Numeric_Std_Eq_Sgn_Int = 258
- Ieee_Numeric_Std_Eq_Int_Sgn = 259
- Ieee_Numeric_Std_Ne_Uns_Uns = 260
- Ieee_Numeric_Std_Ne_Uns_Nat = 261
- Ieee_Numeric_Std_Ne_Nat_Uns = 262
- Ieee_Numeric_Std_Ne_Sgn_Sgn = 263
- Ieee_Numeric_Std_Ne_Sgn_Int = 264
- Ieee_Numeric_Std_Ne_Int_Sgn = 265
- Ieee_Numeric_Std_Shl_Uns_Nat = 266
- Ieee_Numeric_Std_Shr_Uns_Nat = 267
- Ieee_Numeric_Std_Shl_Sgn_Nat = 268
- Ieee_Numeric_Std_Shr_Sgn_Nat = 269
- Ieee_Numeric_Std_Rol_Uns_Nat = 270
- Ieee_Numeric_Std_Ror_Uns_Nat = 271
- Ieee_Numeric_Std_Rol_Sgn_Nat = 272
- Ieee_Numeric_Std_Ror_Sgn_Nat = 273
- Ieee_Numeric_Std_Not_Uns = 274
- Ieee_Numeric_Std_Not_Sgn = 275
- Ieee_Numeric_Std_And_Uns_Uns = 276
- Ieee_Numeric_Std_And_Sgn_Sgn = 277
- Ieee_Numeric_Std_Or_Uns_Uns = 278
- Ieee_Numeric_Std_Or_Sgn_Sgn = 279
- Ieee_Numeric_Std_Nand_Uns_Uns = 280
- Ieee_Numeric_Std_Nand_Sgn_Sgn = 281
- Ieee_Numeric_Std_Nor_Uns_Uns = 282
- Ieee_Numeric_Std_Nor_Sgn_Sgn = 283
- Ieee_Numeric_Std_Xor_Uns_Uns = 284
- Ieee_Numeric_Std_Xor_Sgn_Sgn = 285
- Ieee_Numeric_Std_Xnor_Uns_Uns = 286
- Ieee_Numeric_Std_Xnor_Sgn_Sgn = 287
- Ieee_Numeric_Std_Neg_Uns = 288
- Ieee_Numeric_Std_Neg_Sgn = 289
- Ieee_Numeric_Std_Match_Log = 290
- Ieee_Numeric_Std_Match_Uns = 291
- Ieee_Numeric_Std_Match_Sgn = 292
- Ieee_Numeric_Std_Match_Slv = 293
- Ieee_Numeric_Std_Match_Suv = 294
- Ieee_Math_Real_Ceil = 295
- Ieee_Math_Real_Log2 = 296
- Ieee_Std_Logic_Unsigned_Add_Slv_Slv = 297
- Ieee_Std_Logic_Unsigned_Add_Slv_Int = 298
- Ieee_Std_Logic_Unsigned_Add_Int_Slv = 299
- Ieee_Std_Logic_Unsigned_Add_Slv_Sl = 300
- Ieee_Std_Logic_Unsigned_Add_Sl_Slv = 301
- Ieee_Std_Logic_Unsigned_Sub_Slv_Slv = 302
- Ieee_Std_Logic_Unsigned_Sub_Slv_Int = 303
- Ieee_Std_Logic_Unsigned_Sub_Int_Slv = 304
- Ieee_Std_Logic_Unsigned_Sub_Slv_Sl = 305
- Ieee_Std_Logic_Unsigned_Sub_Sl_Slv = 306
- Ieee_Std_Logic_Unsigned_Lt_Slv_Slv = 307
- Ieee_Std_Logic_Unsigned_Lt_Slv_Int = 308
- Ieee_Std_Logic_Unsigned_Lt_Int_Slv = 309
- Ieee_Std_Logic_Unsigned_Le_Slv_Slv = 310
- Ieee_Std_Logic_Unsigned_Le_Slv_Int = 311
- Ieee_Std_Logic_Unsigned_Le_Int_Slv = 312
- Ieee_Std_Logic_Unsigned_Gt_Slv_Slv = 313
- Ieee_Std_Logic_Unsigned_Gt_Slv_Int = 314
- Ieee_Std_Logic_Unsigned_Gt_Int_Slv = 315
- Ieee_Std_Logic_Unsigned_Ge_Slv_Slv = 316
- Ieee_Std_Logic_Unsigned_Ge_Slv_Int = 317
- Ieee_Std_Logic_Unsigned_Ge_Int_Slv = 318
- Ieee_Std_Logic_Unsigned_Eq_Slv_Slv = 319
- Ieee_Std_Logic_Unsigned_Eq_Slv_Int = 320
- Ieee_Std_Logic_Unsigned_Eq_Int_Slv = 321
- Ieee_Std_Logic_Unsigned_Ne_Slv_Slv = 322
- Ieee_Std_Logic_Unsigned_Ne_Slv_Int = 323
- Ieee_Std_Logic_Unsigned_Ne_Int_Slv = 324
- Ieee_Std_Logic_Unsigned_Conv_Integer = 325
- Ieee_Std_Logic_Signed_Add_Slv_Slv = 326
- Ieee_Std_Logic_Signed_Add_Slv_Int = 327
- Ieee_Std_Logic_Signed_Add_Int_Slv = 328
- Ieee_Std_Logic_Signed_Add_Slv_Sl = 329
- Ieee_Std_Logic_Signed_Add_Sl_Slv = 330
- Ieee_Std_Logic_Signed_Sub_Slv_Slv = 331
- Ieee_Std_Logic_Signed_Sub_Slv_Int = 332
- Ieee_Std_Logic_Signed_Sub_Int_Slv = 333
- Ieee_Std_Logic_Signed_Sub_Slv_Sl = 334
- Ieee_Std_Logic_Signed_Sub_Sl_Slv = 335
- Ieee_Std_Logic_Arith_Conv_Unsigned_Int = 336
- Ieee_Std_Logic_Arith_Conv_Unsigned_Uns = 337
- Ieee_Std_Logic_Arith_Conv_Unsigned_Sgn = 338
- Ieee_Std_Logic_Arith_Conv_Unsigned_Log = 339
- Ieee_Std_Logic_Arith_Conv_Integer_Int = 340
- Ieee_Std_Logic_Arith_Conv_Integer_Uns = 341
- Ieee_Std_Logic_Arith_Conv_Integer_Sgn = 342
- Ieee_Std_Logic_Arith_Conv_Integer_Log = 343
+ Foreign_Untruncated_Text_Read = 172
+ Foreign_Textio_Read_Real = 173
+ Foreign_Textio_Write_Real = 174
+ Ieee_1164_Scalar_And = 175
+ Ieee_1164_Scalar_Nand = 176
+ Ieee_1164_Scalar_Or = 177
+ Ieee_1164_Scalar_Nor = 178
+ Ieee_1164_Scalar_Xor = 179
+ Ieee_1164_Scalar_Xnor = 180
+ Ieee_1164_Scalar_Not = 181
+ Ieee_1164_Vector_And = 182
+ Ieee_1164_Vector_Nand = 183
+ Ieee_1164_Vector_Or = 184
+ Ieee_1164_Vector_Nor = 185
+ Ieee_1164_Vector_Xor = 186
+ Ieee_1164_Vector_Xnor = 187
+ Ieee_1164_Vector_Not = 188
+ Ieee_1164_To_Bitvector = 189
+ Ieee_1164_Rising_Edge = 190
+ Ieee_1164_Falling_Edge = 191
+ Ieee_1164_Vector_And_Reduce = 192
+ Ieee_1164_Vector_Or_Reduce = 193
+ Ieee_1164_Condition_Operator = 194
+ Ieee_Numeric_Std_Toint_Uns_Nat = 195
+ Ieee_Numeric_Std_Toint_Sgn_Int = 196
+ Ieee_Numeric_Std_Touns_Nat_Nat_Uns = 197
+ Ieee_Numeric_Std_Touns_Nat_Uns_Uns = 198
+ Ieee_Numeric_Std_Tosgn_Int_Nat_Sgn = 199
+ Ieee_Numeric_Std_Tosgn_Int_Sgn_Sgn = 200
+ Ieee_Numeric_Std_Resize_Uns_Nat = 201
+ Ieee_Numeric_Std_Resize_Sgn_Nat = 202
+ Ieee_Numeric_Std_Resize_Uns_Uns = 203
+ Ieee_Numeric_Std_Resize_Sgn_Sgn = 204
+ Ieee_Numeric_Std_Add_Uns_Uns = 205
+ Ieee_Numeric_Std_Add_Uns_Nat = 206
+ Ieee_Numeric_Std_Add_Nat_Uns = 207
+ Ieee_Numeric_Std_Add_Uns_Log = 208
+ Ieee_Numeric_Std_Add_Log_Uns = 209
+ Ieee_Numeric_Std_Add_Sgn_Sgn = 210
+ Ieee_Numeric_Std_Add_Sgn_Int = 211
+ Ieee_Numeric_Std_Add_Int_Sgn = 212
+ Ieee_Numeric_Std_Add_Sgn_Log = 213
+ Ieee_Numeric_Std_Add_Log_Sgn = 214
+ Ieee_Numeric_Std_Sub_Uns_Uns = 215
+ Ieee_Numeric_Std_Sub_Uns_Nat = 216
+ Ieee_Numeric_Std_Sub_Nat_Uns = 217
+ Ieee_Numeric_Std_Sub_Sgn_Sgn = 218
+ Ieee_Numeric_Std_Sub_Sgn_Int = 219
+ Ieee_Numeric_Std_Sub_Int_Sgn = 220
+ Ieee_Numeric_Std_Mul_Uns_Uns = 221
+ Ieee_Numeric_Std_Mul_Uns_Nat = 222
+ Ieee_Numeric_Std_Mul_Nat_Uns = 223
+ Ieee_Numeric_Std_Mul_Sgn_Sgn = 224
+ Ieee_Numeric_Std_Mul_Sgn_Int = 225
+ Ieee_Numeric_Std_Mul_Int_Sgn = 226
+ Ieee_Numeric_Std_Div_Uns_Uns = 227
+ Ieee_Numeric_Std_Div_Uns_Nat = 228
+ Ieee_Numeric_Std_Div_Nat_Uns = 229
+ Ieee_Numeric_Std_Div_Sgn_Sgn = 230
+ Ieee_Numeric_Std_Div_Sgn_Int = 231
+ Ieee_Numeric_Std_Div_Int_Sgn = 232
+ Ieee_Numeric_Std_Gt_Uns_Uns = 233
+ Ieee_Numeric_Std_Gt_Uns_Nat = 234
+ Ieee_Numeric_Std_Gt_Nat_Uns = 235
+ Ieee_Numeric_Std_Gt_Sgn_Sgn = 236
+ Ieee_Numeric_Std_Gt_Sgn_Int = 237
+ Ieee_Numeric_Std_Gt_Int_Sgn = 238
+ Ieee_Numeric_Std_Lt_Uns_Uns = 239
+ Ieee_Numeric_Std_Lt_Uns_Nat = 240
+ Ieee_Numeric_Std_Lt_Nat_Uns = 241
+ Ieee_Numeric_Std_Lt_Sgn_Sgn = 242
+ Ieee_Numeric_Std_Lt_Sgn_Int = 243
+ Ieee_Numeric_Std_Lt_Int_Sgn = 244
+ Ieee_Numeric_Std_Le_Uns_Uns = 245
+ Ieee_Numeric_Std_Le_Uns_Nat = 246
+ Ieee_Numeric_Std_Le_Nat_Uns = 247
+ Ieee_Numeric_Std_Le_Sgn_Sgn = 248
+ Ieee_Numeric_Std_Le_Sgn_Int = 249
+ Ieee_Numeric_Std_Le_Int_Sgn = 250
+ Ieee_Numeric_Std_Ge_Uns_Uns = 251
+ Ieee_Numeric_Std_Ge_Uns_Nat = 252
+ Ieee_Numeric_Std_Ge_Nat_Uns = 253
+ Ieee_Numeric_Std_Ge_Sgn_Sgn = 254
+ Ieee_Numeric_Std_Ge_Sgn_Int = 255
+ Ieee_Numeric_Std_Ge_Int_Sgn = 256
+ Ieee_Numeric_Std_Eq_Uns_Uns = 257
+ Ieee_Numeric_Std_Eq_Uns_Nat = 258
+ Ieee_Numeric_Std_Eq_Nat_Uns = 259
+ Ieee_Numeric_Std_Eq_Sgn_Sgn = 260
+ Ieee_Numeric_Std_Eq_Sgn_Int = 261
+ Ieee_Numeric_Std_Eq_Int_Sgn = 262
+ Ieee_Numeric_Std_Ne_Uns_Uns = 263
+ Ieee_Numeric_Std_Ne_Uns_Nat = 264
+ Ieee_Numeric_Std_Ne_Nat_Uns = 265
+ Ieee_Numeric_Std_Ne_Sgn_Sgn = 266
+ Ieee_Numeric_Std_Ne_Sgn_Int = 267
+ Ieee_Numeric_Std_Ne_Int_Sgn = 268
+ Ieee_Numeric_Std_Shl_Uns_Nat = 269
+ Ieee_Numeric_Std_Shr_Uns_Nat = 270
+ Ieee_Numeric_Std_Shl_Sgn_Nat = 271
+ Ieee_Numeric_Std_Shr_Sgn_Nat = 272
+ Ieee_Numeric_Std_Rol_Uns_Nat = 273
+ Ieee_Numeric_Std_Ror_Uns_Nat = 274
+ Ieee_Numeric_Std_Rol_Sgn_Nat = 275
+ Ieee_Numeric_Std_Ror_Sgn_Nat = 276
+ Ieee_Numeric_Std_Not_Uns = 277
+ Ieee_Numeric_Std_Not_Sgn = 278
+ Ieee_Numeric_Std_And_Uns_Uns = 279
+ Ieee_Numeric_Std_And_Sgn_Sgn = 280
+ Ieee_Numeric_Std_Or_Uns_Uns = 281
+ Ieee_Numeric_Std_Or_Sgn_Sgn = 282
+ Ieee_Numeric_Std_Nand_Uns_Uns = 283
+ Ieee_Numeric_Std_Nand_Sgn_Sgn = 284
+ Ieee_Numeric_Std_Nor_Uns_Uns = 285
+ Ieee_Numeric_Std_Nor_Sgn_Sgn = 286
+ Ieee_Numeric_Std_Xor_Uns_Uns = 287
+ Ieee_Numeric_Std_Xor_Sgn_Sgn = 288
+ Ieee_Numeric_Std_Xnor_Uns_Uns = 289
+ Ieee_Numeric_Std_Xnor_Sgn_Sgn = 290
+ Ieee_Numeric_Std_Neg_Uns = 291
+ Ieee_Numeric_Std_Neg_Sgn = 292
+ Ieee_Numeric_Std_Match_Log = 293
+ Ieee_Numeric_Std_Match_Uns = 294
+ Ieee_Numeric_Std_Match_Sgn = 295
+ Ieee_Numeric_Std_Match_Slv = 296
+ Ieee_Numeric_Std_Match_Suv = 297
+ Ieee_Math_Real_Ceil = 298
+ Ieee_Math_Real_Log2 = 299
+ Ieee_Std_Logic_Unsigned_Add_Slv_Slv = 300
+ Ieee_Std_Logic_Unsigned_Add_Slv_Int = 301
+ Ieee_Std_Logic_Unsigned_Add_Int_Slv = 302
+ Ieee_Std_Logic_Unsigned_Add_Slv_Sl = 303
+ Ieee_Std_Logic_Unsigned_Add_Sl_Slv = 304
+ Ieee_Std_Logic_Unsigned_Sub_Slv_Slv = 305
+ Ieee_Std_Logic_Unsigned_Sub_Slv_Int = 306
+ Ieee_Std_Logic_Unsigned_Sub_Int_Slv = 307
+ Ieee_Std_Logic_Unsigned_Sub_Slv_Sl = 308
+ Ieee_Std_Logic_Unsigned_Sub_Sl_Slv = 309
+ Ieee_Std_Logic_Unsigned_Lt_Slv_Slv = 310
+ Ieee_Std_Logic_Unsigned_Lt_Slv_Int = 311
+ Ieee_Std_Logic_Unsigned_Lt_Int_Slv = 312
+ Ieee_Std_Logic_Unsigned_Le_Slv_Slv = 313
+ Ieee_Std_Logic_Unsigned_Le_Slv_Int = 314
+ Ieee_Std_Logic_Unsigned_Le_Int_Slv = 315
+ Ieee_Std_Logic_Unsigned_Gt_Slv_Slv = 316
+ Ieee_Std_Logic_Unsigned_Gt_Slv_Int = 317
+ Ieee_Std_Logic_Unsigned_Gt_Int_Slv = 318
+ Ieee_Std_Logic_Unsigned_Ge_Slv_Slv = 319
+ Ieee_Std_Logic_Unsigned_Ge_Slv_Int = 320
+ Ieee_Std_Logic_Unsigned_Ge_Int_Slv = 321
+ Ieee_Std_Logic_Unsigned_Eq_Slv_Slv = 322
+ Ieee_Std_Logic_Unsigned_Eq_Slv_Int = 323
+ Ieee_Std_Logic_Unsigned_Eq_Int_Slv = 324
+ Ieee_Std_Logic_Unsigned_Ne_Slv_Slv = 325
+ Ieee_Std_Logic_Unsigned_Ne_Slv_Int = 326
+ Ieee_Std_Logic_Unsigned_Ne_Int_Slv = 327
+ Ieee_Std_Logic_Unsigned_Conv_Integer = 328
+ Ieee_Std_Logic_Signed_Add_Slv_Slv = 329
+ Ieee_Std_Logic_Signed_Add_Slv_Int = 330
+ Ieee_Std_Logic_Signed_Add_Int_Slv = 331
+ Ieee_Std_Logic_Signed_Add_Slv_Sl = 332
+ Ieee_Std_Logic_Signed_Add_Sl_Slv = 333
+ Ieee_Std_Logic_Signed_Sub_Slv_Slv = 334
+ Ieee_Std_Logic_Signed_Sub_Slv_Int = 335
+ Ieee_Std_Logic_Signed_Sub_Int_Slv = 336
+ Ieee_Std_Logic_Signed_Sub_Slv_Sl = 337
+ Ieee_Std_Logic_Signed_Sub_Sl_Slv = 338
+ Ieee_Std_Logic_Arith_Conv_Unsigned_Int = 339
+ Ieee_Std_Logic_Arith_Conv_Unsigned_Uns = 340
+ Ieee_Std_Logic_Arith_Conv_Unsigned_Sgn = 341
+ Ieee_Std_Logic_Arith_Conv_Unsigned_Log = 342
+ Ieee_Std_Logic_Arith_Conv_Integer_Int = 343
+ Ieee_Std_Logic_Arith_Conv_Integer_Uns = 344
+ Ieee_Std_Logic_Arith_Conv_Integer_Sgn = 345
+ Ieee_Std_Logic_Arith_Conv_Integer_Log = 346
Get_Kind = libghdl.vhdl__nodes__get_kind
Get_Location = libghdl.vhdl__nodes__get_location
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index e969cf11a..393d415b5 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -1586,16 +1586,19 @@ package body Synth.Stmts is
Imp : constant Node := Get_Implementation (Call);
Res : Value_Acc;
begin
- if Get_Implicit_Definition (Imp) in Iir_Predefined_Implicit then
- Error_Msg_Synth (+Stmt, "call to implicit %n is not supported", +Imp);
- return;
- elsif Get_Foreign_Flag (Imp) then
- Error_Msg_Synth (+Stmt, "call to foreign %n is not supported", +Imp);
- return;
- end if;
-
- Res := Synth_Subprogram_Call (Syn_Inst, Call);
- pragma Assert (Res = null);
+ case Get_Implicit_Definition (Imp) is
+ when Iir_Predefined_None =>
+ if Get_Foreign_Flag (Imp) then
+ Error_Msg_Synth
+ (+Stmt, "call to foreign %n is not supported", +Imp);
+ else
+ Res := Synth_Subprogram_Call (Syn_Inst, Call);
+ pragma Assert (Res = null);
+ end if;
+ when others =>
+ Error_Msg_Synth
+ (+Stmt, "call to implicit %n is not supported", +Imp);
+ end case;
end Synth_Procedure_Call;
function In_Range (Rng : Discrete_Range_Type; V : Int64) return Boolean is
diff --git a/src/vhdl/translate/trans_be.adb b/src/vhdl/translate/trans_be.adb
index d4002cbcf..4092243ac 100644
--- a/src/vhdl/translate/trans_be.adb
+++ b/src/vhdl/translate/trans_be.adb
@@ -17,6 +17,7 @@
-- 02111-1307, USA.
with Simple_IO;
+with Std_Names;
with Vhdl.Errors; use Vhdl.Errors;
with Vhdl.Back_End;
@@ -38,6 +39,26 @@ package body Trans_Be is
-- Let it generate error messages.
Fi := Translate_Foreign_Id (Decl);
+ if Fi.Kind = Foreign_Intrinsic then
+ pragma Assert (Get_Implicit_Definition (Decl) = Iir_Predefined_None);
+ declare
+ use Std_Names;
+ Predefined : Iir_Predefined_Functions;
+ begin
+ case Get_Identifier (Decl) is
+ when Name_Untruncated_Text_Read =>
+ Predefined := Iir_Predefined_Foreign_Untruncated_Text_Read;
+ when Name_Textio_Read_Real =>
+ Predefined := Iir_Predefined_Foreign_Textio_Read_Real;
+ when Name_Textio_Write_Real =>
+ Predefined := Iir_Predefined_Foreign_Textio_Write_Real;
+ when others =>
+ Predefined := Iir_Predefined_None;
+ end case;
+ Set_Implicit_Definition (Decl, Predefined);
+ end;
+ end if;
+
if Sem_Foreign_Hook /= null then
Sem_Foreign_Hook.all (Decl, Fi);
end if;
diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads
index 57b0675ff..10ad3d853 100644
--- a/src/vhdl/vhdl-nodes.ads
+++ b/src/vhdl/vhdl-nodes.ads
@@ -4892,6 +4892,11 @@ package Vhdl.Nodes is
-- A not predefined and not known function. User function.
Iir_Predefined_None,
+ -- Intrinsic foreign subprograms.
+ Iir_Predefined_Foreign_Untruncated_Text_Read,
+ Iir_Predefined_Foreign_Textio_Read_Real,
+ Iir_Predefined_Foreign_Textio_Write_Real,
+
-- Defined in package ieee.std_logic_1164
-- Std_Ulogic operations.