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:
In the ACC class specification | include/u50/config.hpp | include/u200/config.hpp |
---|---|---|
|
|
|