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);
|
||||
|
||||
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_warning("Parameter '%s' missing value, defaulting to '1' (on line %d)\n", name.c_str(), lineno);
|
||||
expr.push_back("1");
|
||||
|
|
@ -99,6 +99,12 @@ struct GateMateCCFReader
|
|||
uarch->available_pads.erase(ctx->id("SER_CLK_N"));
|
||||
if (value == "SER_CLK_N")
|
||||
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" ||
|
||||
name == "FF_IBF" || name == "FF_OBF" || name == "LVDS_BOOST" || name == "LVDS_RTERM") {
|
||||
if (value == "1")
|
||||
|
|
|
|||
|
|
@ -2473,6 +2473,8 @@ X(1A)
|
|||
X(1B)
|
||||
X(2A)
|
||||
X(2B)
|
||||
X(DIE)
|
||||
X(GATEMATE_DIE)
|
||||
|
||||
// Timing
|
||||
X(timing_ADDF2x_IN5_8_comb2)
|
||||
|
|
|
|||
|
|
@ -429,8 +429,8 @@ void GateMatePacker::assign_regions()
|
|||
log_info("Assign cell region based on attributes..\n");
|
||||
for (auto &cell : ctx->cells) {
|
||||
CellInfo &ci = *cell.second;
|
||||
if (ci.attrs.count(ctx->id("GATEMATE_DIE")) != 0) {
|
||||
std::string die_name = str_or_default(ci.attrs, ctx->id("GATEMATE_DIE"), "");
|
||||
if (ci.attrs.count(id_GATEMATE_DIE) != 0) {
|
||||
std::string die_name = str_or_default(ci.attrs, id_GATEMATE_DIE, "");
|
||||
IdString die = ctx->id(die_name);
|
||||
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));
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ std::string get_die_name(int total_dies, int die)
|
|||
{
|
||||
if (total_dies == 1)
|
||||
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()
|
||||
|
|
@ -187,6 +187,8 @@ void GateMatePacker::pack_io()
|
|||
keys.push_back(p.first);
|
||||
continue;
|
||||
}
|
||||
if (p.first.in(id_DIE))
|
||||
continue;
|
||||
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))
|
||||
continue;
|
||||
|
|
@ -305,10 +307,20 @@ void GateMatePacker::pack_io()
|
|||
}
|
||||
|
||||
BelId bel;
|
||||
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 (ci.params.count(id_DIE)) {
|
||||
std::string die_name = str_or_default(ci.params, id_DIE, "");
|
||||
int die = uarch->die_to_index[ctx->id(die_name)];
|
||||
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())
|
||||
log_error("Unable to constrain IO '%s', device does not have a pin named '%s'\n", ci.name.c_str(ctx),
|
||||
loc.c_str());
|
||||
|
|
|
|||
Loading…
Reference in New Issue