-
Notifications
You must be signed in to change notification settings - Fork 10
Contest-specific DCP to FPGA Interchange Format Utility #10
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f392450
Add DcpToFPGAIF.java
eddieh-xlnx 1955788
Discover alternate sources
eddieh-xlnx dc09218
Add import, fix exit code
eddieh-xlnx 922314d
Merge branch 'master' into dcp_to_fpgaif
eddieh-xlnx c14e74e
Update README.md
eddieh-xlnx 6db1c00
Update README.md
eddieh-xlnx c303a29
Update details.md
eddieh-xlnx 98f6b4a
Update FAQ.md
eddieh-xlnx 7dc45d5
Update README.md
eddieh-xlnx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,63 @@ | ||
/* | ||
* Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. | ||
* | ||
* Author: Eddie Hung, AMD | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
*/ | ||
|
||
package com.xilinx.fpga24_routing_contest; | ||
|
||
import com.xilinx.rapidwright.design.Design; | ||
import com.xilinx.rapidwright.design.DesignTools; | ||
import com.xilinx.rapidwright.design.SitePinInst; | ||
import com.xilinx.rapidwright.design.Net; | ||
import com.xilinx.rapidwright.interchange.LogNetlistWriter; | ||
import com.xilinx.rapidwright.interchange.PhysNetlistWriter; | ||
import com.xilinx.rapidwright.util.FileTools; | ||
|
||
import java.io.IOException; | ||
|
||
public class DcpToFPGAIF { | ||
public static void main(String[] args) throws IOException { | ||
if (args.length != 3) { | ||
System.err.println("USAGE: <input.dcp> <output.netlist> <output.phys>"); | ||
System.exit(1); | ||
} | ||
|
||
Design design = Design.readCheckpoint(args[0]); | ||
|
||
// Even though the design is fully placed-and-routed, still need to call this to | ||
// infer any unrouted SitePinInst-s from nets with hierarchical ports --- not for | ||
// routing to since they are out-of-context ports --- but so that it's clear to | ||
// other nets that those nodes are off limits | ||
DesignTools.createMissingSitePinInsts(design); | ||
|
||
for (Net net : design.getNets()) { | ||
if (net.isStaticNet() || net.isClockNet()) { | ||
continue; | ||
} | ||
|
||
// Where a net only has a single source, try and discover if an alternate | ||
// source exists | ||
SitePinInst altSource = net.getAlternateSource(); | ||
if (altSource == null) { | ||
altSource = DesignTools.getLegalAlternativeOutputPin(net); | ||
if (altSource != null) { | ||
// Commit this pin to the SiteInst | ||
altSource.getSiteInst().addPin(altSource); | ||
DesignTools.routeAlternativeOutputSitePin(net, altSource); | ||
} | ||
} | ||
|
||
net.unroute(); | ||
} | ||
|
||
PhysNetlistWriter.writePhysNetlist(design, args[2]); | ||
|
||
// Write logical netlist after physical since it collapses macros | ||
LogNetlistWriter.writeLogNetlist(design.getNetlist(), args[1]); | ||
} | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.