Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b750873
Initial Schematic viewer with several issues.
clavin-xlnx Oct 7, 2025
1723d81
Fix minor issues
clavin-xlnx Oct 7, 2025
dac59d5
Fixes minor rendering issues
clavin-xlnx Oct 7, 2025
81dfd06
Fixes around labeling and refactoring
clavin-xlnx Oct 7, 2025
255afe0
Fix top port labels
clavin-xlnx Oct 7, 2025
205a841
Fix hier-cell pin labels
clavin-xlnx Oct 13, 2025
e76f413
Fix hier button, still needs work for internal routes
clavin-xlnx Oct 14, 2025
5d03f30
Fixes nets inside expanded cells
clavin-xlnx Oct 14, 2025
13872ef
Move button to top left corner of expanded cells
clavin-xlnx Oct 14, 2025
b0681dc
Fix padding/spacing around labels and buttons
clavin-xlnx Oct 14, 2025
da2a488
Fixing multiple hier view, switch from EDIFCell->EDIFHierCellInst
clavin-xlnx Oct 14, 2025
df3d101
Basic selection using Strings, still WIP
clavin-xlnx Nov 8, 2025
36d20b3
Fixes various bugs
clavin-xlnx Nov 11, 2025
fd7ca86
Refactor to use all EDIFHier classes
clavin-xlnx Nov 11, 2025
097d82a
Fix disconnected ports
clavin-xlnx Nov 11, 2025
9bd14eb
Fix NPE
clavin-xlnx Nov 11, 2025
7b79568
Fix multi-level hierarchy issue.
clavin-xlnx Nov 12, 2025
bbf1288
Fixing Z layers
clavin-xlnx Nov 12, 2025
ac67ac0
Update for ELK and Guava license inclusion.
clavin-xlnx Nov 12, 2025
de84685
Merge branch '2025.2.0' into schematic
clavin-xlnx Nov 12, 2025
e1995b8
Cleanup
clavin-xlnx Nov 12, 2025
b5f84d1
Temporarily remove cache
clavin-xlnx Nov 12, 2025
58e894c
Restore cache entry
clavin-xlnx Nov 12, 2025
899fbd8
Update Jar test
clavin-xlnx Nov 12, 2025
1e96ef6
List jars
clavin-xlnx Nov 12, 2025
5b33a71
Rename cache
clavin-xlnx Nov 12, 2025
107791b
Try new gradle home dir
clavin-xlnx Nov 12, 2025
2c695c4
More debug
clavin-xlnx Nov 12, 2025
8ba6fb3
Remove env
clavin-xlnx Nov 12, 2025
fd67f26
Fix NPE on inner port
clavin-xlnx Nov 12, 2025
80db61c
Enable top selection
clavin-xlnx Nov 12, 2025
9c4f2c8
Add zoom to fit when selecting a new cell.
clavin-xlnx Nov 13, 2025
28db488
Workaround to support JDK8 execution with ELK
clavin-xlnx Nov 13, 2025
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
16 changes: 16 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,21 @@
<classpathentry kind="lib" path="jars/junit-platform-launcher-1.7.1.jar"/>
<classpathentry kind="lib" path="jars/junit-platform-reporting-1.7.1.jar"/>
<classpathentry kind="lib" path="jars/zstd-jni-1.5.5-1.jar"/>
<classpathentry kind="lib" path="jars/apiguardian-api-1.1.0.jar"/>
<classpathentry kind="lib" path="jars/error_prone_annotations-2.41.0.jar"/>
<classpathentry kind="lib" path="jars/failureaccess-1.0.3.jar"/>
<classpathentry kind="lib" path="jars/guava-33.5.0-jre.jar"/>
<classpathentry kind="lib" path="jars/j2objc-annotations-3.1.jar"/>
<classpathentry kind="lib" path="jars/jheaps-0.9.jar"/>
<classpathentry kind="lib" path="jars/jnacl-1.0.0.jar"/>
<classpathentry kind="lib" path="jars/jspecify-1.0.0.jar"/>
<classpathentry kind="lib" path="jars/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar"/>
<classpathentry kind="lib" path="jars/org.eclipse.elk.alg.common-0.10.0.jar"/>
<classpathentry kind="lib" path="jars/org.eclipse.elk.alg.layered-0.10.0.jar"/>
<classpathentry kind="lib" path="jars/org.eclipse.elk.core-0.10.0.jar"/>
<classpathentry kind="lib" path="jars/org.eclipse.elk.graph-0.10.0.jar"/>
<classpathentry kind="lib" path="jars/org.eclipse.emf.common-2.12.0.jar"/>
<classpathentry kind="lib" path="jars/org.eclipse.emf.ecore.xmi-2.12.0.jar"/>
<classpathentry kind="lib" path="jars/org.eclipse.emf.ecore-2.12.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
4 changes: 2 additions & 2 deletions .github/workflows/test-rapidwright-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup JDK 1.11
- name: Setup JDK 1.17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
cache: 'gradle'

- name: Compile
Expand Down
274 changes: 272 additions & 2 deletions LICENSE.TXT

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ dependencies {
api 'commons-io:commons-io:2.20.0'
api 'com.xilinx.rapidwright:qtjambi-'+os+':4.5.2_01'
api 'com.xilinx.rapidwright:jupyter-kernel-jsr223:1.0.1'
if (JavaVersion.current() < JavaVersion.VERSION_17) {
// Eclipse ELK doesn't compile to support JDK8 anymore
api 'com.xilinx.rapidwright:org.eclipse.elk-deps-jdk8:0.10.0-rc1'
} else {
api 'org.eclipse.elk:org.eclipse.elk.core:0.10.0'
api 'org.eclipse.elk:org.eclipse.elk.graph:0.10.0'
api 'org.eclipse.elk:org.eclipse.elk.alg.layered:0.10.0'
}
api 'com.xilinx.rapidwright:jacl:1.4.1'
testFixturesApi 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testFixturesApi 'org.junit.jupiter:junit-jupiter-engine:5.7.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public HierCellInstTreeWidgetItem(QTreeWidgetItem parent) {
super(parent);
}

public HierCellInstTreeWidgetItem(NetlistTreeWidget netlistTreeWidget) {
super(netlistTreeWidget);
}

public void setInst(EDIFHierCellInst inst) {
this.inst = inst;
}
Expand Down
46 changes: 44 additions & 2 deletions src/com/xilinx/rapidwright/gui/NetlistBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,30 @@
*/
package com.xilinx.rapidwright.gui;

import com.trolltech.qt.core.QModelIndex;
import com.trolltech.qt.core.Qt.DockWidgetArea;
import com.trolltech.qt.gui.QApplication;
import com.trolltech.qt.gui.QDockWidget;
import com.trolltech.qt.gui.QDockWidget.DockWidgetFeature;
import com.trolltech.qt.gui.QMainWindow;
import com.trolltech.qt.gui.QTreeWidget;
import com.trolltech.qt.gui.QTreeWidgetItem;
import com.trolltech.qt.gui.QWidget;
import com.xilinx.rapidwright.design.Design;
import com.xilinx.rapidwright.edif.EDIFCell;
import com.xilinx.rapidwright.edif.EDIFCellInst;
import com.xilinx.rapidwright.edif.EDIFHierCellInst;
import com.xilinx.rapidwright.edif.EDIFNet;
import com.xilinx.rapidwright.edif.EDIFNetlist;
import com.xilinx.rapidwright.edif.EDIFPort;
import com.xilinx.rapidwright.edif.EDIFTools;

public class NetlistBrowser extends QMainWindow {

private QTreeWidget treeWidget;
private NetlistTreeWidget treeWidget;
private QDockWidget schematicWidget;
private SchematicScene schematicScene;
private SchematicView schematicView;

private Design design;

Expand Down Expand Up @@ -90,12 +100,44 @@ private void init() {
resize(1280, 1024);

treeWidget = new NetlistTreeWidget("Netlist", netlist);
// treeWidget.doubleClicked.connect(this,"showPart(QModelIndex)");
treeWidget.clicked.connect(this, "selectNetlistItem(QModelIndex)");

QDockWidget dockWidget = new QDockWidget(tr("Design"), this);
dockWidget.setWidget(treeWidget);
dockWidget.setFeatures(DockWidgetFeature.DockWidgetMovable);
addDockWidget(DockWidgetArea.LeftDockWidgetArea, dockWidget);

// Add schematic viewer on the right
schematicScene = new SchematicScene(netlist);
schematicView = new SchematicView(schematicScene);
schematicWidget = new QDockWidget(tr("Schematic"), this);
schematicWidget.setWidget(schematicView);
schematicWidget.setFeatures(DockWidgetFeature.DockWidgetMovable);
addDockWidget(DockWidgetArea.RightDockWidgetArea, schematicWidget);

schematicScene.objectSelected.connect(this, "selectFromSchematic(String)");
schematicScene.cellDrawn.connect(schematicView, "zoomToFit()");
}

public void selectNetlistItem(QModelIndex index) {
QTreeWidgetItem item = treeWidget.getItemFromIndex(index);
if (item instanceof HierCellInstTreeWidgetItem) {
EDIFHierCellInst cellInst = ((HierCellInstTreeWidgetItem) item).getInst();
schematicScene.drawCell(cellInst, true);
} else if (item.data(0, 0) instanceof EDIFPort) {
EDIFPort port = (EDIFPort) item.data(0, 0);
schematicScene.selectObject(item.data(1, 0).toString(), true);
} else if (item.data(0, 0) instanceof EDIFNet) {
schematicScene.selectObject(item.data(1, 0).toString(), true);
}
}

public void selectFromSchematic(String lookup) {
QTreeWidgetItem item = treeWidget.getItemByStringLookup(lookup);
if (item != null) {
treeWidget.setCurrentItem(item);
treeWidget.scrollToItem(item);
}
}

/**
Expand Down
49 changes: 40 additions & 9 deletions src/com/xilinx/rapidwright/gui/NetlistTreeWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.trolltech.qt.core.QModelIndex;
import com.trolltech.qt.gui.QTreeWidget;
import com.trolltech.qt.gui.QTreeWidgetItem;
import com.xilinx.rapidwright.edif.EDIFCell;
import com.xilinx.rapidwright.edif.EDIFCellInst;
import com.xilinx.rapidwright.edif.EDIFHierCellInst;
import com.xilinx.rapidwright.edif.EDIFHierNet;
import com.xilinx.rapidwright.edif.EDIFHierPortInst;
import com.xilinx.rapidwright.edif.EDIFNet;
import com.xilinx.rapidwright.edif.EDIFNetlist;
import com.xilinx.rapidwright.edif.EDIFPort;
Expand All @@ -45,13 +49,16 @@ public class NetlistTreeWidget extends QTreeWidget {

private QTreeWidgetItem rootItem;

private Map<String, QTreeWidgetItem> objectLookup = new HashMap<>();

private static final String DUMMY = "_*DUMMY*_";

public NetlistTreeWidget(String header, EDIFNetlist netlist) {
this.netlist = netlist;
setColumnCount(1);
setHeaderLabel(header);
QTreeWidgetItem root = new QTreeWidgetItem(this);
HierCellInstTreeWidgetItem root = new HierCellInstTreeWidgetItem(this);
root.setInst(netlist.getTopHierCellInst());
QTreeWidgetItem dummy = new QTreeWidgetItem(root);
dummy.setText(0, DUMMY);
rootItem = populateCellInst(root, netlist.getTopHierCellInst());
Expand All @@ -68,14 +75,18 @@ public QTreeWidgetItem populateCellInst(QTreeWidgetItem curr, EDIFHierCellInst i

EDIFCell cell = inst.getCellType();
curr.setText(0, inst.getInst().getName() + " (" + cell.getName() + ")");
boolean isTop = inst.isTopLevelInst();

QTreeWidgetItem ports = new QTreeWidgetItem(curr);
ports.setText(0, "Ports (" + cell.getPorts().size() + ")");
List<EDIFPort> edifPorts = new ArrayList<>(cell.getPorts());
Collections.sort(edifPorts);
for (EDIFPort port : edifPorts) {

for (EDIFHierPortInst portInst : inst.getHierPortInsts()) {
QTreeWidgetItem n = new QTreeWidgetItem(ports);
n.setText(0, port.getName() + " (" + port.getDirection() + ")");
n.setData(0, 0, portInst);
String portLookup = "PORT:" + (isTop ? portInst.getPortInst().getName() : portInst.toString());
n.setData(1, 0, portLookup);
n.setText(0, portInst.getPortInst().getName() + " (" + portInst.getPortInst().getDirection() + ")");
objectLookup.put(portLookup, n);
}
ports.setExpanded(false);

Expand All @@ -86,16 +97,21 @@ public QTreeWidgetItem populateCellInst(QTreeWidgetItem curr, EDIFHierCellInst i
Collections.sort(edifNets);
for (EDIFNet net : edifNets) {
QTreeWidgetItem n = new QTreeWidgetItem(nets);
EDIFHierNet hierNet = inst.getNet(net.getName());
n.setData(0, 0, hierNet);
String netLookup = "NET:" + hierNet.toString();
n.setData(1, 0, netLookup);
n.setText(0, net.getName());
objectLookup.put(netLookup, n);
}
nets.setExpanded(false);


List<EDIFCellInst> leaves = new ArrayList<>();
List<EDIFHierCellInst> leaves = new ArrayList<>();
List<EDIFHierCellInst> nonLeaves = new ArrayList<>();
for (EDIFCellInst child : cell.getCellInsts()) {
if (child.getCellType().isLeafCellOrBlackBox()) {
leaves.add(child);
leaves.add(inst.getChild(child));
} else {
nonLeaves.add(inst.getChild(child));
}
Expand All @@ -105,9 +121,13 @@ public QTreeWidgetItem populateCellInst(QTreeWidgetItem curr, EDIFHierCellInst i

QTreeWidgetItem leafCells = new QTreeWidgetItem(curr);
leafCells.setText(0, "Leaf Cells (" + leaves.size() + ")");
for (EDIFCellInst i : leaves) {
for (EDIFHierCellInst i : leaves) {
QTreeWidgetItem leaf = new QTreeWidgetItem(leafCells);
leaf.setText(0, i.getName() + " (" + i.getCellName() + ")");
leaf.setText(0, i.getInst().getName() + " (" + i.getCellName() + ")");
leaf.setData(0, 0, i);
String leafLookup = "INST:" + i.toString();
leaf.setData(1, 0, leafLookup);
objectLookup.put(leafLookup, leaf);
}
leafCells.setExpanded(false);

Expand All @@ -116,6 +136,9 @@ public QTreeWidgetItem populateCellInst(QTreeWidgetItem curr, EDIFHierCellInst i
HierCellInstTreeWidgetItem cellInst = new HierCellInstTreeWidgetItem(curr);
cellInst.setText(0, i.getInst().getName() + " (" + i.getCellName() + ")");
cellInst.setInst(i);
String instLookup = "INST:" + i.toString();
cellInst.setData(1, 0, instLookup);
objectLookup.put(instLookup, cellInst);
QTreeWidgetItem dummy = new QTreeWidgetItem(cellInst);
dummy.setText(0, DUMMY);
}
Expand Down Expand Up @@ -144,4 +167,12 @@ public EDIFNetlist getNetlist() {
public QTreeWidgetItem getRootItem() {
return rootItem;
}

public QTreeWidgetItem getItemFromIndex(QModelIndex index) {
return this.itemFromIndex(index);
}

public QTreeWidgetItem getItemByStringLookup(String lookup) {
return objectLookup.get(lookup);
}
}
Loading