-
Notifications
You must be signed in to change notification settings - Fork 28
Adding a new platform to platformwrapper
-
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 offpga-tidbits
and start a new branch calledfeature/platform-$PLATFORM_NAME
. -
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.
-
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 thePlatformWrapperParams
reflects your platform. It's important to rename the class and thesetName
andsetModuleName
strings as well. Finally, theplatformDriverFiles
should reflect the filenames of the software drivers from step 2. -
Add your platform to the
platformMap
andfpgaPartMap
undersrc/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",
. -
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.