This section will demonstrate the process for generating the C Code files. It is assumed that all of the steps in Choosing Functions to Generate have been completed.
Setting the Generation Options
The Generation Options Window can be opened by choosing Dynamic Config./Algorithmic Method… from the AnadigmDesigner®2 main menu. This will bring up the Generate C Code window. Then click on the Generation Options… button.
General Tab
We will stay with the default settings on the General Tab. To avoid name collisions with any existing code you may have, all functions and variables generated can be prefixed with a string. By default, this string is "an_". So our setGainHold function will be generated as an_setGainHold. We also maintain ANSI C compliance by leaving the truncation of all names to 31 characters. The generation engine will go the truncation intelligently, and will not allow two names to collide.
For more details on ANSI C compliance, see the Generate C Code Window.
Reconfiguration Tab
The Reconfiguration Tab allows us to control the memory allocation used to store the reconfiguration data that is dynamically created in the C Code. As each CAM C Code function is called in the C Code, configuration data is added to the reconfiguration data buffer. This size of this buffer is controlled in this tab. So that we do not have to worry about overrunning this buffer, we check the Enable automatic growth… check box.
For more details on the automatic growth setting, see Reconfiguration Tab.
Primary Configuration Tab
This tab is used to select which chips will have primary configuration data output in the C Code. We will be programming the chips initial configuration using C Code, so we leave box checked next to the name of our chip.
For more details on this tab, see Primary Configuration Tab.
Clocks Tab
The clocks tab allows us to select any chips for which we want to dynamically change clock divisors. We do not wish to do this, so we leave the box next to the name of our chip unchecked.
For more details on this tab, see Clocks Tab.
Creating the C Code Files
To create the C Code files we must open the Generate C Code Window. Do this by choosing C Code à Generate… from the AnadigmDesigner®2 main menu. This window allows us to choose the names of the files that get generated, and specify the directory where they will be created. We will keep the default file names and generate them to the same directory as our circuit file.
Everything is now ready to go, so we press the Generate… button to create the files. We will receive a prompt if the files already exist that asks us to confirm that we want to overwrite them. After the files are generated, AnadigmDesigner®2 tells the C Code was generated with success.