Skip to content

Adding a new platform to platformwrapper

Yaman Umuroglu edited this page Jun 21, 2019 · 2 revisions
  1. Decide on a name that will refer to the new platform, something like PYNQZ1. We'll refer to this name as $PLATFORM_NAME in the following steps. Make a fork of fpga-tidbits and start a new branch called feature/platform-$PLATFORM_NAME.

  2. Add the software driver support for your platform. The software driver needs to implement the functions that read/write control/status registers and move data between host and accelerator memory spaces. This is quite straightforward for platforms that resemble the ones that already exist, such as PYNQ ports to other Zynq or MPSoC boards. For these platforms there is no need to add any new files.

  3. Add the hardware wrapper for your platform, which again is easiest for platforms resembling existing ones. For instance, to add a new PYNQ platform on a Zynq device, make a copy of src/main/scala/fpgatidbits/platform-wrapper/axi/PYNQU96Wrapper.scala in the same folder, and edit the platform definition so that the name and the PlatformWrapperParams reflects your platform. It's important to rename the class and the setName and setModuleName strings as well. Finally, the platformDriverFiles should reflect the filenames of the software drivers from step 2.

  4. Add your platform to the platformMap and fpgaPartMap under src/main/scala/fpgatidbits/Main.scala. The first maps the $PLATFORM_NAME string to a function that takes in an accelerator instantiation function and returns the wrapped instance. The second maps $PLATFORM_NAME to the FPGA part number that the board uses. The platformMap entry should look like "PYNQZ1" -> {f => new PYNQZ1Wrapper(f)}, and the fpgaPartMapEntry should look like "PYNQZ1" -> "xc7z020clg400-1",.

  5. Done! You should now be able to generate the needed software and hardware wrapper files through the regular fpga-tidbits PlatformWrapper flow, either through the command line or by calling the appropriate TidbitsMakeUtils functions. Send a pull request to have your platform merged into mainline.

Clone this wiki locally