From f0a8713fea9fea016e5a83fefd9e00a32f4a88d2 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 15 Aug 2016 08:26:20 +0200 Subject: [PATCH] Fixed upto handling in verilog back-end --- backends/verilog/verilog_backend.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backends/verilog/verilog_backend.cc b/backends/verilog/verilog_backend.cc index caa668c33..705d74aa1 100644 --- a/backends/verilog/verilog_backend.cc +++ b/backends/verilog/verilog_backend.cc @@ -141,6 +141,9 @@ bool is_reg_wire(RTLIL::SigSpec sig, std::string ®_name) if (sig.size() != chunk.wire->width) { if (sig.size() == 1) reg_name += stringf("[%d]", chunk.wire->start_offset + chunk.offset); + else if (chunk.wire->upto) + reg_name += stringf("[%d:%d]", (chunk.wire->width - (chunk.offset + chunk.width - 1) - 1) + chunk.wire->start_offset, + (chunk.wire->width - chunk.offset - 1) + chunk.wire->start_offset); else reg_name += stringf("[%d:%d]", chunk.wire->start_offset + chunk.offset + chunk.width - 1, chunk.wire->start_offset + chunk.offset); -- 2.30.2