aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/place.cc4
-rw-r--r--dummy/arch_place.cc25
-rw-r--r--dummy/arch_place.h32
-rw-r--r--ice40/arch_place.h2
4 files changed, 61 insertions, 2 deletions
diff --git a/common/place.cc b/common/place.cc
index 0223c78f..b187b0f0 100644
--- a/common/place.cc
+++ b/common/place.cc
@@ -28,6 +28,7 @@
#include <string.h>
#include <vector>
+#include "arch_place.h"
#include "log.h"
#include "place.h"
@@ -102,7 +103,8 @@ void place_design(Design *design)
while ((bi != blist.end()) &&
((design->chip.getBelType(*bi) != bel_type ||
- !design->chip.checkBelAvail(*bi))))
+ !design->chip.checkBelAvail(*bi)) ||
+ !isValidBelForCell(design, cell, *bi)))
bi++;
if (bi == blist.end())
log_error("Too many \'%s\' used in design\n",
diff --git a/dummy/arch_place.cc b/dummy/arch_place.cc
new file mode 100644
index 00000000..e41b8cc3
--- /dev/null
+++ b/dummy/arch_place.cc
@@ -0,0 +1,25 @@
+/*
+ * nextpnr -- Next Generation Place and Route
+ *
+ * Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
+ *
+ * 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.
+ *
+ */
+
+#include "arch_place.h"
+
+bool isValidBelForCell(Design *design, CellInfo *cell, BelId bel)
+{
+ return true;
+}
diff --git a/dummy/arch_place.h b/dummy/arch_place.h
new file mode 100644
index 00000000..446396e9
--- /dev/null
+++ b/dummy/arch_place.h
@@ -0,0 +1,32 @@
+/*
+ * nextpnr -- Next Generation Place and Route
+ *
+ * Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
+ *
+ * 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 DUMMY_ARCH_PLACE_H
+#define DUMMY_ARCH_PLACE_H
+
+#include "nextpnr.h"
+
+// Architecure-specific placement functions
+
+// Whether or not a given cell can be placed at a given Bel
+// This is not intended for Bel type checks, but finer-grained constraints
+// such as conflicting set/reset signals, etc
+bool isValidBelForCell(Design *design, CellInfo *cell, BelId bel);
+
+#endif
diff --git a/ice40/arch_place.h b/ice40/arch_place.h
index 19b0635f..8f8ce806 100644
--- a/ice40/arch_place.h
+++ b/ice40/arch_place.h
@@ -26,6 +26,6 @@
// Whether or not a given cell can be placed at a given Bel
// This is not intended for Bel type checks, but finer-grained constraints
// such as conflicting set/reset signals, etc
-bool isValidBelForCell(Chip *chip, CellInfo *cell, BelId bel);
+bool isValidBelForCell(Design *design, CellInfo *cell, BelId bel);
#endif