From ddfc535df766a8d6091e6c043b74bb6a40c8d2b7 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 17 Jul 2018 20:04:49 +0200 Subject: Add ArchNetInfo and ArchCellInfo Signed-off-by: Clifford Wolf --- common/nextpnr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/nextpnr.h b/common/nextpnr.h index 50465869..3d0cc955 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -200,7 +200,7 @@ struct PipMap PlaceStrength strength = STRENGTH_NONE; }; -struct NetInfo +struct NetInfo : ArchNetInfo { IdString name; PortRef driver; @@ -225,7 +225,7 @@ struct PortInfo PortType type; }; -struct CellInfo +struct CellInfo : ArchCellInfo { IdString name, type; std::unordered_map ports; -- cgit v1.2.3 From 609794f9e6561fec1324ee554d85742e13e3d513 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 18 Jul 2018 13:29:58 +0200 Subject: Add Net/Cell "udata" field Signed-off-by: Clifford Wolf --- common/nextpnr.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common') diff --git a/common/nextpnr.h b/common/nextpnr.h index 3d0cc955..f808faf8 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -203,6 +203,8 @@ struct PipMap struct NetInfo : ArchNetInfo { IdString name; + int32_t udata; + PortRef driver; std::vector users; std::unordered_map attrs; @@ -228,6 +230,8 @@ struct PortInfo struct CellInfo : ArchCellInfo { IdString name, type; + int32_t udata; + std::unordered_map ports; std::unordered_map attrs, params; -- cgit v1.2.3 From d221e90706915c8ba540805167c8e9e07d4c3d6f Mon Sep 17 00:00:00 2001 From: David Shah Date: Thu, 19 Jul 2018 11:43:10 +0200 Subject: Reducing performance cost of asserts Signed-off-by: David Shah --- common/nextpnr.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'common') diff --git a/common/nextpnr.h b/common/nextpnr.h index f808faf8..7aadfae4 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -72,21 +72,23 @@ 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; -- cgit v1.2.3 From 6c38df7295747ddd37a751ea5de2a73e95a021d1 Mon Sep 17 00:00:00 2001 From: David Shah Date: Thu, 19 Jul 2018 13:22:46 +0200 Subject: ice40: Adding cell definition for DSPs Signed-off-by: David Shah --- common/nextpnr.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'common') diff --git a/common/nextpnr.h b/common/nextpnr.h index 7aadfae4..bc64adb5 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -84,9 +84,8 @@ inline bool assert_fail_impl_str(std::string message, const char *expr_str, cons throw assertion_failure(message, expr_str, filename, 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_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__)) -- cgit v1.2.3