diff options
author | gatecat <gatecat@ds0.me> | 2021-08-06 10:14:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-06 10:14:59 +0100 |
commit | dd6376433154e008045695f5420469670b0c3a88 (patch) | |
tree | b3edb7116254285e4d0ec6b7bb73292d3e90b44c /gowin/arch.cc | |
parent | 0c1ee5fad103b65d0a194596b2006c6622742e05 (diff) | |
parent | 3f959c7421bf693c17f00ebbe398a96fb0be750b (diff) | |
download | nextpnr-dd6376433154e008045695f5420469670b0c3a88.tar.gz nextpnr-dd6376433154e008045695f5420469670b0c3a88.tar.bz2 nextpnr-dd6376433154e008045695f5420469670b0c3a88.zip |
Merge pull request #791 from yrabbit/wip
gowin: Add support for IOBUF and TBUF I/O modes. Change the constraint parser.
Diffstat (limited to 'gowin/arch.cc')
-rw-r--r-- | gowin/arch.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc index e4dce329..0bc0ef56 100644 --- a/gowin/arch.cc +++ b/gowin/arch.cc @@ -485,8 +485,9 @@ DelayQuad Arch::getWireTypeDelay(IdString wire) void Arch::read_cst(std::istream &in) { std::regex iobre = std::regex("IO_LOC +\"([^\"]+)\" +([^ ;]+) *;.*"); - std::regex portre = std::regex("IO_PORT +\"([^\"]+)\" +([^ =;]+=[^ =;]+) *;.*"); - std::smatch match; + std::regex portre = std::regex("IO_PORT +\"([^\"]+)\" +([^;]+;).*"); + std::regex port_attrre = std::regex("([^ =;]+=[^ =;]+) *([^;]*;)"); + std::smatch match, match_attr; std::string line; bool io_loc; while (!in.eof()) { @@ -517,10 +518,14 @@ void Arch::read_cst(std::istream &in) std::string bel = IdString(belname->src_id).str(this); it->second->attrs[IdString(ID_BEL)] = bel; } else { // IO_PORT attr=value - std::string attr = "&"; - attr += match[2]; - boost::algorithm::to_upper(attr); - it->second->attrs[id(attr)] = 1; + std::string attr_val = match[2]; + while (std::regex_match(attr_val, match_attr, port_attrre)) { + std::string attr = "&"; + attr += match_attr[1]; + boost::algorithm::to_upper(attr); + it->second->attrs[id(attr)] = 1; + attr_val = match_attr[2]; + } } } } |