From 1e3ed3b463244cde08490359c9a98718e0e59f6b Mon Sep 17 00:00:00 2001 From: Rick Altherr Date: Thu, 20 Jun 2024 12:56:46 -0700 Subject: [PATCH 1/2] Fix VCD timestamps. VCD simulation timestamps are integers. eb71c31cf1b5d1fb70f12a18c459e17e16813f30 changed them to doubles which causes the files to be unreadable. --- cpp/scsimon/sm_vcd_report.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/scsimon/sm_vcd_report.cpp b/cpp/scsimon/sm_vcd_report.cpp index be6f103561..01b8f21ebd 100644 --- a/cpp/scsimon/sm_vcd_report.cpp +++ b/cpp/scsimon/sm_vcd_report.cpp @@ -130,7 +130,7 @@ void scsimon_generate_value_change_dump(const string &filename, const vector cur_sample : data_capture_array) { - vcd_ofstream << "#" << (double)cur_sample->GetTimestamp() * ScsiMon::ns_per_loop << endl; + vcd_ofstream << "#" << (uint64_t)((double)cur_sample->GetTimestamp() * ScsiMon::ns_per_loop) << endl; vcd_output_if_changed_bool(vcd_ofstream, cur_sample->GetBSY(), PIN_BSY, SYMBOL_PIN_BSY); vcd_output_if_changed_bool(vcd_ofstream, cur_sample->GetSEL(), PIN_SEL, SYMBOL_PIN_SEL); vcd_output_if_changed_bool(vcd_ofstream, cur_sample->GetCD(), PIN_CD, SYMBOL_PIN_CD); From dd175361efbb97d50f49e4bfd907efb0d2c2d20a Mon Sep 17 00:00:00 2001 From: Rick Altherr Date: Thu, 20 Jun 2024 14:51:17 -0700 Subject: [PATCH 2/2] Fix VCD byte values no spaces allowed between b and the bits. Value will be left-extended with zeros. --- cpp/scsimon/sm_vcd_report.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/scsimon/sm_vcd_report.cpp b/cpp/scsimon/sm_vcd_report.cpp index 01b8f21ebd..7cf847114a 100644 --- a/cpp/scsimon/sm_vcd_report.cpp +++ b/cpp/scsimon/sm_vcd_report.cpp @@ -71,7 +71,7 @@ static void vcd_output_if_changed_byte(ofstream &fp, uint8_t data, int pin, char { if (prev_value[pin] != data) { prev_value[pin] = data; - fp << "b" << fmt::format("{0:8b}", data) << " " << symbol << endl; + fp << "b" << fmt::format("{0:b}", data) << " " << symbol << endl; } }