aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-07-13 15:16:44 +0200
committerClifford Wolf <clifford@clifford.at>2018-07-13 15:16:44 +0200
commitc05bea12e0af7ec847043c832133cbfddfb278b1 (patch)
treeac4b50662bb4cbfb75a0cc1ff132e18b2dc7b4e8 /ice40
parent45462ef3a714c0d98fe570d96e6761e2b298c7d0 (diff)
downloadnextpnr-c05bea12e0af7ec847043c832133cbfddfb278b1.tar.gz
nextpnr-c05bea12e0af7ec847043c832133cbfddfb278b1.tar.bz2
nextpnr-c05bea12e0af7ec847043c832133cbfddfb278b1.zip
Add ctx->pack() API
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/arch.h1
-rw-r--r--ice40/arch_pybindings.cc5
-rw-r--r--ice40/main.cc3
-rw-r--r--ice40/pack.cc4
-rw-r--r--ice40/pack.h32
5 files changed, 8 insertions, 37 deletions
diff --git a/ice40/arch.h b/ice40/arch.h
index b6c64de4..34797442 100644
--- a/ice40/arch.h
+++ b/ice40/arch.h
@@ -672,6 +672,7 @@ struct Arch : BaseCtx
// -------------------------------------------------
+ bool pack();
bool place();
bool route();
diff --git a/ice40/arch_pybindings.cc b/ice40/arch_pybindings.cc
index ac8c189a..fd5109b4 100644
--- a/ice40/arch_pybindings.cc
+++ b/ice40/arch_pybindings.cc
@@ -58,7 +58,10 @@ void arch_wrap_python()
auto arch_cls = class_<Arch, Arch *, bases<BaseCtx>, boost::noncopyable>("Arch", init<ArchArgs>());
auto ctx_cls = class_<Context, Context *, bases<Arch>, boost::noncopyable>("Context", no_init)
- .def("checksum", &Context::checksum);
+ .def("checksum", &Context::checksum)
+ .def("pack", &Context::pack)
+ .def("place", &Context::place)
+ .def("route", &Context::route);
fn_wrapper_1a<Context, decltype(&Context::getBelType), &Context::getBelType, conv_to_str<BelType>,
conv_from_str<BelId>>::def_wrap(ctx_cls, "getBelType");
diff --git a/ice40/main.cc b/ice40/main.cc
index 53cd7164..e77bdd34 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -39,7 +39,6 @@
#include "jsonparse.h"
#include "log.h"
#include "nextpnr.h"
-#include "pack.h"
#include "pcf.h"
#include "place_legaliser.h"
#include "timing.h"
@@ -382,7 +381,7 @@ int main(int argc, char *argv[])
log_error("Loading PCF failed.\n");
}
- if (!pack_design(ctx.get()) && !ctx->force)
+ if (!ctx->pack() && !ctx->force)
log_error("Packing design failed.\n");
assign_budget(ctx.get());
ctx->check();
diff --git a/ice40/pack.cc b/ice40/pack.cc
index d1be4a29..76a52be0 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -18,7 +18,6 @@
*
*/
-#include "pack.h"
#include <algorithm>
#include <iterator>
#include <unordered_set>
@@ -577,8 +576,9 @@ static void pack_special(Context *ctx)
}
// Main pack function
-bool pack_design(Context *ctx)
+bool Arch::pack()
{
+ Context *ctx = getCtx();
try {
log_break();
pack_constants(ctx);
diff --git a/ice40/pack.h b/ice40/pack.h
deleted file mode 100644
index cdebdd79..00000000
--- a/ice40/pack.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * nextpnr -- Next Generation Place and Route
- *
- * Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
- * Copyright (C) 2018 David Shah <david@symbioticeda.com>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#ifndef PACK_H
-#define PACK_H
-
-#include "nextpnr.h"
-
-NEXTPNR_NAMESPACE_BEGIN
-
-bool pack_design(Context *ctx);
-
-NEXTPNR_NAMESPACE_END
-
-#endif // ROUTE_H