Code Replacement Viewer
Explore content of code replacement libraries
Description
The Code Replacement Viewer displays the content of code replacement libraries and tables. You can use this tool to explore and choose a code replacement library or to view a predefined code replacement table. If you develop a custom code replacement library, you can use this viewer to verify table entries for the following properties:
Argument order is correct.
Conceptual argument names match code generator naming conventions.
Implementation argument names are correct.
Header or source file specification is not missing.
I/O types are correct.
Relative priority of entries is correct (highest priority is 0, and lowest priority is 100).
Saturation or rounding mode specifications are not missing.
If you specify a library name when you open the viewer, the viewer displays the code replacement tables for that library. If you specify a table name when you open the viewer, the viewer displays the function and operator code replacement entries for that table. The viewer can only display code replacement tables that are defined. For more information on creating code replacement tables, see Define Code Replacement Library Optimizations (Embedded Coder).
More
Abbreviated Entry Information
In the middle pane, the viewer displays entries that are in the selected code replacement table, along with abbreviated information for each entry.
Field | Description |
---|---|
Name | Name or identifier of the function or operator being replaced
(for example, cos or
RTW_OP_ADD ). |
Implementation | Name of the implementation function, which can match or differ from Name. |
NumIn | Number of input arguments. |
In1Type | Data type of the first conceptual input argument. |
In2Type | Data type of the second conceptual input argument. |
OutType | Data type of the conceptual output argument. |
Priority | The entry's match priority, relative to other entries of the same name and to the conceptual argument list within the selected code replacement library. The priority can range from 0 to 100, with 0 being the highest priority. The default is 100. If the library provides two implementations for a function or operator, the implementation with the higher priority shadows the one with the lower priority. |
UsageCount | Not used. |
Detailed Entry Information
In the middle pane, when you select an entry, the viewer displays entry details.
Field | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Description | Text description of the table entry (can be empty). | ||||||||
Key | Name or identifier of the function or operator being replaced
(for example, cos or
RTW_OP_ADD ), and the number of conceptual
input arguments. | ||||||||
Implementation | Name of the implementation function, and the number of implementation input arguments. | ||||||||
Implementation type | Type of implementation: FCN_IMPL_FUNCT for
function or FCN_IMPL_MACRO for macro. | ||||||||
Saturation mode | Saturation mode that the implementation function supports. One of:
| ||||||||
Rounding modes | Rounding modes that the implementation function supports. One or more of:
| ||||||||
GenCallback file | Not used. | ||||||||
Implementation header | Name of the header file that declares the implementation function. | ||||||||
Implementation source | Name of the implementation source file. | ||||||||
Priority | The entry's match priority, relative to other entries of the same name and to the conceptual argument list within the selected code replacement library. The priority can range from 0 to 100, with 0 being the highest priority. The default is 100. If the library provides two implementations for a function or operator, the implementation with the higher priority shadows the one with the lower priority. | ||||||||
Total Usage Count | Not used. | ||||||||
Entry class | Class from which the current table entry is instantiated. | ||||||||
Conceptual arguments | Name, I/O type (RTW_IO_OUTPUT or
RTW_IO_INPUT ), and data type for each
conceptual argument. | ||||||||
Implementation | Name, I/O type (RTW_IO_OUTPUT or
RTW_IO_INPUT ), data type, and alignment
requirement for each implementation argument. |
Fixed-Point Entry Information
When you select an operator entry that specifies net slope fixed-point parameters, the viewer displays fixed-point information.
Field | Description |
---|---|
Net slope adjustment factor F | Slope adjustment factor (F) part of the net slope factor, F2E , for net slope table entries. You use this factor with fixed-point multiplication and division replacement to map a range of slope and bias values to a replacement function. |
Net fixed exponent E | Fixed exponent (E) part of the net slope factor, F2E, for net slope table entries. You use this fixed exponent with fixed-point multiplication and division replacement to map a range of slope and bias values to a replacement function. |
Slopes must be the same | Indicates whether code replacement request processing must check that the slopes on arguments (input and output) are equal. You use this information with fixed-point addition and subtraction replacement to disregard specific slope and bias values, and map relative slope and bias values to a replacement function. |
Must have zero net bias | Indicates whether code replacement request processing must check that the net bias on arguments is zero. You use this information with fixed-point addition and subtraction replacement to disregard specific slope and bias values, and map relative slope and bias values to a replacement function. |
Open the Code Replacement Viewer
Open from the MATLAB® command prompt using crviewer
.
Examples
Display Contents of Code Replacement Library
This example opens the registered code replacement library GNU
C99
extensions
.
crviewer('GNU C99 extensions')
Display Contents of Code Replacement Table
This example opens a predefined code replacement table
crl_table_sinfcn
. To learn how to create this example
table, see Define Code Replacement Library Optimizations (Embedded Coder).
crviewer(crl_table_sinfcn)
Related Examples
Programmatic Use
crviewer('library')
crviewer('library')
opens the Code Replacement Viewer and
displays the contents of library
, where
library
is a character vector that names a registered code
replacement library.
crviewer(table)
crviewer(table)
opens the Code Replacement Viewer and
displays the contents of a predefined table
, where
table
is a MATLAB file that defines code replacement tables. The table must be user
predefined and the file must be in the current folder or on the MATLAB path.
Version History
Introduced in R2014b
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)