aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
Diffstat (limited to 'ice40')
-rw-r--r--ice40/arch.h9
-rw-r--r--ice40/main.cc15
-rw-r--r--ice40/pack.cc3
-rw-r--r--ice40/pack.h2
4 files changed, 22 insertions, 7 deletions
diff --git a/ice40/arch.h b/ice40/arch.h
index 0fdacfde..c1256a41 100644
--- a/ice40/arch.h
+++ b/ice40/arch.h
@@ -279,8 +279,13 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId>
}
};
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelType> : hash<int> {};
-template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PortPin> : hash<int> {};
+template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelType> : hash<int>
+{
+};
+
+template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PortPin> : hash<int>
+{
+};
} // namespace std
NEXTPNR_NAMESPACE_BEGIN
diff --git a/ice40/main.cc b/ice40/main.cc
index 0ea3dc98..802a08b8 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -68,6 +68,7 @@ int main(int argc, char *argv[])
po::options_description options("Allowed options");
options.add_options()("help,h", "show help");
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()("svg", "dump SVG file");
options.add_options()("pack-only",
@@ -196,6 +197,10 @@ int main(int argc, char *argv[])
ctx.verbose = true;
}
+ if (vm.count("force")) {
+ ctx.force = true;
+ }
+
if (vm.count("seed")) {
ctx.rngseed(vm["seed"].as<int>());
}
@@ -225,12 +230,16 @@ int main(int argc, char *argv[])
apply_pcf(&ctx, pcf);
}
- pack_design(&ctx);
+ if (!pack_design(&ctx) && !ctx.force)
+ log_error("Packing design failed.\n");
+
print_utilisation(&ctx);
if (!vm.count("pack-only")) {
- place_design_sa(&ctx);
- route_design(&ctx);
+ if (!place_design_sa(&ctx) && !ctx.force)
+ log_error("Placing design failed.\n");
+ if (!route_design(&ctx) && !ctx.force)
+ log_error("Routing design failed.\n");
}
}
diff --git a/ice40/pack.cc b/ice40/pack.cc
index 0eb6f77d..d3f07118 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -405,7 +405,7 @@ static void promote_globals(Context *ctx)
}
// Main pack function
-void pack_design(Context *ctx)
+bool pack_design(Context *ctx)
{
pack_constants(ctx);
promote_globals(ctx);
@@ -413,6 +413,7 @@ void pack_design(Context *ctx)
pack_lut_lutffs(ctx);
pack_nonlut_ffs(ctx);
pack_ram(ctx);
+ return true;
}
NEXTPNR_NAMESPACE_END
diff --git a/ice40/pack.h b/ice40/pack.h
index 5495c986..92b76653 100644
--- a/ice40/pack.h
+++ b/ice40/pack.h
@@ -25,7 +25,7 @@
NEXTPNR_NAMESPACE_BEGIN
-void pack_design(Context *ctx);
+bool pack_design(Context *ctx);
NEXTPNR_NAMESPACE_END