@@ -761,6 +767,7 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self.CleanNameAsToolWants(param._id),
param._signal._asnSize))
ifgenHwDevDrv:
# HW delegation via Execute() was successful, so return 0 to Dispatcher
self.C_SourceFile.write(" return 0;\n")
self.C_SourceFile.write("}\n\n")
...
...
@@ -768,6 +775,12 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
# Dispatcher <Function Block name>_<PI name><dispatcherSuffix> is part of the FPGA device driver <PI name>_<Language>.vhdl.h/c
# Dispatcher can return: 0 (successfully delegated to HW), 1 (delegated to SW), 2 (unsuccessfully delegated to HW)
# Here being added to the .c file
# Detailed description:
# Delegate to one or the other side (SW or HW) depending on whether the value of a global variable storing the current
# configuration (p_szGlobalState) equals one of those configurations listed (fConfigList) for the target Function Block in its respective IV field.
# If so, OR such list defines the "magic" word "AllModes", computation will be delegated to HW/FPGA (<Function Block name>_<PI name><fpgaSuffix> will be called).
# Otherwise, FPGA is not called and computation will proceed in SW through the "usual" SW side/glue counterpart.
# Debug level logs (LOGDEBUG) can be used to track this delegation during testing.
@@ -783,7 +796,10 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self.C_SourceFile.write(")\n{\n")
self.C_SourceFile.write(' /*\n')
self.C_SourceFile.write(' Delegate to one or the other side (SW or HW) depending on whether the value of a global variable storing the current\n')
self.C_SourceFile.write(' configuration equals one of those defined for the target function in new IV field.\n')
self.C_SourceFile.write(' configuration (p_szGlobalState) equals one of those configurations listed (fConfigList) for the target Function Block in its respective IV field.\n')
self.C_SourceFile.write(' If so, OR such list defines the "magic" word "AllModes", computation will be delegated to HW/FPGA (<Function Block name>_<PI name><fpgaSuffix> will be called).\n')
self.C_SourceFile.write(' Otherwise, FPGA is not called and computation will proceed in SW through the "usual" SW side/glue counterpart.\n')
self.C_SourceFile.write(' Debug level logs (LOGDEBUG) can be used to track this delegation during testing.\n')