### Run Physical Netlist Example Source: https://github.com/xilinx/rapidwright/blob/master/interchange/README.md Steps to build the interchange tools and execute the physical netlist example using a sample DCP file. ```bash make -C interchange make java com.xilinx.rapidwright.interchange.PhysicalNetlistExample # download an example DCP file wget http://www.rapidwright.io/docs/_downloads/picoblaze_best.zip unzip -j picoblaze_best.zip pblock0.dcp pblock0.edf -d . java com.xilinx.rapidwright.interchange.PhysicalNetlistExample pblock0.dcp pblock0_interchange.dcp ``` -------------------------------- ### Setup RapidWright Repository Source: https://github.com/xilinx/rapidwright/blob/master/interchange/README.md Commands to clone the repository and compile the Java source code. ```bash git clone https://github.com/Xilinx/RapidWright.git cd RapidWright ./gradlew compileJava ``` -------------------------------- ### Java Class Structure Example Source: https://github.com/xilinx/rapidwright/blob/master/CODING_STYLE.md Demonstrates the required ordering of license headers, package declarations, imports, and class members. ```java /* * * Copyright (c) 2018 Xilinx, Inc. * All rights reserved. * * Author: Chris Lavin, Xilinx Research Labs. * * 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.design; import java.util.ArrayList; import java.util.List; import com.xilinx.rapidwright.design.Cell; import com.xilinx.rapidwright.design.Design; import com.xilinx.rapidwright.device.Device; import com.xilinx.rapidwright.edif.EDIFCell; /** * Convenience object for capturing a logical cell pin name * with its respective cell. */ public class CellPin { private Cell cell; private String logicalPinName; public CellPin(Cell cell, String physicalPinName) { super(); this.cell = cell; this.logicalPinName = physicalPinName; } public Cell getCell() { return cell; } public String getLogicalPinName() { return logicalPinName; } } ``` -------------------------------- ### Install RapidWright Python Package Source: https://github.com/xilinx/rapidwright/blob/master/README.md Install the RapidWright Python package via pip. ```bash pip install rapidwright ``` -------------------------------- ### Initialize RapidWright and Access Java Classes Source: https://github.com/xilinx/rapidwright/blob/master/python/README.md Demonstrates starting the JVM and importing RapidWright Java classes for use in Python scripts. ```python # This will start a JVM instance import rapidwright # These import Java classes as Python modules from com.xilinx.rapidwright.examples import Lesson1 from com.xilinx.rapidwright.design import Design # Create a basic design DCP, read it back in and print out the cells Lesson1.main([]) design = Design.readCheckpoint("HelloWorld.dcp") print(design.getCells()) ``` -------------------------------- ### Format Signed-off-by Commit Message Source: https://github.com/xilinx/rapidwright/blob/master/CONTRIBUTING.md Example of the required sign-off line at the end of a commit message. ```text This is my commit message Signed-off-by: Jane Doe ``` -------------------------------- ### Configure JVM Memory Options Source: https://github.com/xilinx/rapidwright/blob/master/python/README.md Shows how to use JAVA_TOOL_OPTIONS to adjust JVM memory settings when running Python scripts. ```bash $python3 -c "import rapidwright; from java.lang import Runtime; print(Runtime.getRuntime().maxMemory() / 1024 / 1024)" 14279.5 $ JAVA_TOOL_OPTIONS="-Xmx32G" python3 -c "import rapidwright; from java.lang import Runtime; print(Runtime.getRuntime().maxMemory() / 1024 / 1024)" Picked up JAVA_TOOL_OPTIONS: -Xmx32G 29127.5 ``` -------------------------------- ### Enable Pre-commit Hook Source: https://github.com/xilinx/rapidwright/blob/master/README.md Run this command once after cloning to enable the git pre-commit verification checks. ```bash make enable_pre_commit_hook ``` -------------------------------- ### Javadoc Single Line Pattern Source: https://github.com/xilinx/rapidwright/blob/master/CODING_STYLE.md Compact format for documenting variables when the description fits on a single line. ```java ... /** Suffix of the device part files */ public static final String DEVICE_FILE_SUFFIX = "_db.dat"; ... ``` -------------------------------- ### Regenerate Cap'n Proto Java Code Source: https://github.com/xilinx/rapidwright/blob/master/interchange/README.md Commands to rebuild the interchange format Java classes from the schema. ```bash cd interchange && make && cd .. make ``` -------------------------------- ### Control Structure Brace Formatting Source: https://github.com/xilinx/rapidwright/blob/master/CODING_STYLE.md Demonstrates the required brace style for if-else, for, do-while, and try-catch blocks, ensuring consistent line breaks. ```java if (a == b) { System.out.println("a == b"); } else if (a == c) { System.out.println("a == c"); } else { System.out.println("a != c && a != b"); } for (int i=0; i < s.length(); i++) { System.out.println(s.charAt(i)); } do { System.out.println("something"); } while (!queue.isEmpty()); try { FileInputStream in = new FileInputStream(fileName); } catch (FileNotFoundException e) { System.err.println("ERROR: The file "+fileName+" could not be found."); return null; } ``` -------------------------------- ### Javadoc Multiline Pattern Source: https://github.com/xilinx/rapidwright/blob/master/CODING_STYLE.md Standard format for class and method documentation using the multiline Javadoc style. ```java /** * Convenience object for capturing a logical cell pin name * with its respective cell. */ public class CellPin { ... } ``` -------------------------------- ### Configure Git User Identity Source: https://github.com/xilinx/rapidwright/blob/master/CONTRIBUTING.md Commands to set the user name and email address in the local git configuration. ```bash git config user.name "FIRST_NAME LAST_NAME" ``` ```bash git config user.email "USERNAME@example.com" ``` -------------------------------- ### View Developer Certificate of Origin Source: https://github.com/xilinx/rapidwright/blob/master/CONTRIBUTING.md The DCO text that contributors must agree to when submitting code. ```text Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` -------------------------------- ### Update RapidWright Revision Source: https://github.com/xilinx/rapidwright/blob/master/README.md Commands to pull the latest changes and update dependencies in an existing local repository. ```bash cd $RAPIDWRIGHT_PATH git pull # resolve any issues ./gradlew updateJars ./gradlew compileJava ``` -------------------------------- ### Amend Commit with Sign-off Source: https://github.com/xilinx/rapidwright/blob/master/CONTRIBUTING.md Command to add the sign-off line to the most recent commit. ```bash git commit --amend --signoff ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.