Skip to content

Commit 9497be2

Browse files
authored
Merge pull request #696 from os-fpga/pin_c_support_D2Q_IP2O_etc_in_config_connectivity_EDA2838
pin_c: support D2Q, IP2O, etc in config connectivity EDA-2838
2 parents ff6b9b1 + 740f077 commit 9497be2

File tree

2 files changed

+42
-9
lines changed

2 files changed

+42
-9
lines changed

stars/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
static const char* _pln_VERSION_STR = "pln0204";
1+
static const char* _pln_VERSION_STR = "pln0207";
22

33
#include "RS/rsEnv.h"
44
#include "util/pln_log.h"

stars/src/pin_loc/read_ports.cpp

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -488,32 +488,65 @@ static bool s_read_json_items(const nlohmann::ordered_json& from,
488488
// 2. read 'name'
489489
PinPlacer::EditItem& last = items.back();
490490
last.name_ = obj["name"];
491-
if (tr >= 8) ls << " ........ last.name_ " << last.name_ << endl;
492491

493492
// 3. read 'module'
494493
if (obj.contains("module")) {
495494
last.module_ = obj["module"];
496495
}
497496

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'
499503
if (obj.contains("location")) {
500504
last.location_ = obj["location"];
501505
}
502506

503-
// 4. read 'mode'
507+
// 5. read 'mode'
504508
if (obj.contains("properties")) {
505509
const auto& propObj = obj["properties"];
506510
if (propObj.contains("mode"))
507511
last.mode_ = propObj["mode"];
508512
}
509513

510-
// 5. read oldPin_/newPin_
514+
// 6. read oldPin_/newPin_
511515
if (obj.contains("connectivity")) {
512516
const auto& propObj = obj["connectivity"];
513-
if (propObj.contains("I"))
517+
bool has_new = false, has_old = false;
518+
if (propObj.contains("I")) {
514519
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"];
516538
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+
}
517550
}
518551
}
519552

@@ -784,9 +817,9 @@ void PinPlacer::set_edit_dirs(bool initial) noexcept {
784817
EditItem& item = all_edits_[i];
785818
assert(item.dir_ == 0);
786819
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")
788821
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")
790823
item.dir_ = -1;
791824
else if (item.hasPins())
792825
undefs.push_back(i);

0 commit comments

Comments
 (0)