For passing Verilator regression
- Eliminate strict aliasing - Include .cpp in verilated_fst_c.cpp directly as WS suggested
This commit is contained in:
parent
e97243f173
commit
5bf639e673
|
|
@ -310,7 +310,8 @@ public:
|
|||
info.resize(needed);
|
||||
EmitWriterHelper wh(info.data_ptr());
|
||||
const double nan_val = std::numeric_limits<double>::quiet_NaN();
|
||||
const uint64_t nan_val_u64 = *reinterpret_cast<const uint64_t *>(&nan_val);
|
||||
uint64_t nan_val_u64;
|
||||
std::memcpy(&nan_val_u64, &nan_val, sizeof(nan_val_u64));
|
||||
wh.writeTimeIndexAndEncoding(0, EncodingType::BINARY).write<uint64_t>(nan_val_u64);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ void Writer::emitValueChange(Handle handle, const char *val) {
|
|||
FST_DCHECK_NE(bitwidth, 0);
|
||||
|
||||
val += bitwidth;
|
||||
thread_local static std::vector<uint64_t> t_packed_value_buffer;
|
||||
static std::vector<uint64_t> t_packed_value_buffer;
|
||||
const unsigned num_words{(bitwidth + 63) / 64};
|
||||
t_packed_value_buffer.assign(num_words, 0);
|
||||
for (unsigned i = 0; i < num_words; ++i) {
|
||||
|
|
|
|||
|
|
@ -208,7 +208,6 @@ VK_USER_OBJS = $(addsuffix .o, $(VM_USER_CLASSES))
|
|||
|
||||
ifneq ($(VM_TRACE_FST),0)
|
||||
ifneq ($(VM_TRACE_FST),)
|
||||
VM_GLOBAL_FAST += fstcpp_writer fstcpp_variable_info
|
||||
LDLIBS = -llz4 -lz
|
||||
endif
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@
|
|||
#include "verilated.h"
|
||||
#include "verilated_fst_c.h"
|
||||
|
||||
// Include fstcpp library
|
||||
#include "fstcpp/fstcpp.h"
|
||||
#include "fstcpp/fstcpp_writer.h"
|
||||
// Include fstcpp cpp file directly
|
||||
#include "fstcpp/fstcpp_variable_info.cpp"
|
||||
#include "fstcpp/fstcpp_writer.cpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
|
@ -453,5 +453,7 @@ void VerilatedFstBuffer::emitWData(uint32_t code, const WData* newvalp, int bits
|
|||
VL_ATTR_ALWINLINE
|
||||
void VerilatedFstBuffer::emitDouble(uint32_t code, double newval) {
|
||||
m_owner.emitTimeChangeMaybe();
|
||||
m_fst->emitValueChange(m_symbolp[code], *reinterpret_cast<const uint64_t*>(&newval));
|
||||
uint64_t newval_u64;
|
||||
std::memcpy(&newval_u64, &newval, sizeof(newval_u64));
|
||||
m_fst->emitValueChange(m_symbolp[code], newval_u64);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import vltest_bootstrap
|
|||
|
||||
test.scenarios('dist')
|
||||
|
||||
Tabs_Exempt_Re = r'(\.out$)|(/gtkwave)|(Makefile)|(\.mk$)|(\.mk\.in$)|test_regress/t/t_preproc\.v|install-sh'
|
||||
Tabs_Exempt_Re = r'(\.out$)|(/fstcpp)|(Makefile)|(\.mk$)|(\.mk\.in$)|test_regress/t/t_preproc\.v|install-sh'
|
||||
|
||||
Unicode_Exempt_Re = r'(Changes$|CONTRIBUTORS$|LICENSES?|contributors.rst$|spelling.txt$)'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue