aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5
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 /ecp5
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 'ecp5')
-rw-r--r--ecp5/arch.h1
-rw-r--r--ecp5/main.cc3
-rw-r--r--ecp5/pack.cc4
-rw-r--r--ecp5/pack.h31
4 files changed, 4 insertions, 35 deletions
diff --git a/ecp5/arch.h b/ecp5/arch.h
index bbc7c561..930c488e 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -730,6 +730,7 @@ struct Arch : BaseCtx
// -------------------------------------------------
+ bool pack();
bool place();
bool route();
diff --git a/ecp5/main.cc b/ecp5/main.cc
index 734ae560..4cb2f10d 100644
--- a/ecp5/main.cc
+++ b/ecp5/main.cc
@@ -43,7 +43,6 @@
#include "bitstream.h"
#include "design_utils.h"
#include "jsonparse.h"
-#include "pack.h"
#include "timing.h"
USING_NEXTPNR_NAMESPACE
@@ -147,7 +146,7 @@ int main(int argc, char *argv[])
if (!parse_json_file(f, filename, ctx.get()))
log_error("Loading design failed.\n");
- if (!pack_design(ctx.get()) && !ctx->force)
+ if (!ctx->pack() && !ctx->force)
log_error("Packing design failed.\n");
if (vm.count("freq"))
ctx->target_freq = vm["freq"].as<double>() * 1e6;
diff --git a/ecp5/pack.cc b/ecp5/pack.cc
index 7f54c231..e3ddc07d 100644
--- a/ecp5/pack.cc
+++ b/ecp5/pack.cc
@@ -17,7 +17,6 @@
*
*/
-#include "pack.h"
#include <algorithm>
#include <iterator>
#include <unordered_set>
@@ -84,8 +83,9 @@ void pack_io(Context *ctx)
}
// Main pack function
-bool pack_design(Context *ctx)
+bool Arch::pack()
{
+ Context *ctx = getCtx();
try {
log_break();
pack_io(ctx);
diff --git a/ecp5/pack.h b/ecp5/pack.h
deleted file mode 100644
index cc051a41..00000000
--- a/ecp5/pack.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * nextpnr -- Next Generation Place and Route
- *
- * 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