Add Context::force and "nextpnr-ice40 --force"
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
7abfd36773
commit
5f37da9704
@ -273,6 +273,7 @@ NEXTPNR_NAMESPACE_BEGIN
|
|||||||
struct Context : Arch
|
struct Context : Arch
|
||||||
{
|
{
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
bool force = false;
|
||||||
|
|
||||||
Context(ArchArgs args) : Arch(args) {}
|
Context(ArchArgs args) : Arch(args) {}
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ BelId random_bel_for_cell(Context *ctx, CellInfo *cell, SAState &state,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void place_design_sa(Context *ctx)
|
bool place_design_sa(Context *ctx)
|
||||||
{
|
{
|
||||||
SAState state;
|
SAState state;
|
||||||
|
|
||||||
@ -442,6 +442,7 @@ void place_design_sa(Context *ctx)
|
|||||||
ctx->getBelName(bel).c_str(ctx), cell_text.c_str());
|
ctx->getBelName(bel).c_str(ctx), cell_text.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
extern void place_design_sa(Context *ctx);
|
extern bool place_design_sa(Context *ctx);
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@ int main(int argc, char *argv[])
|
|||||||
po::options_description options("Allowed options");
|
po::options_description options("Allowed options");
|
||||||
options.add_options()("help,h", "show help");
|
options.add_options()("help,h", "show help");
|
||||||
options.add_options()("verbose,v", "verbose output");
|
options.add_options()("verbose,v", "verbose output");
|
||||||
|
options.add_options()("force,f", "keep running after errors");
|
||||||
options.add_options()("gui", "start gui");
|
options.add_options()("gui", "start gui");
|
||||||
options.add_options()("svg", "dump SVG file");
|
options.add_options()("svg", "dump SVG file");
|
||||||
options.add_options()("pack-only",
|
options.add_options()("pack-only",
|
||||||
@ -196,6 +197,10 @@ int main(int argc, char *argv[])
|
|||||||
ctx.verbose = true;
|
ctx.verbose = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vm.count("force")) {
|
||||||
|
ctx.force = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (vm.count("seed")) {
|
if (vm.count("seed")) {
|
||||||
ctx.rngseed(vm["seed"].as<int>());
|
ctx.rngseed(vm["seed"].as<int>());
|
||||||
}
|
}
|
||||||
@ -225,12 +230,16 @@ int main(int argc, char *argv[])
|
|||||||
apply_pcf(&ctx, pcf);
|
apply_pcf(&ctx, pcf);
|
||||||
}
|
}
|
||||||
|
|
||||||
pack_design(&ctx);
|
if (!pack_design(&ctx) && !ctx.force)
|
||||||
|
log_error("Packing design failed.\n");
|
||||||
|
|
||||||
print_utilisation(&ctx);
|
print_utilisation(&ctx);
|
||||||
|
|
||||||
if (!vm.count("pack-only")) {
|
if (!vm.count("pack-only")) {
|
||||||
place_design_sa(&ctx);
|
if (!place_design_sa(&ctx) && !ctx.force)
|
||||||
route_design(&ctx);
|
log_error("Placing design failed.\n");
|
||||||
|
if (!route_design(&ctx) && !ctx.force)
|
||||||
|
log_error("Routing design failed.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ static void promote_globals(Context *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Main pack function
|
// Main pack function
|
||||||
void pack_design(Context *ctx)
|
bool pack_design(Context *ctx)
|
||||||
{
|
{
|
||||||
pack_constants(ctx);
|
pack_constants(ctx);
|
||||||
promote_globals(ctx);
|
promote_globals(ctx);
|
||||||
@ -398,6 +398,7 @@ void pack_design(Context *ctx)
|
|||||||
pack_lut_lutffs(ctx);
|
pack_lut_lutffs(ctx);
|
||||||
pack_nonlut_ffs(ctx);
|
pack_nonlut_ffs(ctx);
|
||||||
pack_ram(ctx);
|
pack_ram(ctx);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
void pack_design(Context *ctx);
|
bool pack_design(Context *ctx);
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user