@@ -1285,10 +1285,27 @@ unsigned PECallFunction::test_width_method_(Design*des, NetScope*scope,
1285
1285
return expr_width_;
1286
1286
}
1287
1287
1288
+ if (use_darray && (method_name == " pop_back" || method_name==" pop_front" )) {
1289
+ if (debug_elaborate) {
1290
+ cerr << get_fileline () << " : PECallFunction::test_width_method_: "
1291
+ << " Detected " << method_name << " method"
1292
+ << " of dynamic arrays." << endl;
1293
+ }
1294
+
1295
+ expr_type_ = use_darray->element_base_type ();
1296
+ expr_width_ = use_darray->element_width ();
1297
+ min_width_ = expr_width_;
1298
+ signed_flag_= false ;
1299
+
1300
+ return expr_width_;
1301
+ }
1302
+
1288
1303
if (const netclass_t *class_type = net->class_type ()) {
1289
- cerr << get_fileline () << " : PECallFunction::test_width_method_: "
1290
- << " Try to find method " << method_name
1291
- << " of class " << class_type->get_name () << endl;
1304
+ if (debug_elaborate) {
1305
+ cerr << get_fileline () << " : PECallFunction::test_width_method_: "
1306
+ << " Try to find method " << method_name
1307
+ << " of class " << class_type->get_name () << endl;
1308
+ }
1292
1309
1293
1310
NetScope*func = class_type->method_from_name (method_name);
1294
1311
if (func == 0 ) {
@@ -2324,6 +2341,25 @@ NetExpr* PECallFunction::elaborate_expr_method_(Design*des, NetScope*scope,
2324
2341
sys_expr->set_line (*this );
2325
2342
return sys_expr;
2326
2343
}
2344
+
2345
+ if (method_name == " pop_back" ) {
2346
+ NetESFunc*sys_expr = new NetESFunc (" $ivl_darray_method$pop_back" ,
2347
+ expr_type_,
2348
+ expr_width_, 1 );
2349
+ sys_expr->parm (0 , new NetESignal (net));
2350
+ sys_expr->set_line (*this );
2351
+ return sys_expr;
2352
+ }
2353
+
2354
+ if (method_name == " pop_front" ) {
2355
+ NetESFunc*sys_expr = new NetESFunc (" $ivl_darray_method$pop_front" ,
2356
+ expr_type_,
2357
+ expr_width_, 1 );
2358
+ sys_expr->parm (0 , new NetESignal (net));
2359
+ sys_expr->set_line (*this );
2360
+ return sys_expr;
2361
+ }
2362
+
2327
2363
}
2328
2364
2329
2365
if (const netclass_t *class_type = net->class_type ()) {
0 commit comments