From 1b93dda03718154fe4c5d292e53c0514bf1e633b Mon Sep 17 00:00:00 2001 From: David Shah Date: Sat, 25 Apr 2020 10:42:21 +0100 Subject: [PATCH] cxxrtl: Round up constant width Signed-off-by: David Shah --- backends/cxxrtl/cxxrtl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/cxxrtl/cxxrtl.cc b/backends/cxxrtl/cxxrtl.cc index e5351a387..e7711962f 100644 --- a/backends/cxxrtl/cxxrtl.cc +++ b/backends/cxxrtl/cxxrtl.cc @@ -732,7 +732,7 @@ struct CxxrtlWorker { int chunk_width = min(width, CHUNK_SIZE); uint32_t chunk = data.extract(offset, chunk_width).as_int(); if (fixed_width) - f << stringf("0x%.*xu", chunk_width / 4, chunk); + f << stringf("0x%.*xu", (3 + chunk_width) / 4, chunk); else f << stringf("%#xu", chunk); if (width > CHUNK_SIZE) -- 2.30.2