Friday, September 24, 2010

Model Based Design – VIP Appln -02

Model-Based Design to Develop and Deploy a
Video Processing Application

02 Converting the Design from Floating Point to Fixed Point

To implement this system on a fixed-point processor, we need to convert the algorithm to use fixed-point data types. In a traditional design flow based on C programming, this conversion would require major code modification. Conversion of the Simulink model involves three basic steps:

  1. Change the source block output data types. During automatic data type propagation, Simulink displays messages indicating the need to change block parameters to ensure data type consistency in the model.

  2. Set the fixed-point attributes of the accumulators and product outputs using Simulink Fixed Point tools, such as Min-max and Overflow logging.

  3. Examine blocks whose parameters are sensitive to the pixel values to ensure that these parameters are consistent with the input signal data type. (The interpretation of pixel values depends on the data type. For example, the maximum intensity of a pixel is denoted by a value of 1 in floating point and by a value of 255 in an unsigned 8-bit integer representation.)
This can be done using Fixed-Point Tool or by Fixed-Point Advisor from Tools->Fixed-Point
If this is first time, then start with Fixed-Point Advisor.
This opens a window as shown below:

The Fixed-Point Advisor is broken into four main tasks. Each task addresses one aspect of the conversion process. The tasks are:

  • Prepare Model for Conversion
    • Evaluate model wide configuration options.
    • Create floating-point base line data set.

  • Prepare for Data Typing and Scaling
    • Evaluate block specific configurations.
    • Add design minimum and maximum information to the model.

  • Perform Data Typing and Scaling
    • Propose fixed-point data typing and initial scaling to the blocks.
    • Analyze the resulting fixed-point model behaviour.

  • Prepare for Code Generation
    • Examine issues resulting in inefficient code.

After pressing the button "Run to Failure", tool will run till failure and then opens model advisor window as well as report like as below:

After doing the modification and changes need to run again.
Sometimes, to go directly to the error location we need to use "Explore Result…" Button as shown below.

Which open a window named Model Advisor Result Explorer.

Here select main signals to Log Signal Data from check box and Use Signal name for Logging name from pull up.
This Floating-Point to Fixed-Point conversion is an iterative procedure; we need to run every time after doing small changes in the model. And finally here we go with Fixed-Point Model.

Figure 4: Summary- No Fail.

Figure 5: Resulting Fixed-Point Model.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.