搭建LEON3研发环境(一)

来自:

1、安装LINUX 操作系统:redhat5.5企业版。

2、安装软件MODELSIM6.51 ,启动LICENSE。

3、下载LEON3的相关软件包。

  (a)    grlib-gpl-1.1.0-b4102.zip

  (b)   sparc-elf-4.4.2-1.0.36b.tar.bz2

  (c)   grmon-eval-1.1.44.tar.gz

  (d)   mkprom2-2.0.32.tar.gz

  (e)   libmpfr.so.1库的32bit包。

4、解压以上文件,并把b和d放在目录/opt下,并添加到配置文件.tcshrc里面。

5、make xconfig

      • make xconfig to edit/change the config.vhd file and the LEON3 configuration
      • make sure that you have at least one uart enabled
      • enable the option "Accelerated uart tracing" in the "VHDL debugging" menu.
      • don’t use ahbrom (internal prom) => address conflicts with memory ctrl

6、 Compile

     a、gcc hello.c  

          Compile the application into on or more object file, but do not link:    

           $ sparc-elf-gcc -msoft-float -O2 hello.c -o hello.exe (资料上运行命令)

           $sparc-elf-gcc  -msoft-float -c -g  -O2 hello.c (mkprom2 pdf上运行命令)

           注:在编译的时候,gcc是需要libmpfr.so.1的库文件。

                  上面两条命令都可以,只是要对应下面的mkprom命令而已。

    b、mkprom

         -msoft-float Compile for hardware without a FPU.

         -rmw Perform read-modify-write cycles during byte and halfword writes.

         -nocomp Don.t compress application. Decreases loading time on the expense of  PROM size.

         -v Be verbose; reports compression statistics and compile commands

         -ramsize size Defines the total available RAM in kBytes.

         Used to initialize the in  the memory configuration register( s). The default value is 2048 (2MByte).

         $ mkprom2 -rmw -nocomp -msoft-float -dump dump.s -v -ramsize 1024 hello.exe

         注:当数据量不大的时候就不需要压缩了。反之把-nocomp去掉,工具就会压 缩boot文件。

        $ mkprom2 -freq 40 -rmw hello.o -dump dump.s -msoft-float(mkprom2 pdf上运行命令)

         注:mkprom2命令先是初始化硬件,然后调用sparc-elf-gcc命令,同时添加很多参数来生成

                 prom.out程序。如下提示为:

                LEON MKPROM prom builder for BCC v1.0.24
               Copyright Gaisler Research 2004, all rights reserved.
               section: .text at 0x40000000, size 19600 bytes
               Uncoded stream length: 19600 bytes
               Coded stream length: 10134 bytes
              Compression Ratio: 1.934
              section: .data at 0x40004c90, size 2796 bytes
              Uncoded stream length: 2796 bytes
              Coded stream length: 812 bytes
              Compression Ratio: 3.443
              creating LEON3 boot prom: prom.out
             /opt/sparc-elf-3.2.3/bin/sparc-elf-gcc.exe -qprom -O2 -g -N -Tlinkprom -Ttext=0x0 dump.s

             -lmkprom3 -o prom.out -msoft-float 

            注:最后一行不是执行命令,而是执行mkprom2后调用gcc及参数的显示而已。

    c、objcopy

          sparc-elf-objcopy -O srec prom.out prom.srec

7、   Simulation


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值