|
| 1 | +.. _building-user-guide: |
| 2 | + |
| 3 | +Building User Guide |
| 4 | +=================== |
| 5 | + |
| 6 | +Project Build Settings |
| 7 | +---------------------- |
| 8 | + |
| 9 | +To see your project build settings, right click on your project and select |
| 10 | +**Properties** from the pop-up menu. In the appeared dialog choose |
| 11 | +**C/C++ Build > Settings**, then select **Tool Settings** tab. |
| 12 | + |
| 13 | +.. figure:: images/building/properties.png |
| 14 | + |
| 15 | + Project Build Settings page |
| 16 | + |
| 17 | +At the left of the tab there is a list of tools which are used to build your |
| 18 | +project and **Target Processor**, **Debugging** and **Additional Tools** pages. |
| 19 | +For each of the listed tools there are some pages where you can set properties |
| 20 | +for these tools. |
| 21 | + |
| 22 | +Target Processor Page |
| 23 | +--------------------- |
| 24 | + |
| 25 | +On this page there are properties that describe your target. These properties |
| 26 | +are different for different processors. |
| 27 | + |
| 28 | +.. figure:: images/building/hs_target_options.png |
| 29 | + |
| 30 | + Target Processor Page for ARC HS |
| 31 | + |
| 32 | +CPU option |
| 33 | +---------- |
| 34 | + |
| 35 | +CPU option for ARC 600 and ARC 700 has only one value, but for ARC EM there |
| 36 | +are several possible values: ``arcem``, ``em``, ``em4``, ``em4_dmips``, ``em4_fpus`` |
| 37 | +and ``em4_fpuda``. Possible values for ARC HS CPU are ``archs``, ``hs``, ``hs34``, |
| 38 | +``hs38`` and ``hs38_linux``. For each of these values there are precompiled standard |
| 39 | +libraries that use some other target options. For example, if you choose ``hs34`` |
| 40 | +as you CPU, standard library that uses atomic functions and multiply |
| 41 | +option "mpy" will be used. Values of these options are set in IDE when CPU is |
| 42 | +selected and can not be changed to weaker values without changing CPU. For |
| 43 | +example, if DP FPU is selected as a result of selecting CPU, you can not change |
| 44 | +it to any of SP FPU values or "None", but you can change it to DP FPU with extensions. |
| 45 | + |
| 46 | +.. figure:: images/building/hs34_selected.png |
| 47 | + |
| 48 | + ARC HS Target Processor Page with ``hs34`` selected as CPU value |
| 49 | + |
| 50 | +Here are the options that are required for each of CPU values: |
| 51 | + |
| 52 | +.. table:: |
| 53 | + |
| 54 | + ========= ======== ====================== ============== ============ ============== ======= ==== |
| 55 | + CPU Multiply FPU Barrel shifter Code density Integer divide Bitscan Swap |
| 56 | + ========= ======== ====================== ============== ============ ============== ======= ==== |
| 57 | + arcem wlh1 none \+ \+ \- \- \- |
| 58 | + em none none \- \- \- \- \- |
| 59 | + em4 none none \- \+ \- \- \- |
| 60 | + em4_dmips wlh1 none \+ \+ \+ \+ \+ |
| 61 | + em4_fpus wlh1 SP FPU \+ \+ \+ \+ \+ |
| 62 | + em4_fpuda wlh1 FPU with double assist \+ \+ \+ \+ \+ |
| 63 | + ========= ======== ====================== ============== ============ ============== ======= ==== |
| 64 | + |
| 65 | +.. table:: |
| 66 | + |
| 67 | + ========== ========== ========================== ============== ================= ====== |
| 68 | + CPU Multiply FPU Integer divide 64-bit load/store Atomic |
| 69 | + ========== ========== ========================== ============== ================= ====== |
| 70 | + archs mpy none \+ \+ \+ |
| 71 | + hs none none \- \- \- |
| 72 | + hs34 mpy none \- \- \+ |
| 73 | + hs38 plus_qmacw none \+ \+ \+ |
| 74 | + hs38_linux plus_qmacw DP FPU with all extensions \+ \+ \+ |
| 75 | + ========== ========== ========================== ============== ================= ====== |
| 76 | + |
| 77 | +.. note:: |
| 78 | + |
| 79 | + Note that if you use TCF to provide target options, there are no checks that |
| 80 | + option values are consistent with CPU and you can specify there values that |
| 81 | + are weaker than CPU value requires. So please be careful when editing TCFs. |
| 82 | + |
| 83 | +Other options and TCF |
| 84 | +--------------------- |
| 85 | + |
| 86 | +* Endianness is set when you choose a toolchain for your project and can not be |
| 87 | + changed. |
| 88 | +* Other architecture options you can either set manually or choose a TCF file |
| 89 | + for used CPU core (available only for ARC EM and HS), which will set these options |
| 90 | + automatically. The only option that is not set automatically by selecting |
| 91 | + a TCF file is **ABI selection** option, which is available only for ARC HS processors. |
| 92 | + |
| 93 | +.. figure:: images/building/target_tcf_selected.png |
| 94 | + |
| 95 | + Target Processor Page for ARC HS with TCF checkbox selected |
| 96 | + |
| 97 | +It is recommended to use TCF files, because they are generated from the Build |
| 98 | +Configuration Registers and thus most reliably describe target core. |
| 99 | +TCF files are provided by your chip designer. |
| 100 | + |
| 101 | +To see which options are set automatically if TCF is chosen, you can select a |
| 102 | +tool from the list on the left of the dialog and see the list of options to be |
| 103 | +passed to this tool in the **All options** field. |
| 104 | + |
| 105 | +.. figure:: images/building/compiler_options_list.png |
| 106 | + |
| 107 | + List of all the options to be passed to compilerx |
| 108 | + |
| 109 | +If **TCF** is selected, **Use memory map from TCF** checkbox becomes enabled. |
| 110 | +If you check **Use memory map from TCF** box, memory map from TCF file will be |
| 111 | +passed to the linker. |
| 112 | + |
| 113 | +Note that templates from **AXS10x Projects** and **EM Starter Kit Projects** |
| 114 | +already contain memory maps that are used if no other is provided. However, |
| 115 | +this is true only for **Hello World for EM SK** and **Empty Project For** |
| 116 | +templates, but not **Empty Project** ones. **Empty Project** templates are |
| 117 | +generated automatically by Eclipse and do not contain any specific information. |
| 118 | + |
| 119 | +.. figure:: images/creating_project/memory_map.png |
| 120 | + |
| 121 | + Memory map for **Hello World for EM SK 2.1 Project** |
0 commit comments