-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RouterHelper.invertPossibleGndPinsToVccPins() to invert static LUT in…
…puts (#910) * RouterHelper.invertPossibleGndPinsToVccPins() to invert LUT inputs Signed-off-by: Eddie Hung <[email protected]> * Check all connected cells are LUTs before inverting Signed-off-by: Eddie Hung <[email protected]> * Add testInvertPossibleGndPinsToVccPinsLutInput() Signed-off-by: Eddie Hung <[email protected]> * Address review comments Signed-off-by: Eddie Hung <[email protected]> * Do not invert SRL16E pins Signed-off-by: Eddie Hung <[email protected]> * EDIFCell to track instantiations via atomic int Signed-off-by: Eddie Hung <[email protected]> * Add test Signed-off-by: Eddie Hung <[email protected]> * Update src/com/xilinx/rapidwright/edif/EDIFCell.java Signed-off-by: eddieh-xlnx <[email protected]> * Skip XDEF where possible Signed-off-by: Eddie Hung <[email protected]> * Add and test EDIFCell.isUniquified() Signed-off-by: Eddie Hung <[email protected]> * Add and test EDIFHierCellInst.isUniquified() Signed-off-by: Eddie Hung <[email protected]> * Do not invert if LUT is not uniquified TODO for test Signed-off-by: Eddie Hung <[email protected]> * Removed unused imports Signed-off-by: Eddie Hung <[email protected]> * Remove TODO Signed-off-by: Eddie Hung <[email protected]> * Skip XDEF where possible Signed-off-by: Eddie Hung <[email protected]> * Add and test EDIFCell.isUniquified() Signed-off-by: Eddie Hung <[email protected]> * Add and test EDIFHierCellInst.isUniquified() Signed-off-by: Eddie Hung <[email protected]> * {Inc,dec}rement instance count during EDIFCell.{add,remove}CellInst() Signed-off-by: Eddie Hung <[email protected]> * EDIFCellInst.setCellTypeRaw() to only incr instance count if parent Signed-off-by: Eddie Hung <[email protected]> * Improve TestEDIFCell tests Signed-off-by: Eddie Hung <[email protected]> * Improve TestEDIF{Hier,}CellInst too Signed-off-by: Eddie Hung <[email protected]> * Add null check Signed-off-by: Eddie Hung <[email protected]> * Another null check Signed-off-by: Eddie Hung <[email protected]> * EDIFCellInst.isUniquified() only true if has parent cell Signed-off-by: Eddie Hung <[email protected]> * EDIFHierCellInst.isUniquified() to not check top level inst (which has no parent cell) Signed-off-by: Eddie Hung <[email protected]> * Expand TestEDIF{Hier,}CellInst Signed-off-by: Eddie Hung <[email protected]> * Expand TestEDIFCell including a test that currently fails Signed-off-by: Eddie Hung <[email protected]> * Add null check Signed-off-by: Eddie Hung <[email protected]> * EDIFCell.decrementInstanceCount() to recursively decrement instances on detaching the last instance Signed-off-by: Eddie Hung <[email protected]> * Refactor into testIsUniquifiedRemoveAndAdd() removeCellInst() is an easy fix, but addCellInst() is not yet Signed-off-by: Eddie Hung <[email protected]> * More questions than answers... Signed-off-by: Eddie Hung <[email protected]> * EDIFCell.{add,remove}CellInst() to not increment instance count Signed-off-by: Eddie Hung <[email protected]> * EDIFCell.addCellInst() to not increment instance count Signed-off-by: Eddie Hung <[email protected]> * EDIFCell.removeCellInst() to call EDIFCellInst.setParentCell() and move trackChange() and decrementInstanceCount() calls inside Signed-off-by: Eddie Hung <[email protected]> * EDIFCellInst.setParentCell() and setCellTypeRaw() to inc/dec inst count Signed-off-by: Eddie Hung <[email protected]> * Update tests Signed-off-by: Eddie Hung <[email protected]> * Make EDIFCellInst.setParentCell() the only place member is written Signed-off-by: Eddie Hung <[email protected]> * Add invertLutInputs param to invertPossibleGndPinsToVccPins() Signed-off-by: Eddie Hung <[email protected]> * [RWRoute] Add --noInvertGndToVccForLutInputs option Signed-off-by: Eddie Hung <[email protected]> * Fix/improve tests Signed-off-by: Eddie Hung <[email protected]> * Add stub for VCC -> GND for testing Signed-off-by: Eddie Hung <[email protected]> * Adding implementation of invertVccLutPinsToGndPins() Signed-off-by: Chris Lavin <[email protected]> * Temporary workaround to clear logical netlist after Net.rename() Signed-off-by: Eddie Hung <[email protected]> * Add null check Signed-off-by: Eddie Hung <[email protected]> * Remove @test Signed-off-by: Eddie Hung <[email protected]> * Move invertVccLutPinsToGndPins() into RouterHelperSupport Signed-off-by: Eddie Hung <[email protected]> * Add comment about LUT6_2 Signed-off-by: Eddie Hung <[email protected]> * Fix comment Signed-off-by: Eddie Hung <[email protected]> * Fill out testInvertPossibleGndPinsToVccPinsLutInputOnlyIfFlattenedAndUniquified() Signed-off-by: Eddie Hung <[email protected]> * Bump year Signed-off-by: Eddie Hung <[email protected]> * Skip test if !flatten && uniquify Signed-off-by: Eddie Hung <[email protected]> --------- Signed-off-by: Eddie Hung <[email protected]> Signed-off-by: eddieh-xlnx <[email protected]> Signed-off-by: Chris Lavin <[email protected]> Co-authored-by: Chris Lavin <[email protected]>
- Loading branch information
1 parent
6dfd6c2
commit d9e31fc
Showing
7 changed files
with
303 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
test/shared/com/xilinx/rapidwright/support/rwroute/RouterHelperSupport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (c) 2024, Advanced Micro Devices, Inc. | ||
* All rights reserved. | ||
* | ||
* Author: Eddie Hung, Advanced Micro Devices, Inc. | ||
* | ||
* This file is part of RapidWright. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package com.xilinx.rapidwright.support.rwroute; | ||
|
||
import com.xilinx.rapidwright.design.Cell; | ||
import com.xilinx.rapidwright.design.Design; | ||
import com.xilinx.rapidwright.design.SiteInst; | ||
import com.xilinx.rapidwright.design.SitePinInst; | ||
import com.xilinx.rapidwright.design.tools.LUTTools; | ||
import com.xilinx.rapidwright.device.BELPin; | ||
|
||
import java.util.Set; | ||
|
||
public class RouterHelperSupport { | ||
public static void invertVccLutPinsToGndPins(Design design, Set<SitePinInst> pins) { | ||
for (SitePinInst spi : pins) { | ||
assert (spi.getNet() == design.getVccNet()); | ||
SiteInst si = spi.getSiteInst(); | ||
for (BELPin bp : spi.getSiteWireBELPins()) { | ||
if (bp.isSitePort() || bp.getName().charAt(0) != 'A') | ||
continue; | ||
if (bp.getBEL().isLUT()) { | ||
Cell lut = si.getCell(bp.getBEL()); | ||
if (lut != null) { | ||
String eq = LUTTools.getLUTEquation(lut); | ||
String logInput = lut.getLogicalPinMapping(bp.getName()); | ||
if (logInput != null) { | ||
LUTTools.configureLUT(lut, eq.replace(logInput, "(~" + logInput + ")")); | ||
} else { | ||
// Doesn't look like this pin is used by this [65]LUT, | ||
// could be used by the other [56]LUT | ||
} | ||
} | ||
} | ||
} | ||
spi.getNet().removePin(spi, true); | ||
design.getGndNet().addPin(spi, true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.