Add frequency setting and fix slack calculation
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
9e28e45bd5
commit
56ed679f83
@ -334,7 +334,7 @@ class SAPlacer
|
|||||||
load_cell->bel, ctx->portPinFromId(load.port));
|
load_cell->bel, ctx->portPinFromId(load.port));
|
||||||
delay_t raw_wl = ctx->estimateDelay(drv_wire, user_wire);
|
delay_t raw_wl = ctx->estimateDelay(drv_wire, user_wire);
|
||||||
float slack =
|
float slack =
|
||||||
ctx->getDelayNS(raw_wl) - ctx->getDelayNS(load.budget);
|
ctx->getDelayNS(load.budget) - ctx->getDelayNS(raw_wl);
|
||||||
worst_slack = std::min(slack, worst_slack);
|
worst_slack = std::min(slack, worst_slack);
|
||||||
int load_x, load_y;
|
int load_x, load_y;
|
||||||
bool load_gb;
|
bool load_gb;
|
||||||
|
@ -101,7 +101,6 @@ void assign_budget(Context *ctx, float default_clock)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const bool debug = true;
|
|
||||||
|
|
||||||
// Post-allocation check
|
// Post-allocation check
|
||||||
for (auto net : ctx->nets) {
|
for (auto net : ctx->nets) {
|
||||||
@ -111,8 +110,8 @@ void assign_budget(Context *ctx, float default_clock)
|
|||||||
"timing budget of %fns\n",
|
"timing budget of %fns\n",
|
||||||
user.cell->name.c_str(ctx), user.port.c_str(ctx),
|
user.cell->name.c_str(ctx), user.port.c_str(ctx),
|
||||||
net.first.c_str(ctx), ctx->getDelayNS(user.budget));
|
net.first.c_str(ctx), ctx->getDelayNS(user.budget));
|
||||||
if (debug)
|
if (ctx->verbose)
|
||||||
log_warning("port %s.%s, connected to net '%s', has "
|
log_info("port %s.%s, connected to net '%s', has "
|
||||||
"timing budget of %fns\n",
|
"timing budget of %fns\n",
|
||||||
user.cell->name.c_str(ctx), user.port.c_str(ctx),
|
user.cell->name.c_str(ctx), user.port.c_str(ctx),
|
||||||
net.first.c_str(ctx), ctx->getDelayNS(user.budget));
|
net.first.c_str(ctx), ctx->getDelayNS(user.budget));
|
||||||
|
@ -93,6 +93,8 @@ int main(int argc, char *argv[])
|
|||||||
options.add_options()("hx1k", "set device type to iCE40HX1K");
|
options.add_options()("hx1k", "set device type to iCE40HX1K");
|
||||||
options.add_options()("hx8k", "set device type to iCE40HX8K");
|
options.add_options()("hx8k", "set device type to iCE40HX8K");
|
||||||
options.add_options()("up5k", "set device type to iCE40UP5K");
|
options.add_options()("up5k", "set device type to iCE40UP5K");
|
||||||
|
options.add_options()("freq", po::value<double>(),
|
||||||
|
"set target frequency for design in MHz");
|
||||||
options.add_options()("package", po::value<std::string>(),
|
options.add_options()("package", po::value<std::string>(),
|
||||||
"set device package");
|
"set device package");
|
||||||
po::positional_options_description pos;
|
po::positional_options_description pos;
|
||||||
@ -286,7 +288,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!pack_design(&ctx) && !ctx.force)
|
if (!pack_design(&ctx) && !ctx.force)
|
||||||
log_error("Packing design failed.\n");
|
log_error("Packing design failed.\n");
|
||||||
assign_budget(&ctx, 50e6);
|
double freq = 50e6;
|
||||||
|
if (vm.count("freq"))
|
||||||
|
freq = vm["freq"].as<double>() * 1e6;
|
||||||
|
assign_budget(&ctx, freq);
|
||||||
print_utilisation(&ctx);
|
print_utilisation(&ctx);
|
||||||
|
|
||||||
if (!vm.count("pack-only")) {
|
if (!vm.count("pack-only")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user