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

Adds an Override Flag for Advanced Flow Settings in Designs #1135

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
<classpathentry kind="lib" path="jars/kryo-5.2.1.jar"/>
<classpathentry kind="lib" path="jars/minlog-1.3.1.jar"/>
<classpathentry kind="lib" path="jars/jython-standalone-2.7.2.jar"/>
<classpathentry kind="lib" path="jars/rapidwright-api-lib-2024.2.1-rc4.jar">
<classpathentry kind="lib" path="jars/rapidwright-api-lib-2024.2.1-rc5.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/RapidWright/jars/rapidwright-api-lib-2024.2.1-rc4-javadoc.jar!/"/>
<attribute name="javadoc_location" value="jar:platform:/resource/RapidWright/jars/rapidwright-api-lib-2024.2.1-rc5-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="jars/jgrapht-core-1.3.0.jar"/>
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:

env:
RAPIDWRIGHT_VERSION: v2024.2.1-rc4-beta
RAPIDWRIGHT_VERSION: v2024.2.1-rc5-beta

jobs:
build:
Expand Down
10 changes: 10 additions & 0 deletions src/com/xilinx/rapidwright/util/Params.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class Params {

public static String RW_WRITE_DCP_2024_1_NAME = "RW_WRITE_DCP_2024_1";

public static String RW_DISABLE_WRITING_ADV_FLOW_DCPS_NAME = "RW_DISABLE_WRITING_ADV_FLOW_DCPS";

/**
* Flag to have RapidWright decompress gzipped EDIF files to disk prior to
* parsing. This is a tradeoff where pre-decompression improves runtime over the
Expand All @@ -60,6 +62,14 @@ public class Params {
*/
public static boolean RW_WRITE_DCP_2024_1 = isParamSet(RW_WRITE_DCP_2024_1_NAME);

/**
* Flag to disable RapidWright from writing any DCPs that target Vivado's
* Advanced Flow (starting in Vivado 2024.2). By default, RapidWright writes
* DCPs targeting Versal devices with the Advanced Flow compatibility flag set
* to true.
*/
public static boolean RW_DISABLE_WRITING_ADV_FLOW_DCPS = isParamSet(RW_DISABLE_WRITING_ADV_FLOW_DCPS_NAME);

/**
* Checks if the named RapidWright parameter is set via an environment variable
* or by a JVM parameter of the same name.
Expand Down
12 changes: 9 additions & 3 deletions src/com/xilinx/rapidwright/util/VivadoTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@

package com.xilinx.rapidwright.util;

import com.xilinx.rapidwright.design.Design;
import com.xilinx.rapidwright.edif.EDIFTools;

import java.io.File;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;

import com.xilinx.rapidwright.design.Design;
import com.xilinx.rapidwright.edif.EDIFTools;

/**
* Utility methods to provide access to vivado and parse logs
*
Expand Down Expand Up @@ -115,6 +116,11 @@ public static List<String> runTcl(Path outputLog, Path tclScript, boolean verbos
+ tclScript.toString();
Integer exitCode = FileTools.runCommand(vivadoCmd, verbose, environ, runDir);
if (exitCode != 0) {
if (Files.exists(outputLog)) {
for (String l : FileTools.getLinesFromTextFile(outputLog.toString())) {
System.out.println("FAILED OUTPUT> " + l);
}
}
throw new RuntimeException("Vivado exited with code: " + exitCode);
}
return FileTools.getLinesFromTextFile(outputLog.toString());
Expand Down
32 changes: 32 additions & 0 deletions test/src/com/xilinx/rapidwright/design/TestDCPWrite.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import java.nio.file.Path;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -53,4 +54,35 @@ public void testNewPhysDBWrite(@TempDir Path dir) {
VivadoToolsHelper.assertFullyRouted(dcp);
}
}

@Test
public void testAdvancedFlowFlags(@TempDir Path tempDir) {
Design design = RapidWrightDCP.loadDCP("picoblaze_2022.2.dcp");

// Should be true since it is targeting Versal
Assertions.assertTrue(design.isAdvancedFlow());
Path defaultDCPPath = tempDir.resolve("default.dcp");
design.writeCheckpoint(defaultDCPPath);

Design defaultDCP = Design.readCheckpoint(defaultDCPPath);
Assertions.assertTrue(defaultDCP.isAdvancedFlow());

design.setAdvancedFlow(false);
Assertions.assertFalse(design.isAdvancedFlow());
Path setFalseDCPPath = tempDir.resolve("false.dcp");
design.writeCheckpoint(setFalseDCPPath);

Design falseDCP = Design.readCheckpoint(setFalseDCPPath);
// Write DCP should revert flag to default case (true)
Assertions.assertTrue(falseDCP.isAdvancedFlow());

falseDCP.setAdvancedFlow(true);

Path overrideDCPPath = tempDir.resolve("override.dcp");
Params.RW_DISABLE_WRITING_ADV_FLOW_DCPS = true;
Assertions.assertTrue(falseDCP.isAdvancedFlow());
falseDCP.writeCheckpoint(overrideDCPPath);
// Return to default for other tests
Params.RW_DISABLE_WRITING_ADV_FLOW_DCPS = false;
}
}
Loading