17
17
*
18
18
*/
19
19
20
- #include < cassert>
21
20
#include " kernel/yosys.h"
22
21
#include " kernel/drivertools.h"
23
22
#include " kernel/topo_scc.h"
@@ -38,7 +37,7 @@ const char *reserved_keywords[] = {
38
37
" int" ," long" ," mutable" ," namespace" ," new" ," noexcept" ," not" ," not_eq" ,
39
38
" nullptr" ," operator" ," or" ," or_eq" ," private" ," protected" ," public" ,
40
39
" reflexpr" ," register" ," reinterpret_cast" ," requires" ," return" ," short" ,
41
- " signed" ," sizeof" ," static" ," static_assert " ," static_cast" ," struct" ,
40
+ " signed" ," sizeof" ," static" ," static_log_assert " ," static_cast" ," struct" ,
42
41
" switch" ," synchronized" ," template" ," this" ," thread_local" ," throw" ,
43
42
" true" ," try" ," typedef" ," typeid" ," typename" ," union" ," unsigned" ,
44
43
" using" ," virtual" ," void" ," volatile" ," wchar_t" ," while" ," xor" ," xor_eq" ,
@@ -193,11 +192,11 @@ class CxxComputeGraphFactory {
193
192
public:
194
193
CxxComputeGraphFactory (CxxComputeGraph &g) : graph(g) {}
195
194
T slice (T a, int in_width, int offset, int out_width) {
196
- assert (offset + out_width <= in_width);
195
+ log_assert (offset + out_width <= in_width);
197
196
return graph.add (CxxFunction (ID ($$slice), out_width, {{ID (offset), offset}}), 0 , std::array<T, 1 >{a});
198
197
}
199
198
T extend (T a, int in_width, int out_width, bool is_signed) {
200
- assert (in_width < out_width);
199
+ log_assert (in_width < out_width);
201
200
if (is_signed)
202
201
return graph.add (CxxFunction (ID ($sign_extend), out_width, {{ID (WIDTH), out_width}}), 0 , std::array<T, 1 >{a});
203
202
else
@@ -250,7 +249,7 @@ class CxxComputeGraphFactory {
250
249
return graph.add (CxxFunction (ID ($$pending), width), 0 );
251
250
}
252
251
void update_pending (T pending, T node) {
253
- assert (pending.function ().name == ID ($$pending));
252
+ log_assert (pending.function ().name == ID ($$pending));
254
253
pending.set_function (CxxFunction (ID ($$buf), pending.function ().width ));
255
254
pending.append_arg (node);
256
255
}
0 commit comments