主要内容

集成外部代码

External code integration using custom fixed-point S-functions

使用自定义的固定点S函数集成外部代码。

Functions

expand all

Convert Data Type

ssFxpConvert Convert value from one data type to another
ssFxpConvertFromRealWorldValue Convert value of data typedoubleto another data type
SSFXPConvertTorealWorldValue Convert value of any data type todouble

U32 Bit Region

ssFxpGetU32BitRegion Return stored integer value for 32-bit region of real, scalar signal element
SSFXPGETU32BITRIGIONCOMPLIANT 确定s功能是否符合U32位区域接口
ssFxpSetU32BitRegion 设置的存储整数值32位区域的真实标量信号元件
ssFxpSetU32BitRegionCompliant Declare compliance with the U32 bit region interface for fixed-point data types with 33 or more bits

Registered Data Type Information

ssgetDatatypebias Return bias of registered data type
ssGetDataTypeFixedExponent Return exponent of slope of registered data type
ssGetDataTypeFracSlope Return fractional slope of registered data type
ssgetDatatypeFractionLength 带有两个缩放的注册数据类型的返回分数长度
SSGETDATATATYPEFXPCONTAINWORDLEN 返回单词的存储容器注册数据类型的存储容器
ssgetDatatyPefxpissigned Determine whether fixed-point registered data type is signed or unsigned
ssGetDataTypeIsDoubleSingleorHalf 确定注册数据类型是双重,单一或半精度数据类型
SSGETDATATATYPEFXPWORDLENGTH Return word length of fixed-point registered data type
SSGETDATATYPESIXEDPOINT 确定注册数据类型是否为定点数据类型
ssGetDataTypeIsFloatingPoint Determine whether registered data type is floating-point data type
ssgetDatatypeSisfxpflTapicompat Determine whether registered data type is supported by API for user-written fixed-point S-functions
ssGetDataTypeIsHalfPrecision Determine whether registered data type is half-precision data type
ssGetDataTypeIsScalingPow2 Determine whether registered data type has power-of-two scaling
ssGetDataTypeIsScalingTrivial Determine whether scaling of registered data type is slope = 1, bias = 0
ssGetDataTypeNumberOfChunks 返回注册数据类型的多字存储容器中的块数
ssGetDataTypeStorageContainCat Return storage container category of registered data type
ssGetDataTypeStorageContainerSize 返回存储容器大小注册数据类型的大小
SSGETDATATATYTOTALSLOPE Return total slope of scaling of registered data type

记录在模拟过程中收集的信息

sslogFixptInstrumentation Record information collected during simulation

注册定点数据类型

ssRegisterDataTypeFxpSlopeBias 注册数据类型,具有[斜率偏置]缩放并返回其数据类型ID
ssregisterdatatepehalfprecision 注册半精度数据类型并返回其数据类型ID
ssregisterDatatatPefxPscaleDdouble 用[斜率偏置]缩放缩放量表缩放双数据类型,根据分​​数斜率,固定指数和偏置指定,并返回其数据类型ID
ssRegisterDataTypeFxpFSlopeFixExpBias 用[斜率偏置]缩放缩放按分数斜率,固定指数和偏置指定的固定点数据类型,然后返回其数据类型ID
ssRegisterDataTypeFxpBinaryPoint 使用仅二进制缩放缩放并返回其数据类型ID,注册定点数据类型

Topics

  • 数据类型支持金宝app

    Lists the data types supported by the API and discusses the treatment of integers and data-type-overridden signals.

  • s功能的结构

    显示直接处理固定点数据类型的S功能的基本结构。

  • Storage Containers

    讨论用于保存模拟和代码生成中信号的容器。

  • Data Type IDs

    Describes the creation, assignment, and usage of data type IDs, including how to get and set information about data types in an S-function.

  • Overflow Handling and Rounding Methods

    Discusses the tokens you can use to define overflow handling and rounding methods in your fixed-point S-function, and describes the overflow logging structure.

  • Create MEX-Files

    Describes the extra steps that you need to take to create MEX-files for fixed-point S-functions.

  • 获取输入端口数据类型

    在S功能中,您可能需要了解不同端口,运行时参数和DWorks的数据类型。

  • 设置输出端口数据类型

    You may want to set the data type of various ports, run-time parameters, or DWorks in your S-function.

  • 解释输入值

    假设您需要在输入端口上获取信号的值,以在S功能中使用。

  • Write an Output Value

    Suppose you need to write the value of the output signal to the output port in your S-function.

  • Determine Output Type Using the Input Type

    以下来自第243至261行的示例代码sfun_user_fxp_asr.cgives an example of using the data type of the input to your S-function to calculate the output data type.