Board logo

标题: Cell 编程登堂入室(1)简介 [打印本页]

作者: look_w    时间: 2018-5-23 16:10     标题: Cell 编程登堂入室(1)简介

简介Cell 处理器是由Sony-Toshiba-IBM共同开发的高效能微处理晶片,具备强大的运算效能。Cell 有一个主 PowerPC 处理核心(PPE),八个专用辅助处理核心(SPE),每个都能够运行自己的小程序。我们可以在 Fedora Core7 上安装 Cell 的 SDK3.0 包来模拟 Cell 的编译和运行环境。在 SDK 环境下编译出来的程序,可以直接copy到真实的 Cell Blade Server上正常运行。
安装 SDK 3.0首先,需要安装好 Fedora Core7 及配置好其 gnome 界面。查看是否有如下程序包,如果没有,yum install安装:# yum install rsync sed tcl wget
然后,从 IBM 的 developworks 网站 下载 SDK 的 iso 和 rpm 包,一起是 4 个文件。其中两个文件是基本库: cell-install-3.0.0-1.0.noarch.rpm 和 CellSDK-Devel-Fedora_3.0.0.1.0.iso 。另外两个文件是扩展的一些库:cell-extras-Fedora-license-3.0.0-2.0.noarch.rpm 和 CellSDK-Extras-Fedora_3.0.0.1.0.iso 。安装步骤如下:
1
2
3
4
5
6
7
8
9
10
11
12
[root@wq_desktop ~]# mkdir -p /root/sdk3.0
[root@wq_desktop ~]# cd /root/sdk3.0
[root@wq_desktop sdk3.0]# rpm -ivh cell-install-3.0.0-1.0.noarch.rpm
warning: cell-install-3.0.0-1.0.noarch.rpm: Header V3 DSA
signature: NOKEY, key ID 9ac02885
Preparing...                ########################################### [100%]
   1:cell-install           ########################################### [100%]
[root@wq_desktop sdk3.0]# cd /opt/cell
[root@wq_desktop cell]# ./cellsdk --gui --iso /root/sdk3.0 install
cellsdk INFO-2023: Trying to install or update cell-product-license
cellsdk INFO-2015: Calling pirut
Loading "installonlyn" plugin




接着会出现软件包安装提示界面(图1):
图1:SDK3.0软件包安装提示“软件安装已完成”后,退出安装界面,在 console 中运行:
# /opt/cell/cellsdk_sync_simulator install
这个安装的时候有些慢,最后出现“Installation of RPMs into Simulator sysroot image is complete.”。缺省只是安装部分必须的 rpm 包,如果还需要安装 xlc 和其他 Cell 编程的扩展高级库,可以自己将那两个 iso 文件 mount –o loop 到某个目录下安装。安装完后的目录结构如下:
目录内容备注/opt/cell/sdk/src例子程序
/opt/cell/sdk/prototype/src使用ALF的例子程序
/opt/cell/sdk/docspdf文档包含Cell编程手册/opt/ibm/systemsim-cellmambo有关的东东包括了一个小的Linux操作系统/opt/cell/toolchain编译器和函数库

运行 mambo安装完 SDK 后,如下运行 mambo:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@wq_desktop ~]# export PATH=/opt/ibm/systemsim-cell/binPATH
[root@wq_desktop ~]# systemsim -g
GUI Enabled
Licensed Materials - Property of IBM.
(C) Copyright IBM Corporation 2001, 2007
All Rights Reserved.
Using initial run script /opt/ibm/systemsim-cell/bin/../lib/cell/systemsim.tcl
GUI not initialized.  Execute tcl command 'gui_init'.
building tree....
clearing existing Openfirmware tree
done building tree.
LOAD : Opening ELF image file: /opt/ibm/systemsim-cell/bin/../images/cell/vmlinux
Elf text start address saved is 0x0000000001000000
Elf_ReadImage: Opening ELF image file: /opt/ibm/systemsim-cell/bin/../images/cell/vmlinux
Elf_ReadImage: alloc-ed 8522472 bytes for
  /opt/ibm/systemsim-cell/bin/../images/cell/vmlinux
LOAD : ELF startup: PC=0x0000000001000000, msr=0x1000000000000000
LOAD :              gpr[1]=0x000000000FFFFF90, gpr[2]=0x0000000000000000
systemsim %




得到 mambo 运行后的界面(图2):
图 2:mambo 运行点击图2界面上“Mode”,选择“Fast Mode”,然后点击“Go”按钮,得到如下Linux操作系统启动后的界面(图3),因为是启动了一个独立的 Linux 操作系统,所以有些慢:
图 3:Linux操作系统运行




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0