Skip to content

Using the New Model Configurator

David Banas edited this page Mar 3, 2016 · 4 revisions

Introduction

As of release v0.9, you have the option of continuing to edit the example device specific C++ source files by hand, in order to configure them for your particular device, or using the new model configurator. You will need to have Python, as well as the PyIBIS-AMI package, installed on your system, in order to use the new model configurator. The new model configurator makes it easy to keep the *.AMI files consistent with the DLL/SOs, by deriving both from a common configuration data source. For an example of the new common configuration data source format, see the new example/example_tx_config.py file.

Using the Model Configurator

All you need to do, in order to get the new model configurator inserted into your model build flow, is edit and save the example/example_tx_config.py file. The make process will then detect that the example/example_tx.cpp file needs to be remade, and will run the configurator to accomplish this. The configurator uses the data in the example/example_tx_config.py file to customize the example/example_tx.cpp.em file, producing the example/example_tx.cpp file as its final output.

If you don't wish to use the new model configurator, simply edit the *.cpp file manually, as usual. As long as you don't touch the *.py file, it won't be inserted into your build flow.

Customizing the New Common Configuration Data Source for Your Model

The example/example_tx_config.py file is standard Python code. With the exception of the model base name and description, which are both held in strings, all model configuration information is contained in standard Python dictionaries. There is one dictionary at the top level, called ami_params. And it contains two dictionaries:

  • reserved, which contains those parameters destined for the Reserved_Parameters section of the AMI file, and
  • model, which contains those parameters destined for the Model_Specific section.

Parameters from either may be used to customize the device specific C++ source file, as per your particular needs. (See the example/example_tx.cpp.em file, as an example. It uses the EmPy templating system, which allows embedding Python code into an otherwise literate file, using "@()" and "@{}".)

Clone this wiki locally