Specifications

CAVR-4
Part 1. Using the compiler
Getting started
9
Note:
*)
When using the -v5 or the -v6 option, it is possible, for individual functions,
to override the
__farfunc attribute and instead use the __nearfunc attribute
Pointers with function memory attributes have restrictions in implicit and
explicit casts between pointers and between pointers and integer types. For
details about the restrictions, see Casting, page 142
-v2 and -v4: There are currently no derivatives that match these processor
options, which have been added to support future derivatives
All implicit assumptions for a given -v option are also true for corresponding
--cpu options.
It is important to be aware of the fact that the
-v option does not reflect the amount of
used data, but the maximum amount of addressable data. This means that, for example,
if you are using a microcontroller with 16 Mbyte addressable data, but you are not using
more than 256 bytes or 64 Kbytes of data, you must still use either the
-v4 or the -v6
option for 16 Mbyte data.
MEMORY MODEL
One of the characteristics of the AVR microcontroller is that there is a trade-off
regarding the way memory is accessed, ranging from cheap access limited to small
memory areas, up to more expensive access methods that can access any location in
memory.
In the AVR IAR C/C++ Compiler, you can set a default memory access method by
selecting a memory model. There are three memory models available—Tiny, Small, and
Large. Your choice of processor option determines which memory models are available.
If you do not specify a memory model option, the compiler will use the Tiny memory
model for all processor options, except for
-v4 and -v6, where the Small memory
model will be used.
-v2 Tiny __nearfunc 256 bytes 128 Kbytes
-v3 Tiny, Small __nearfunc 64 Kbytes 128 Kbytes
-v4 Small, Large __nearfunc 16 Mbytes 128 Kbytes
-v5 Tiny, Small __farfunc
*
64 Kbytes 8 Mbytes
-v6 Small, Large __farfunc
*
16 Mbytes 8 Mbytes
Generic processor
option
Available
memory models
Function
memory
attribute
Max addressable
data
Max module and/or
program size
Table 3: Summary of processor configuration (Continued)