diff --git a/migen/fhdl/specials.py b/migen/fhdl/specials.py index 93440875..c98af04f 100644 --- a/migen/fhdl/specials.py +++ b/migen/fhdl/specials.py @@ -388,7 +388,7 @@ def gn(e): content = "" formatter = "{:0" + str(int(memory.width / 4)) + "X}\n" for d in memory.init: - content += formatter.format(d) + content += formatter.format(d).zfill(int(-(-memory.width // 4))) memory_filename = add_data_file(gn(memory) + ".init", content) r += "initial begin\n"