Code Replacement Viewer

Explore content of code replacement libraries

Description

The Code Replacement Viewer displays the content of code replacement libraries. Use the tool to explore and choose a library. If you develop a custom code replacement library, use the tool to verify table entries.

  • 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 that the library contains. When you select a code replacement table, the viewer displays function and operator code replacement entries that are in that table.

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.

FieldDescription
NameName or identifier of the function or operator being replaced (for example, cos or RTW_OP_ADD).
ImplementationName of the implementation function, which can match or differ from Name.
NumInNumber of input arguments.
In1TypeData type of the first conceptual input argument.
In2TypeData type of the second conceptual input argument.
OutTypeData type of the conceptual output argument.
PriorityThe 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.
UsageCountNot used.

Detailed Entry Information

In the middle pane, when you select an entry, the viewer displays entry details.

FieldDescription
DescriptionText description of the table entry (can be empty).
KeyName or identifier of the function or operator being replaced (for example, cos or RTW_OP_ADD), and the number of conceptual input arguments.
ImplementationName of the implementation function, and the number of implementation input arguments.
Implementation typeType of implementation: FCN_IMPL_FUNCT for function or FCN_IMPL_MACRO for macro.
Saturation mode

Saturation mode that the implementation function supports. One of:

RTW_SATURATE_ON_OVERFLOW
RTW_WRAP_ON_OVERFLOW
RTW_SATURATE_UNSPECIFIED
Rounding modes

Rounding modes that the implementation function supports. One or more of:

RTW_ROUND_FLOOR
RTW_ROUND_CEILING
RTW_ROUND_ZERO
RTW_ROUND_NEAREST
RTW_ROUND_NEAREST_ML
RTW_ROUND_SIMPLEST
RTW_ROUND_CONV
RTW_ROUND_UNSPECIFIED
GenCallback fileNot used.
Implementation headerName of the header file that declares the implementation function.
Implementation sourceName of the implementation source file.
PriorityThe 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 CountNot used.
Entry classClass from which the current table entry is instantiated.
Conceptual argumentsName, I/O type (RTW_IO_OUTPUT or RTW_IO_INPUT), and data type for each conceptual argument.
ImplementationName, 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.

FieldDescription
Net slope adjustment factor FSlope 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 EFixed 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 sameIndicates 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 biasIndicates 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 App

Open from the MATLAB® command prompt using crviewer.

Examples

expand all

crviewer('ARM Cortex-A')

crviewer(clr_table_ne10)

Related Examples

Programmatic Use

expand all

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. For example, 'GNU 99 extensions'.

crviewer(table) opens the Code Replacement Viewer and displays the contents of table, where table is a MATLAB file that defines code replacement tables. The file must be in the current folder or on the MATLAB path.

Was this topic helpful?