Commit 4e17a4b0 authored by Tiago Jorge's avatar Tiago Jorge
Browse files

Add first implementation of dispatcher.

parent 96d107fb
......@@ -691,7 +691,22 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self.C_SourceFile.write('void *p' + self.CleanNameAsToolWants(param._id) + ', size_t *pSize_' + self.CleanNameAsToolWants(param._id))
self.C_SourceFile.write(' return 0;\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(' */\n')
self.C_SourceFile.write(' extern const char *p_szGlobalState;\n')
self.C_SourceFile.write(' if(!strcmp(p_szGlobalState, "%s")){\n' % (sp._fpgaConfigurations))
self.C_SourceFile.write(' // delegate to HW\n')
self.C_SourceFile.write(' printf("delegate to HW\\n");\n')
self.C_SourceFile.write(' //called_compute_something_Brave_Fpga(pinp, size_inp, poutp, pSize_outp);\n')
self.C_SourceFile.write(' // delegated to HW, return 0\n')
self.C_SourceFile.write(' return 0;\n')
self.C_SourceFile.write(' }else{\n')
self.C_SourceFile.write(' printf("delegate to SW\\n");\n')
self.C_SourceFile.write(' // delegate to SW, return 1\n')
self.C_SourceFile.write(' return 1;\n')
self.C_SourceFile.write(' }\n')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment