From 238a5809bf57c728b1adddbde0b721873cacefc1 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 28 Apr 2015 21:31:25 -0400 Subject: [PATCH] Fix truncation warning with -pins-bv, bug912. --- Changes | 6 ++++-- include/verilated.h | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index 769aeafe8..805c621e8 100644 --- a/Changes +++ b/Changes @@ -5,9 +5,11 @@ indicates the contributor was also the author of the fix; Thanks! * Verilator 3.873 devel -**** Fix installing missing manpages, bug908. [Ahmed El-Mahmoudy] +**** Fix installing missing manpages, bug908. [Ahmed El-Mahmoudy] -**** Fix core dump in sync-async warnings, bug911. [Sebastian Dressler] +**** Fix core dump in sync-async warnings, bug911. [Sebastian Dressler] + +**** Fix truncation warning with -pins-bv, bug912. [Alfonso Martinez] * Verilator 3.872 2015-04-05 diff --git a/include/verilated.h b/include/verilated.h index b531e7d58..e8504a3f2 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -594,13 +594,13 @@ static inline void VL_ASSIGNBIT_WO(int, int bit, WDataOutP owp, IData) { #define VL_ASSIGN_SWI(obits,svar,rd) { \ sc_bv _bvtemp; \ - _bvtemp.set_word(0,rd); \ + _bvtemp.set_word(0,(rd)); \ svar.write(_bvtemp); \ } #define VL_ASSIGN_SWQ(obits,svar,rd) { \ sc_bv _bvtemp; \ - _bvtemp.set_word(0,rd); \ - _bvtemp.set_word(1,rd>>VL_WORDSIZE); \ + _bvtemp.set_word(0,(IData)(rd)); \ + _bvtemp.set_word(1,(IData)((rd)>>VL_WORDSIZE)); \ svar.write(_bvtemp); \ } #define VL_ASSIGN_SWW(obits,svar,rwp) { \