beautypg.com

Sundance PARS User Manual

Page 35

background image

Revision 11-wip-7

Page 35 of 70

Sundance Digital Signal Processing, Inc.

4790 Caughlin Parkway 233, Reno, NV 89519-0907, U.S.A.

email:

[email protected]

Tel: +1 (775) 827-3103

www.sundancedsp.com

Using PARS causes changes to the model in order to manage its metadata; these changes
are non-reversible, so PARS always works with a copy of the original model. The PARS
model is derived from the original model as follows:

Given a Simulink model:

.

mdl

, the PARS model will be:

_PARS\

<model_name>

_PARS.mdl

For example, if your Simulink model is ‘

C:\test\thing.mdl’

, the PARS model will be

C:\test\thing_PARS\thing_PARS.mdl’

You only need to open the original Simulink model, PARS will create the working space for the PARS
model, perform the needed copy and preparation of the model. When you open a Simulink model,
PARS analyzes the corresponding PARS model and takes one of the following actions:

• If the PARS model does not exist, PARS creates it by taking a copy of the original model and

then silently opens the copy.

• If the PARS model exists and has a modification date later than that of the original model, the

PARS model will be opened silently.

• Otherwise, PARS will warn you that the models are inconsistent and offer to create a backup of

the PARS model; then it derives the working model by making a copy of the original model. No
changes will be made and nothing will be opened if you decline the offer.

Backups are made according to the following procedure:

1. A new sub-folder called ‘model_backup’ will be created if necessary.

2. The existing PARS model will be moved to this folder and renamed by adding a suffix of an

underscore and the PARS model's modification date and time.

Note that PARS does not attempt to detect/prevent you from modifying the

.mdl

files directly, but

please be aware that inconsistencies in state can be introduced so the practice is discouraged.

3.2.

PREPARING FOR CODE GENERATION

Before attempting to generate any code with PARS, it is important to ensure that the target model will
be realizable in an embedded system. In order to do this, several configuration properties of the
simulation model should be set and the model verified in simulation.

Most notably, any system must be discrete. No continuous states are possible, as the underlying
computation fabric for the (known) embedded systems are based on synchronous logic operations.

Simulink provides a function to discretize a continuous model with the function ‘

sldiscmdl

’. An

example that uses this function is provided in the PARS demonstration applications.