aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.h
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-07-20 17:13:26 +0200
committerClifford Wolf <clifford@clifford.at>2018-07-20 17:13:26 +0200
commite16b4a325e2b0721e29cba93804923dedf74a68c (patch)
treea80aa31ed8be848d460cd90410a91f24da14cea9 /common/nextpnr.h
parentc0f1af87f6c1c6843e536a87ef88e39fa3428c5b (diff)
parent6c835d76f27af79813299419780c039eb2a8b02e (diff)
downloadnextpnr-e16b4a325e2b0721e29cba93804923dedf74a68c.tar.gz
nextpnr-e16b4a325e2b0721e29cba93804923dedf74a68c.tar.bz2
nextpnr-e16b4a325e2b0721e29cba93804923dedf74a68c.zip
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr into gridapi
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r--common/nextpnr.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index 375e1cd7..8ef958cd 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -72,21 +72,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 BaseCtx;
struct Context;
@@ -205,9 +206,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;
@@ -230,9 +233,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;