Explore content of code replacement libraries
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.
实现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, seeDefine Code Replacement Library Optimizations(Embedded Coder).
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 orRTW_OP_ADD ). |
实现 | Name of the implementation function, which can match or differ fromName. |
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. |
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 orRTW_OP_ADD ), and the number of conceptual input arguments. |
||||||||
实现 | Name of the implementation function, and the number of implementation input arguments. | ||||||||
实现type | Type of implementation:FCN_IMPL_FUNCT 对函数或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. | ||||||||
实现header | Name of the header file that declares the implementation function. | ||||||||
实现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 orRTW_IO_INPUT ), and data type for each conceptual argument. |
||||||||
实现 | Name, I/O type (RTW_IO_OUTPUT orRTW_IO_INPUT ), data type, and alignment requirement for each implementation argument. |
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 from the MATLAB®command prompt usingcrviewer
.
This example opens the registered code replacement libraryGNU C99 extensions
.
crviewer('GNU C99 extensions')
This example opens a predefined code replacement tablecrl_table_sinfcn
. To learn how to create this example table, seeDefine Code Replacement Library Optimizations(Embedded Coder).
crviewer(crl_table_sinfcn)
crviewer('library')
crviewer('library')
opens the Code Replacement Viewer and displays the contents of图书馆
, where图书馆
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 predefinedtable
, wheretable
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.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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:.
Selectweb siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.