diff options
author | gatecat <gatecat@ds0.me> | 2021-09-08 19:01:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-08 19:01:34 +0100 |
commit | 67bd349e8f38d91a15f54340b29cc77ef156727f (patch) | |
tree | 44e53624f1540a29536cac26643970e39e78c6f5 /gowin/pack.cc | |
parent | 95845b47b5c2229456d12cd5732e90d9dd00697e (diff) | |
parent | 544d6073bcd3281c04fef7cf8140bc16a288be83 (diff) | |
download | nextpnr-67bd349e8f38d91a15f54340b29cc77ef156727f.tar.gz nextpnr-67bd349e8f38d91a15f54340b29cc77ef156727f.tar.bz2 nextpnr-67bd349e8f38d91a15f54340b29cc77ef156727f.zip |
Merge pull request #806 from yrabbit/extend-placement
gowin: Add constraints on primitive placement.
Diffstat (limited to 'gowin/pack.cc')
-rw-r--r-- | gowin/pack.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gowin/pack.cc b/gowin/pack.cc index 213889f5..708f06da 100644 --- a/gowin/pack.cc +++ b/gowin/pack.cc @@ -253,9 +253,19 @@ static void pack_io(Context *ctx) auto gwiob = new_cells.back().get(); packed_cells.insert(ci->name); - if (iob != nullptr) - for (auto &attr : iob->attrs) - gwiob->attrs[attr.first] = attr.second; + if (iob != nullptr) { + // in Gowin .CST port attributes take precedence over cell attributes. + // first copy cell attrs related to IO + for (auto &attr : ci->attrs) { + if (attr.first == IdString(ID_BEL) || attr.first.str(ctx)[0] == '&') { + gwiob->setAttr(attr.first, attr.second); + } + } + // rewrite attributes from the port + for (auto &attr : iob->attrs) { + gwiob->setAttr(attr.first, attr.second); + } + } } } for (auto pcell : packed_cells) { |