Predefined Symbols and Processor Families

The compiler defines a few symbols to support the ColdFire processors and families. Symbol __COLDFIRE__ is always set to represent the currently selected processor. All processors and families are symbolically represented with __MCFzzzz__ where zzzz represents either a family or a processor part number. ColdFire processors are combined into functional families. Selecting a family brings in scope the parts belonging to that set. This selection is occurs in the code generation settings panel. Once a family and processor is selected, it defines a serie of built-in macros making it possible for users to specialize their code by family and processors within a family.

Family Parts

521x 5211 5212 5213

5214_6 5214 5216

5221x 52210 52211 52212 52213

521x0 52100 52110

5222x 52221 52223

5223x 52230 52231 52232 52233 52234 52235 52236

528x 5280 5281 5282

5206e 5206e

5207_8 5207 5208

523x 5235

524x 5249

525x 5251 5253

5270_1 5270 5271

5272 5272

5274_5 5274 5275

5307 5307

532x 5327 5328 5329

537x 5371 5372 5373

5407 5407

5445x 54450 54451 54452 54453 54454 54455

547x 5470 5471 5472 5473 5474 5475

548x 5480 5481 5482 5483 5484 5485

For example, selecting a 54455 brings in scope all other processors belonging to that family as well as the family, the resulting set of built-in symbols is { __MCF5445x__, __MCF54450__, __MCF54451__, __MCF54452__, __MCF54453__, __MCF54454__, __MCF54455__ }. The processor values are all distinct and the family value is simply defined.

  #ifdef __MCF5445x__ 

  /** this is true for **/ 

  #if __COLDFIRE__ == __MCF54455__ 

  /** this is true **/ 

  #elif __COLDFIRE__ == __MCF54454__ 

  /** this id false since the 54455 was selected **/ 

  #endif 

  #endif 

  #ifdef __MCF547x__


  /** this is false, we didn't select that family **/

  #endif

  #if __COLDFIRE__ == __MCF5445x__

  /** this is false since __COLDFIRE__ represents a part and 
  not a family **/

  #endif

  

This topic contains the following topic: