Skip to content

Commit

Permalink
platform: add a mechanism for AFU's to set platform macros (#3130)
Browse files Browse the repository at this point in the history
Due to the order that SystemVerilog header files are processed,
setting a macro in an AFU's sources file may not affect the FIM's
afu_main(). Add support for writing macros to the PIM interface
header file that afu_main() includes explicity.

Signed-off-by: Michael Adler <michael.adler@intel.com>
  • Loading branch information
michael-adler committed Jun 11, 2024
1 parent c3b9bed commit 046b40f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions platforms/platmgr/tools/afu_platform_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,13 @@ def getAfuIfc(args):
def injectAfuIfcChanges(args, afu_ifc_db, afu_ifc_req):
fname = afu_ifc_req['file_path']

# Allow an AFU's JSON configuration to create macros
if ('define' in afu_ifc_req):
if ('define' in afu_ifc_db):
afu_ifc_db['define'] += afu_ifc_req['define']
else:
afu_ifc_db['define'] = afu_ifc_req['define']

if ('module-ports' not in afu_ifc_req):
return
if (not isinstance(afu_ifc_req['module-ports'], list)):
Expand Down

0 comments on commit 046b40f

Please sign in to comment.