diff options
author | Eddie Hung <eddie.hung+gitlab@gmail.com> | 2018-07-19 14:57:38 +0000 |
---|---|---|
committer | Eddie Hung <eddie.hung+gitlab@gmail.com> | 2018-07-19 14:57:38 +0000 |
commit | 6e7ba2a2be87bb1e0f323128283a87f59af596b7 (patch) | |
tree | 2c442484baa82bad58821887788485903a0f5e85 /common/nextpnr.h | |
parent | 7e6332735d12f2e5ab9128648ed444bc123df512 (diff) | |
parent | 79dc910b40b082c9d74d010557b7939fb18535fe (diff) | |
download | nextpnr-6e7ba2a2be87bb1e0f323128283a87f59af596b7.tar.gz nextpnr-6e7ba2a2be87bb1e0f323128283a87f59af596b7.tar.bz2 nextpnr-6e7ba2a2be87bb1e0f323128283a87f59af596b7.zip |
Merge branch 'master' into 'master'
Master
See merge request eddiehung/nextpnr!4
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r-- | common/nextpnr.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h index 3d0cc955..bc64adb5 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; @@ -203,6 +204,8 @@ struct PipMap struct NetInfo : ArchNetInfo { IdString name; + int32_t udata; + PortRef driver; std::vector<PortRef> users; std::unordered_map<IdString, std::string> attrs; @@ -228,6 +231,8 @@ struct PortInfo struct CellInfo : ArchCellInfo { IdString name, type; + int32_t udata; + std::unordered_map<IdString, PortInfo> ports; std::unordered_map<IdString, std::string> attrs, params; |