Skip to content

Commit 2dbdc85

Browse files
committed
Tweak assertions to match tool and nvhls_assert updates and constraints
1 parent 960170e commit 2dbdc85

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

cmod/include/ReorderBuf.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ class ReorderBuf {
134134
EntryNum entryNum = id2entry.read(static_cast<typename Id2Entry::LocalIndex>(id), 0);
135135
storage.write(entryNum, 0, data);
136136
vbits.fifo_body.write(static_cast<typename VBits::FifoIdx>(entryNum), 0, true);
137-
NVHLS_ASSERT_MSG(idrep[static_cast<int>(id)] == 1, "idrep[id]!=1");
137+
// [FIXME] Enabling this assertion causes scheduling failures in Catapult v2025.3
138+
//NVHLS_ASSERT_MSG(idrep[static_cast<int>(id)] == 1, "idrep[id]!=1");
138139
idrep[static_cast<int>(id)]=0;
139140
}
140141

cmod/include/Scratchpad.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ class Scratchpad : public sc_module {
364364
* }
365365
*
366366
* void set(unsigned idx, addr_t _addr, word_type _data=0) {
367-
* sc_assert(idx < num_inputs);
367+
* NVHLS_ASSERT(idx < num_inputs);
368368
* this->valids[idx] = 1;
369369
* this->addr[idx] = _addr;
370370
* this->data[idx] = _data;
@@ -424,7 +424,7 @@ struct ScratchpadTraits {
424424
}
425425

426426
void set(unsigned idx, addr_t _addr, word_type _data=0) {
427-
sc_assert(idx < num_inputs);
427+
NVHLS_ASSERT(idx < num_inputs);
428428
this->valids[idx] = 1;
429429
this->addr[idx] = _addr;
430430
this->data[idx] = _data;

cmod/include/nvhls_array.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
#include <cstddef>
21-
#include <ac_assert.h>
21+
#include <nvhls_assert.h>
2222
#include <list>
2323
#include "systemc.h"
2424

@@ -91,16 +91,12 @@ class nv_array_bank_array_no_assert_base
9191
{}
9292

9393
B &operator[](size_t idx) {
94-
#ifndef __SYNTHESIS__
95-
assert(idx < C);
96-
#endif
94+
CMOD_ASSERT(idx < C);
9795
size_t aidx = idx & (W-1); return idx&W ? a1[aidx] : a0[aidx];
9896
}
9997

10098
const B &operator[](size_t idx) const {
101-
#ifndef __SYNTHESIS__
102-
assert(idx < C);
103-
#endif
99+
CMOD_ASSERT(idx < C);
104100
size_t aidx = idx & (W-1); return idx&W ? a1[aidx] : a0[aidx];
105101
}
106102
};

0 commit comments

Comments
 (0)