mirror of https://github.com/YosysHQ/nextpnr.git
add DIE parameter in CCF
This commit is contained in:
parent
1411360ed8
commit
9f49a9fa35
|
|
@ -69,7 +69,7 @@ struct GateMateCCFReader
|
||||||
boost::algorithm::to_upper(name);
|
boost::algorithm::to_upper(name);
|
||||||
|
|
||||||
if (expr.size() != 2) {
|
if (expr.size() != 2) {
|
||||||
if (name == "LOC" || name == "DRIVE" || name == "DELAY_IBF" || name == "DELAY_OBF")
|
if (name == "LOC" || name == "DRIVE" || name == "DELAY_IBF" || name == "DELAY_OBF" || name == "DIE")
|
||||||
log_error("Parameter must be in form NAME=VALUE (on line %d)\n", lineno);
|
log_error("Parameter must be in form NAME=VALUE (on line %d)\n", lineno);
|
||||||
log_warning("Parameter '%s' missing value, defaulting to '1' (on line %d)\n", name.c_str(), lineno);
|
log_warning("Parameter '%s' missing value, defaulting to '1' (on line %d)\n", name.c_str(), lineno);
|
||||||
expr.push_back("1");
|
expr.push_back("1");
|
||||||
|
|
@ -99,6 +99,12 @@ struct GateMateCCFReader
|
||||||
uarch->available_pads.erase(ctx->id("SER_CLK_N"));
|
uarch->available_pads.erase(ctx->id("SER_CLK_N"));
|
||||||
if (value == "SER_CLK_N")
|
if (value == "SER_CLK_N")
|
||||||
uarch->available_pads.erase(ctx->id("SER_CLK"));
|
uarch->available_pads.erase(ctx->id("SER_CLK"));
|
||||||
|
} else if (name == "DIE") {
|
||||||
|
if (uarch->die_to_index.count(ctx->id(value))) {
|
||||||
|
props->emplace(ctx->id(name), Property(value));
|
||||||
|
} else
|
||||||
|
log_error("Uknown value '%s' for parameter '%s' in line %d.\n", value.c_str(), name.c_str(),
|
||||||
|
lineno);
|
||||||
} else if (name == "SCHMITT_TRIGGER" || name == "PULLUP" || name == "PULLDOWN" || name == "KEEPER" ||
|
} else if (name == "SCHMITT_TRIGGER" || name == "PULLUP" || name == "PULLDOWN" || name == "KEEPER" ||
|
||||||
name == "FF_IBF" || name == "FF_OBF" || name == "LVDS_BOOST" || name == "LVDS_RTERM") {
|
name == "FF_IBF" || name == "FF_OBF" || name == "LVDS_BOOST" || name == "LVDS_RTERM") {
|
||||||
if (value == "1")
|
if (value == "1")
|
||||||
|
|
|
||||||
|
|
@ -2473,6 +2473,8 @@ X(1A)
|
||||||
X(1B)
|
X(1B)
|
||||||
X(2A)
|
X(2A)
|
||||||
X(2B)
|
X(2B)
|
||||||
|
X(DIE)
|
||||||
|
X(GATEMATE_DIE)
|
||||||
|
|
||||||
// Timing
|
// Timing
|
||||||
X(timing_ADDF2x_IN5_8_comb2)
|
X(timing_ADDF2x_IN5_8_comb2)
|
||||||
|
|
|
||||||
|
|
@ -429,8 +429,8 @@ void GateMatePacker::assign_regions()
|
||||||
log_info("Assign cell region based on attributes..\n");
|
log_info("Assign cell region based on attributes..\n");
|
||||||
for (auto &cell : ctx->cells) {
|
for (auto &cell : ctx->cells) {
|
||||||
CellInfo &ci = *cell.second;
|
CellInfo &ci = *cell.second;
|
||||||
if (ci.attrs.count(ctx->id("GATEMATE_DIE")) != 0) {
|
if (ci.attrs.count(id_GATEMATE_DIE) != 0) {
|
||||||
std::string die_name = str_or_default(ci.attrs, ctx->id("GATEMATE_DIE"), "");
|
std::string die_name = str_or_default(ci.attrs, id_GATEMATE_DIE, "");
|
||||||
IdString die = ctx->id(die_name);
|
IdString die = ctx->id(die_name);
|
||||||
if (!uarch->die_to_index.count(die))
|
if (!uarch->die_to_index.count(die))
|
||||||
log_error("Trying to assign cell '%s' to non existing die '%s'.\n", ci.name.c_str(ctx), die.c_str(ctx));
|
log_error("Trying to assign cell '%s' to non existing die '%s'.\n", ci.name.c_str(ctx), die.c_str(ctx));
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ std::string get_die_name(int total_dies, int die)
|
||||||
{
|
{
|
||||||
if (total_dies == 1)
|
if (total_dies == 1)
|
||||||
return "";
|
return "";
|
||||||
return stringf("on die '%d%c'", int(die / total_dies) + 1, 'A' + int(die % total_dies));
|
return stringf(" on die '%d%c'", int(die / total_dies) + 1, 'A' + int(die % total_dies));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GateMatePacker::pack_io()
|
void GateMatePacker::pack_io()
|
||||||
|
|
@ -187,6 +187,8 @@ void GateMatePacker::pack_io()
|
||||||
keys.push_back(p.first);
|
keys.push_back(p.first);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (p.first.in(id_DIE))
|
||||||
|
continue;
|
||||||
if (ci.type.in(id_CC_IBUF, id_CC_IOBUF) &&
|
if (ci.type.in(id_CC_IBUF, id_CC_IOBUF) &&
|
||||||
p.first.in(id_PULLUP, id_PULLDOWN, id_KEEPER, id_SCHMITT_TRIGGER, id_DELAY_IBF, id_FF_IBF))
|
p.first.in(id_PULLUP, id_PULLDOWN, id_KEEPER, id_SCHMITT_TRIGGER, id_DELAY_IBF, id_FF_IBF))
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -305,10 +307,20 @@ void GateMatePacker::pack_io()
|
||||||
}
|
}
|
||||||
|
|
||||||
BelId bel;
|
BelId bel;
|
||||||
if (uarch->locations.count(std::make_pair(ctx->id(loc), uarch->preferred_die)))
|
if (ci.params.count(id_DIE)) {
|
||||||
bel = ctx->getBelByLocation(uarch->locations[std::make_pair(ctx->id(loc), uarch->preferred_die)]);
|
std::string die_name = str_or_default(ci.params, id_DIE, "");
|
||||||
else
|
int die = uarch->die_to_index[ctx->id(die_name)];
|
||||||
bel = ctx->get_package_pin_bel(ctx->id(loc));
|
ci.unsetParam(id_DIE);
|
||||||
|
if (uarch->locations.count(std::make_pair(ctx->id(loc), die)))
|
||||||
|
bel = ctx->getBelByLocation(uarch->locations[std::make_pair(ctx->id(loc), die)]);
|
||||||
|
else
|
||||||
|
log_error("Unable to place '%s' to specified '%s' die.\n", ci.name.c_str(ctx), die_name.c_str());
|
||||||
|
} else {
|
||||||
|
if (uarch->locations.count(std::make_pair(ctx->id(loc), uarch->preferred_die)))
|
||||||
|
bel = ctx->getBelByLocation(uarch->locations[std::make_pair(ctx->id(loc), uarch->preferred_die)]);
|
||||||
|
else
|
||||||
|
bel = ctx->get_package_pin_bel(ctx->id(loc));
|
||||||
|
}
|
||||||
if (bel == BelId())
|
if (bel == BelId())
|
||||||
log_error("Unable to constrain IO '%s', device does not have a pin named '%s'\n", ci.name.c_str(ctx),
|
log_error("Unable to constrain IO '%s', device does not have a pin named '%s'\n", ci.name.c_str(ctx),
|
||||||
loc.c_str());
|
loc.c_str());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue