| Using Simulink | ![]() |
This pane applies to models of computer-based systems, such as embedded controllers. It allows you to specify the characteristics of the hardware to be used to implement the system represented by this model. This in turn enables simulation of the model to detect error conditions that could arise on the target hardware, such as hardware overflow.
This pane contains the following groups of controls.
Embedded hardware
This group of controls enables you to specify the characteristics of the hardware that will be used to implement the production version of the system represented by this model. (See Emulation hardware for information on specifying the characteristics of hardware used to emulate the production hardware.) This group includes the following controls.
Device type. Specifies the type of hardware that will be used to implement the production version of the system represented by this model. The adjacent list lists types of hardware that Simulink knows about and hence does not require you to enter their characteristics. If your production hardware does not match any of the listed types, select Unspecified (assume 32-bit Generic) if it has the characteristics of a generic 32-bit microprocessor; otherwise, Custom.
Number of bits. This group of controls specifies the length in bits of C data types supported by the selected device type. Simulink disables these controls if it knows the data type lengths for the selected device type.
Native word size. Specifies the word length in bits of the selected production hardware device type. Simulink disables this field if it knows the word length of the selected device type.
Signed integer division rounds to. Specifies how an ANSI C conforming compiler used to compile code for the production hardware rounds the result of dividing one signed integer by another to produce a signed integer quotient. The options are
If the ideal quotient is between two integers, the compiler chooses the integer that is closest to zero as the result.
If the ideal quotient is between two integers, the compiler chooses the integer that is closest to negative infinity as the result.
The following table illustrates the compiler behavior specified by these options.
| N |
D |
Ideal N/D |
Zero |
Floor |
Undefined |
33 |
4 |
8.25 |
8 |
8 |
8 |
-33 |
4 |
-8.25 |
-8 |
-9 |
-8 or -9 |
33 |
-4 |
-8.25 |
-8 |
-9 |
-8 or -9 |
-33 |
-4 |
8.25 |
8 |
8 |
-8 or -9 |
The setting of this option affects only generation of code from the model (see the Real-Time Workshop documentation for information on how this option affects code generation). Use the Round integer calculations toward parameter settings on your model's blocks to simulate the rounding behavior of the C compiler that you intend to use to compile code generated from the model. This setting appears on the Signal data type pane of the parameter dialog boxes of blocks that can perform signed integer arithmetic, such as the Product and Sum blocks.
Shift right on a signed integer as arithmetic shift. Select this option if the C compiler implements a signed integer right shift as an arithmetic right shift. An arithmetic right shift fills bits vacated by the right shift with the value of the most significant bit, which indicates the sign of the number in twos complement notation. It is equivalent to dividing the number by 2. This setting affects only code generation.
Byte ordering. Specifies the significance of the first byte of a data word of the target hardware. Select Big Endian if the first byte is the most significant, Little Endian if it is the least significant, or Unspecified if the significance is unknown. This setting affects only code generation. See the Real-Time Workshop documentation for more information.
Emulation hardware
This group of controls allows you to specify the characteristics of hardware used to test code generated from this model.
Initially, this group of controls has only one control.
None. If checked, this check box specifies that the hardware used to test the code generated from this model is the same as the production hardware or has the same characteristics. If you plan to use emulation hardware that has different characteristics, unselect this check box. This causes Simulink to expand the group to display controls that allow you to specify the characteristics of the emulation hardware.
The additional controls are identical to the ones used to specify the characteristics of the target hardware for your system. See Embedded hardware for information on using these controls.
| The Diagnostics Pane | Model Referencing Pane | ![]() |
© 1994-2005 The MathWorks, Inc.