aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSergiusz Bazanski <q3k@q3k.org>2018-07-20 10:59:33 +0100
committerSergiusz Bazanski <q3k@q3k.org>2018-07-20 10:59:33 +0100
commit55d5f8f248a00581e54b818d747d5f42ddb5f6bb (patch)
tree4f40c21efb01e6d341fd13ca8e74c1f640b483e8 /common
parent0385ad1b1cc3dcd4673b3c674bc28ca12a7c7450 (diff)
parent3bad9c26cff1ba2da7f1810e5915246874780744 (diff)
downloadnextpnr-55d5f8f248a00581e54b818d747d5f42ddb5f6bb.tar.gz
nextpnr-55d5f8f248a00581e54b818d747d5f42ddb5f6bb.tar.bz2
nextpnr-55d5f8f248a00581e54b818d747d5f42ddb5f6bb.zip
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr into q3k/lock-2-electric-boogaloo
Diffstat (limited to 'common')
-rw-r--r--common/nextpnr.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index fb5e042b..2a416a05 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -75,21 +75,22 @@ class assertion_failure : public std::runtime_error
int line;
};
-inline void except_assert_impl(bool expr, const char *message, const char *expr_str, const char *filename, int line)
+NPNR_NORETURN
+inline bool assert_fail_impl(const char *message, const char *expr_str, const char *filename, int line)
{
- if (!expr)
- throw assertion_failure(message, expr_str, filename, line);
+ throw assertion_failure(message, expr_str, filename, line);
}
NPNR_NORETURN
-inline void assert_false_impl(std::string message, std::string filename, int line)
+inline bool assert_fail_impl_str(std::string message, const char *expr_str, const char *filename, int line)
{
- throw assertion_failure(message, "false", filename, line);
+ throw assertion_failure(message, expr_str, filename, line);
}
-#define NPNR_ASSERT(cond) except_assert_impl((cond), #cond, #cond, __FILE__, __LINE__)
-#define NPNR_ASSERT_MSG(cond, msg) except_assert_impl((cond), msg, #cond, __FILE__, __LINE__)
-#define NPNR_ASSERT_FALSE(msg) assert_false_impl(msg, __FILE__, __LINE__)
+#define NPNR_ASSERT(cond) ((void)((cond) || (assert_fail_impl(#cond, #cond, __FILE__, __LINE__))))
+#define NPNR_ASSERT_MSG(cond, msg) ((void)((cond) || (assert_fail_impl(msg, #cond, __FILE__, __LINE__))))
+#define NPNR_ASSERT_FALSE(msg) (assert_fail_impl(msg, "false", __FILE__, __LINE__))
+#define NPNR_ASSERT_FALSE_STR(msg) (assert_fail_impl_str(msg, "false", __FILE__, __LINE__))
struct IdStringDB;
struct Context;
@@ -203,9 +204,11 @@ struct PipMap
PlaceStrength strength = STRENGTH_NONE;
};
-struct NetInfo
+struct NetInfo : ArchNetInfo
{
IdString name;
+ int32_t udata;
+
PortRef driver;
std::vector<PortRef> users;
std::unordered_map<IdString, std::string> attrs;
@@ -228,9 +231,11 @@ struct PortInfo
PortType type;
};
-struct CellInfo
+struct CellInfo : ArchCellInfo
{
IdString name, type;
+ int32_t udata;
+
std::unordered_map<IdString, PortInfo> ports;
std::unordered_map<IdString, std::string> attrs, params;