This section provides links to a few tutorials, targeted from beginners to advanced users. Before performing one or more of theses tutorials, be sure that you have installed GeCoS. At the beginning of each tutorial, a section named Feature requirement show which features you need to have installed before running each tutorial.
*Disclaimer* As GeCoS is a rapidly changing software, some tutorials may contains bugs or have inconsistencies. You may also find the tutorial unclear or just simply wrong. In that case please report the problems that you encountered either on the gecos-user mailing lists or report a bug on the bug tracking page
The GeCoS module “ModuleTester” provides a simple and quick way to test transformations used inside a GeCoS script. In short, given a list of GecosProjects, it can performs the following steps, depending on the specified options:
The “ModuleTester” is part of GeCoS testing framework. Thus, in order to use it you should get the following plugin from the GeCoS svn repository:
This module currently issues bash commands. The following commands are required:
The “ModuleTester” can be invoked in a GeCoS scirpt as following:
TesterModule(projects, String testMode, String compareMode, Boolean compareCode, String codegenDir) with:
Here is an example of how the “ModuleTester” can be used to test the loop unrolling transformation:
# Create a GecosProject and Parse it project = CreateGecosProject("Unroll Project"); AddSourceToGecosProject(project,"test.c"); CDTFrontend(project); # save project before applying the transformation SaveGecosProject(project, "project_orig.gecosproject"); # Perform loop unrolling ModelForUnroll(project); ### Testing the transformation: # - origProj: is the GeCosProject before applying loop unrolling # - project: is the project after loop unrolling origProj = LoadGecosProject"project_orig.gecosproject"); modProj = project; # This will do the following: # - generate c code for both projects in "./test" # - compile, link and execute code from both projects # - Assert that the exit code is zero for both executables and finally # compares the output on the TesterModule({origProj, modProj}, "EXECUTE", "STDOUT", false, "./test");