3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-05-12 21:26:26 +00:00

Make sure co-simulation only uses integer arithmetic

This commit is contained in:
Scott Ashcroft 2026-04-23 13:55:08 +01:00 committed by stashcroft
parent 7e7336cdb8
commit e69341cd5f
3 changed files with 38 additions and 25 deletions

View file

@ -45,8 +45,7 @@ FstData::FstData(std::string filename) : ctx(nullptr)
ctx = (fstReaderContext *)fstReaderOpen(filename.c_str());
if (!ctx)
log_error("Error opening '%s' as FST file\n", filename);
int scale = (int)fstReaderGetTimescale(ctx);
timescale = pow(10.0, scale);
scale = (int)fstReaderGetTimescale(ctx);
timescale_str = "";
int unit = 0;
int zeros = 0;

View file

@ -55,7 +55,7 @@ class FstData
std::string valueOf(fstHandle signal);
fstHandle getHandle(std::string name);
dict<int,fstHandle> getMemoryHandles(std::string name);
double getTimescale() { return timescale; }
int getScale() { return scale; }
const char *getTimescaleString() { return timescale_str.c_str(); }
private:
void extractVarNames();
@ -69,7 +69,7 @@ private:
uint64_t last_time;
std::map<fstHandle, std::string> past_data;
uint64_t past_time;
double timescale;
int scale;
std::string timescale_str;
uint64_t start_time;
uint64_t end_time;