Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleInst.connect() to leave physical Net alone for pass-thrus #722

Merged
merged 12 commits into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions src/com/xilinx/rapidwright/design/ModuleInst.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Original work: Copyright (c) 2010-2011 Brigham Young University
* Modified work: Copyright (c) 2017-2022, Xilinx, Inc.
* Copyright (c) 2022, Advanced Micro Devices, Inc.
* Copyright (c) 2022-2023, Advanced Micro Devices, Inc.
* All rights reserved.
*
* Author: Chris Lavin, Xilinx Research Labs.
Expand Down Expand Up @@ -39,7 +39,9 @@
import com.xilinx.rapidwright.device.Site;
import com.xilinx.rapidwright.device.SiteTypeEnum;
import com.xilinx.rapidwright.device.Tile;
import com.xilinx.rapidwright.edif.EDIFCell;
import com.xilinx.rapidwright.edif.EDIFNet;
import com.xilinx.rapidwright.edif.EDIFPortInst;
import com.xilinx.rapidwright.edif.EDIFTools;
import com.xilinx.rapidwright.util.MessageGenerator;
import com.xilinx.rapidwright.util.Utils;

Expand Down Expand Up @@ -692,10 +694,24 @@ public void connect(String portName, int busIndex0, ModuleInst other, String oth
if (p0.isOutPort()) {
physicalNet = getCorrespondingNet(p0);
if (physicalNet == null) {
// This is a pass-thru situation and we'll need to create the net
EDIFCell top = getCellInst().getParentCell();
String newNetName = super.getNewNetName(portName, busIndex0, other, otherPortName, busIndex1);
physicalNet = design.createNet(newNetName);
if (p0.getType() == PortType.UNCONNECTED) {
return;
}
if (p0.getType() == PortType.POWER) {
physicalNet = design.getVccNet();
} else if (p0.getType() == PortType.GROUND) {
physicalNet = design.getGndNet();
} else {
// This must be a pass-thru situation
List<String> passThruPortNames = p0.getPassThruPortNames();
if (passThruPortNames.isEmpty()) {
throw new RuntimeException("Expecting a pass-thru situation");
}

// No updates needed for the physical netlist -- with the logical netlist
// already updated, the two physical nets will be interpreted as aliases
return;
}
}
inPort = p1;
modInst = other;
Expand Down