User`s guide

3 Working with Real-Time Workshop
3-62
Working with Project Directories
When you view generated code in Model Explorer, the files listed in the
Contents pane can exist either in a build directory or a project directory.
Model reference project directories (always rooted under
slprj), like build
directories, are created in your current working directory, and this implies
certain constraints on when and where model reference targets are built, and
how they are accessed.
The models referenced by Model blocks can be stored anywhere. A given top
model can include models stored on different file systems and directories. The
same is not true for the simulation targets derived from these models; under
most circumstances, all models referenced by a given top model must be set
up to simulate and generate model reference target code in a single project
directory. The top and referenced models can exist anywhere on your path,
but the project directory is assumed to exist in your current directory.
This means that, if you reference the same model from several top models,
each stored in a different directory, you must either
Always work in the same directory and be sure that the models are on your
path
Allow separate project directories, simulation targets, and Real-Time
Workshop targets to be generated in each directory in which you work
The files in such multiple project directories will generally be quite
redundant. Therefore, to avoid regenerating code for referenced models more
times than necessary, you might want to choose a specific working directory
and remain in it for all sessions.
As model reference code generated for Real-Time Workshop targets as well as
for simulation targets is placed in project directories, the same considerations
as above apply even if one is generating target applications only. That is, code
for all models referenced from a given model ends up being generated in the
same project directory, even if it is generated for different targets and at
different times.