Methods and systems are provided for automatically generating code from a
graphical model representing a design to be implemented on components of
a target computational hardware device. During the automatic code
generating process, a memory mapping is automatically determined and
generated to provide an optimization of execution of the program on the
target device. The optimized memory mapping is incorporated into building
the program executable from the automatically generated code of the
graphical model.