Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
  • Groups
    • Research Collaboration and Enablement
    • DesignStart
    • Education Hub
    • Innovation
    • Open Source Software and Platforms
  • Forums
    • AI and ML forum
    • Architectures and Processors forum
    • Arm Development Platforms forum
    • Arm Development Studio forum
    • Arm Virtual Hardware forum
    • Automotive forum
    • Compilers and Libraries forum
    • Graphics, Gaming, and VR forum
    • High Performance Computing (HPC) forum
    • Infrastructure Solutions forum
    • Internet of Things (IoT) forum
    • Keil forum
    • Morello Forum
    • Operating Systems forum
    • SoC Design and Simulation forum
    • 中文社区论区
  • Blogs
    • AI and ML blog
    • Announcements
    • Architectures and Processors blog
    • Automotive blog
    • Graphics, Gaming, and VR blog
    • High Performance Computing (HPC) blog
    • Infrastructure Solutions blog
    • Innovation blog
    • Internet of Things (IoT) blog
    • Operating Systems blog
    • Research Articles
    • SoC Design and Simulation blog
    • Tools, Software and IDEs blog
    • 中文社区博客
  • Support
    • Arm Support Services
    • Documentation
    • Downloads
    • Training
    • Arm Approved program
    • Arm Design Reviews
  • Community Help
  • More
  • Cancel
中文社区
中文社区
中文社区博客 在CPAK上使用ARM Compiler6
  • Blogs
  • Forum
  • 视频和文件
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • Jump...
  • Cancel
  • New
中文社区 requires membership for participation - click to join
More blogs in 中文社区
  • ARM中国大学计划博客

  • Arm新闻

  • 中文mbed博客

  • 中文社区博客

  • 恩智浦汽车电子MCU讨论区博客

 

Tags
  • models
  • Arm Compiler 6
Actions
  • RSS
  • More
  • Cancel
Related blog posts
Related forum threads

在CPAK上使用ARM Compiler6

feng
feng
February 22, 2017
Less than one minute read time.
本文译自Jason andrew Blog:https://community.arm.com/soc/b/blog/posts/using-arm-compiler-6-with-carbon-performance-analysis-kits-cpaks
部分内容版本信息等稍作调整。
 
本示例针对如何在CPAK(ARM Cycle Model Performance Analysis Kit)上使用最新的ARM Complier 6。该Compiler基于Clang和LLVM的编译框架,并提供最佳的ARM架构代码生成。
 
介绍
ARM® Cortex®-A57与Cortex-A53处理器CPAK提供的64位裸机软件实例,用户可以修改并使用DS-5的ARM Complier 6来重新编译。
ARM Complier 6是基于Clang和LLVM的编译框架,同时提供最佳的ARM架构代码生成。
 
迁移指南
如果需要更好理解armcc与armclang的差异,请参考 ARM Compiler Migration Guide。该文档描述了两个编译器之间的命令行差异,以及如何映射新旧编译器的编译开关。文档还包括两个额外的工具已帮助切换编译器:
  • 代码兼容性检查程序
  • 命令行转换包装程序
兼容性检查程序可帮助找出源代码在迁移中的问题,而转换包装程序让用户可以像以往一样自动调用ARMCC等效选项,但同时隐藏armclang的调用。迁移会涉及新的编译器调用和开关,但也可能涉及诸如语法和属性等因编译器不同而已的源代码改动。
 
在Cortex-A53 CPAK上使用Compiler 6
本文选用Cortex-A53 CPAK中Applications目录下的DecrDataMP_v8用例。这是个双Cluster且每个Cluster单个core的Cortex-A53系统,同时包括保证Cache一致性的CCI-400和连接外设的NIC-400。系统框图如下:
用Linux bash将DS-5的bin/路径添加到相关的环境路径来建立DS-5工作环境。根据安装情况调整如下路径:
$ export PATH=$PATH:/o/tools/linux/ARM/DS5_5.<version>/64bit/bin
其中<version>是所安装的DS-5版本。
注意:最新的DS-5 32bit与64bit版本均已支持ARM Compiler6。
第一步,使用ARM Compiler 6来编辑Makefile,将armcc替换为armclang来编译C文件。汇编文件仍可以使用armasm编译以及armlink来链接。armclang也可以用来编译和链接汇编代码,在此本示例不多作阐述。
Makefile将compiler定义为CC变量,所以CC=armclang。
第二步,接下来重要的改动是目标CPU的说明。armcc中我们使用--cpu的选项,比如用户可以在Makefile中看到--cpu=8-A.64.no_neon。下面命令可以帮助得到所有可能的目标cpulist:
$ armcc --cpu list
第三步,armclang中目标CPU选择使用-target选项。如果选用AArch64,使用 -target aarch64-arm-none-eabi即可。
命令调用和目标CPU选择是armcc到armclang切换的主要区别。
 
其他选项
  1. CPAK 选用的软件使用--c90来表示C的版本信息,对于armclang, 可以Makefile进行等效的命令修改-xc-std=c90。
  2. 另一个问题是--dwarf3选项,armclang仅支持DWARF4。
  3. Makefile也使用了-Ospace选项通过牺牲运行速度来缩小程序占用空间。armclang中此选项改为-Os.
  4. 最后的差异与armlink相关。armlink命令需要--force-scanlib来告诉armlink包含ARM的库。根据文档说明,该选项在直接运行armlink时是强制需要的。armlink后加上该标志,编译则成功完成并生成.axf文件。
 
下表总结了新旧compiler的主要区别:
ARM Compiler 5
ARM Compiler 6
使用armcc
使用armclang
--cpu=8-A.64.no_neon
-target aarch64-arm-none-eabi
--dwarf3
None
-Ospace
-Os
 
--force_scanlib
 
创建DS-5 Eclipse工程
我们使用DS-5 Eclipse环境来编译文中示例,下面步骤使用新的Makefile工程:
1。首先打开Eclipse 
$ eclipse &
2。等待Eclipse打开,使用菜单File -> New -> Makefile Project with Existing Code创建工程。
3。对话框中输入工程名,浏览至代码所在位置,选择ARM Compiler6作为Toolchain for indexer settings。
4。一旦工程建好,使用工程菜单中Build Project来编译代码。
 
======================================
注:本文提供了初学者使用ARM Compiler6的一些贴士,同时值得一提的是CPAK中使用的ARM Cycle模型是基于RTL编译具备100%的功能与时序准确性,且提供了性能分析的各种手段(具体请参考Cycle Model主页),因此CPAK可以作为用户学习理解ARM Compiler6的一个不错平台。
 
FENG NIU(牛锋), ARM上海, Technical Specialist for ARM Model solutions.
Anonymous
中文社区博客
  • Arm A-Profile构架2022扩展

    Zenon Xiu (修志龙)
    Zenon Xiu (修志龙)
    原文:Arm A-Profile Architecture Developments 2022 - Architectures and Processors blog - Arm Community blogs - Arm Community  作者:Martin Weidmann翻译:修志龙(Zenon Xiu) 与arm构架授权和生态伙伴一起,arm持续演进其构架,开发新功能以满足现有和新市场的要求…
    • October 17, 2022
  • 深入理解 Arm A-profile的non-maskable interrupt -NMI

    Zenon Xiu (修志龙)
    Zenon Xiu (修志龙)
    原文: https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/a-profile-non-maskable-interrupts  翻译: 修志龙 Zenon Xiu Arm A-profile构架一个长久以来的局限性是:缺乏对non-maskable interrupt (NMI…
    • August 24, 2022
  • Arm A-Profile 构架2021扩展

    Zenon Xiu (修志龙)
    Zenon Xiu (修志龙)
    原文: https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-developments-2021 Martin Weidmann September 8, 2021 翻译注释:Zenon Xiu Arm与arm构架授权公司及生态伙伴一起…
    • August 17, 2022