@@ -488,32 +488,65 @@ static bool s_read_json_items(const nlohmann::ordered_json& from,
488
488
// 2. read 'name'
489
489
PinPlacer::EditItem& last = items.back ();
490
490
last.name_ = obj[" name" ];
491
- if (tr >= 8 ) ls << " ........ last.name_ " << last.name_ << endl;
492
491
493
492
// 3. read 'module'
494
493
if (obj.contains (" module" )) {
495
494
last.module_ = obj[" module" ];
496
495
}
497
496
498
- // 3. read 'location'
497
+ if (tr >= 6 ) {
498
+ ls << " rd_js_items --- .name_= " << last.name_
499
+ << " .module_= " << last.module_ << endl;
500
+ }
501
+
502
+ // 4. read 'location'
499
503
if (obj.contains (" location" )) {
500
504
last.location_ = obj[" location" ];
501
505
}
502
506
503
- // 4 . read 'mode'
507
+ // 5 . read 'mode'
504
508
if (obj.contains (" properties" )) {
505
509
const auto & propObj = obj[" properties" ];
506
510
if (propObj.contains (" mode" ))
507
511
last.mode_ = propObj[" mode" ];
508
512
}
509
513
510
- // 5 . read oldPin_/newPin_
514
+ // 6 . read oldPin_/newPin_
511
515
if (obj.contains (" connectivity" )) {
512
516
const auto & propObj = obj[" connectivity" ];
513
- if (propObj.contains (" I" ))
517
+ bool has_new = false , has_old = false ;
518
+ if (propObj.contains (" I" )) {
514
519
last.newPin_ = propObj[" I" ];
515
- if (propObj.contains (" O" ))
520
+ has_new = true ;
521
+ }
522
+ if (propObj.contains (" O" )) {
523
+ last.oldPin_ = propObj[" O" ];
524
+ has_old = true ;
525
+ }
526
+ bool cont_1 = propObj.contains (" D" );
527
+ bool cont_2 = propObj.contains (" Q" );
528
+ if (!has_new and !has_old and cont_1 and cont_2) {
529
+ last.newPin_ = propObj[" D" ];
530
+ last.oldPin_ = propObj[" Q" ];
531
+ has_new = true ;
532
+ has_old = true ;
533
+ }
534
+ cont_1 = propObj.contains (" I_P" );
535
+ cont_2 = propObj.contains (" O" );
536
+ if ((!has_new or !has_old) and cont_1 and cont_2) {
537
+ last.newPin_ = propObj[" I_P" ];
516
538
last.oldPin_ = propObj[" O" ];
539
+ has_new = true ;
540
+ has_old = true ;
541
+ }
542
+ cont_1 = propObj.contains (" I" );
543
+ cont_2 = propObj.contains (" O_P" );
544
+ if ((!has_new or !has_old) and cont_1 and cont_2) {
545
+ last.newPin_ = propObj[" I" ];
546
+ last.oldPin_ = propObj[" O_P" ];
547
+ has_new = true ;
548
+ has_old = true ;
549
+ }
517
550
}
518
551
}
519
552
@@ -784,9 +817,9 @@ void PinPlacer::set_edit_dirs(bool initial) noexcept {
784
817
EditItem& item = all_edits_[i];
785
818
assert (item.dir_ == 0 );
786
819
const string& mod = item.module_ ;
787
- if (mod == " I_BUF" or mod == " CLK_BUF" or mod == " I_DELAY" )
820
+ if (mod == " I_BUF" or mod == " CLK_BUF" or mod == " I_DELAY" or mod == " I_SERDES " )
788
821
item.dir_ = 1 ;
789
- else if (mod == " O_BUF" or mod == " O_DELAY" )
822
+ else if (mod == " O_BUF" or mod == " O_DELAY" or mod == " O_SERDES " )
790
823
item.dir_ = -1 ;
791
824
else if (item.hasPins ())
792
825
undefs.push_back (i);
0 commit comments