Merge pull request #791 from yrabbit/wip
gowin: Add support for IOBUF and TBUF I/O modes. Change the constraint parser.
This commit is contained in:
commit
dd63764331
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -229,8 +229,10 @@ static void pack_io(Context *ctx)
|
||||
iob = net_only_drives(ctx, ci->ports.at(id_O).net, is_nextpnr_iob, id_I);
|
||||
break;
|
||||
case ID_IOBUF:
|
||||
iob = net_driven_by(ctx, ci->ports.at(id_IO).net, is_nextpnr_iob, id_O);
|
||||
break;
|
||||
case ID_TBUF:
|
||||
log_error("untested tristate stuff");
|
||||
iob = net_only_drives(ctx, ci->ports.at(id_O).net, is_nextpnr_iob, id_I);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user