From: Clifford Wolf Date: Wed, 23 Nov 2016 12:46:03 +0000 (+0100) Subject: Added wire start_offset and upto handling to splitnets cmd X-Git-Tag: yosys-0.8~578 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e444e59963bae07df59f13af5cb52b3a3cae2720;p=yosys.git Added wire start_offset and upto handling to splitnets cmd --- diff --git a/passes/cmds/splitnets.cc b/passes/cmds/splitnets.cc index 14eeb066f..5e37fc597 100644 --- a/passes/cmds/splitnets.cc +++ b/passes/cmds/splitnets.cc @@ -37,14 +37,20 @@ struct SplitnetsWorker new_wire_name += format.substr(0, 1); if (width > 1) { - new_wire_name += stringf("%d", offset+width-1); + if (wire->upto) + new_wire_name += stringf("%d", wire->start_offset+wire->width-(offset+width)-1); + else + new_wire_name += stringf("%d", wire->start_offset+offset+width-1); if (format.size() > 2) new_wire_name += format.substr(2, 1); else new_wire_name += ":"; } - new_wire_name += stringf("%d", offset); + if (wire->upto) + new_wire_name += stringf("%d", wire->start_offset+wire->width-offset-1); + else + new_wire_name += stringf("%d", wire->start_offset+offset); if (format.size() > 1) new_wire_name += format.substr(1, 1);