Platform Specific Hardware Config - 2023.2 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
Release Date
2023-12-13
Version
2023.2 English

As mentioned in Guidance Macros, SYS_PORT connections can be customized per platform using the SYS_PORT_PFM macro. But if a new platform needs to be added, and thus the header file gets modified, then make will want to rebuild the hardware for already existing and compiled platforms which is not desirable. A good way to prevent this is to create separate configuration header files for each platform, and use the -I CFLAG to include the correct one for a given platform. For example:

ifneq (,$(findstring u50,$(DEVICE)))
  EXTRA_CFLAGS := -I include/u50
else
  EXTRA_CFLAGS := -I include/u200
endif

The accelerator header file includes a common file (example config.hpp), which is customized and provided in separate directories to make it easier to have platform-specific configuration, like number of compute units and port mapping as shown in this example:

Table 1. Additional Makefile Variables
In the ACC class specification include/u50/config.hpp include/u200/config.hpp
#include "config.hpp"
// Accelerator class
class pipelined_cu : public VPP_ACC<pipelined_cu, NCU>
{ ...
    SYS_PORT(A, PORT_MAP_A);
    SYS_PORT(B, PORT_MAP_B);
    SYS_PORT(E, PORT_MAP_E);
#define NCU 2
// global memory connections to Accelerator ports
#define PORT_MAP_A (HBM[0]:HBM[2])
#define PORT_MAP_B (HBM[0]:HBM[2])
#define PORT_MAP_E (HBM[0]:HBM[2])
#define NCU 3
// global memory connections to Accelerator ports
#define PORT_MAP_A (DDR[0]:DDR[1]:DDR[2])
#define PORT_MAP_B (DDR[0]:DDR[1]:DDR[2])
#define PORT_MAP_E (DDR[0]:DDR[1]:DDR[2])