Create Model Object - 7.2 English

FIR Compiler (PG149)

Document ID
PG149
Release Date
2022-10-26
Version
7.2 English

xip_fir_v7_2

xip_fir_v7_2_create(

const xip_fir_v7_2_config* config,

xip_msg_handler msg_handler,

void* msg_handle

)

This function creates a new model instance, based on the configuration data pointed to by config .

The msg_handler argument is a pointer to a function taking three arguments as previously defined in Type Definitions . This function pointer is retained by the model object and is called whenever the model wishes to issue a note, warning or error message. Its arguments are:

1. A generic pointer (void*). This is always the value that was passed in as the msg_handle argument to the create function.

2. An integer (int) indicating whether the message is an error (1) or a note or warning (0).

3. The message string itself.

If the handler argument is a null pointer, then the C model outputs no messages at all. Using this mechanism, you can choose whether to output messages to the console, log them to a file or ignore them completely.

The create function returns a pointer to the newly created object. If the object cannot be created, then a diagnostic error message is emitted using the supplied handler function (if any) and a null pointer is returned.

If the data and coefficient widths, number of coefficients and output precision result in an output precision greater than supported by the double ( xip_real ) data type then the model uses the mpz_t data type [Ref 14] ( xip_mpz ) and issues a warning indicating this requirement when this function is executed.