wrHDL编译中软核代码初始化及编译耗时长的问题
问题的提出
整个WR的ISE工程比较大,编译时间很长,导致开发效率低。通过分析发现,ISE在综合的时候大量的时间都花在了初始化DPRAM上。调研发现Xilinx提供了BMM文件和DATA2MEM工具,可以将软核CPU的运行代码在HDL综合完后再与bit文件合并,这样可以节约大量的编译时间。但是在wr工程中使用这些工具的时候出现了错误,软核的代码并没有被成功初始化。
原始代码分析
具体编译wr工程的时候发现,代码ip_cores/general-cores/modules/wishbone/wb_dpram/xwb_dpram.vhd中存在对有无RAM初始化文件进行判断,进而采用了不同的调用DPRAM的方法。
其具体实现如下:
GEN_INITF: if g_init_file /= "" and g_init_file /= "none" generate
U_DPRAM : generic_dpram
generic map(
-- standard parameters
g_data_width => ,
g_size => g_size,
g_with_byte_enable => true,
g_addr_conflict_resolution => "dont_care",
g_init_file => g_init_file,
g_dual_clock => false
)
port map(
rst_n_i => rst_n_i,
-- Port A
clka_i => clk_sys_i,
bwea_i => s_bwea,
wea_i => s_wea,
aa_i => slave1_in.adr(f_log2_size(g_size)- downto ),
da_i => slave1_in.dat,
qa_o => slave1_out.dat,
-- Port B
clkb_i => clk_sys_i,
bweb_i => s_bweb,
web_i => s_web,
ab_i => slave2_in.adr(f_log2_size(g_size)- downto ),
db_i => slave2_in.dat,
qb_o => slave2_out.dat
);
end generate; GEN_NO_INITF: if g_init_file = "" or g_init_file = "none" generate
GEN_BYTESEL: for i in to generate
U_DPRAM: generic_dpram
generic map(
g_data_width => ,
g_size => g_size,
g_with_byte_enable => false,
g_addr_conflict_resolution => "dont_care",
g_init_file => "",
g_dual_clock => false)
port map(
rst_n_i => rst_n_i,
-- Port A
clka_i => clk_sys_i,
wea_i => s_bwea(i),
aa_i => slave1_in.adr(f_log2_size(g_size)- downto ),
da_i => slave1_in.dat((i+)*- downto i*),
qa_o => slave1_out.dat((i+)*- downto i*),
-- Port B
clkb_i => clk_sys_i,
web_i => s_bweb(i),
ab_i => slave2_in.adr(f_log2_size(g_size)- downto ),
db_i => slave2_in.dat((i+)*- downto i*),
qb_o => slave2_out.dat((i+)*- downto i*)
);
end generate;
end generate;
当GEN_NO_INITF的时候,原作者采用了一个很取巧的办法来避免ise综合出来block ram的同时生成大量的mux(LUT5),但此时综合出来RAM模块的形式是1bit(数据位)*16K.
而如果要用BMM的方式来对RAM进行初始化,我们想要的RAM模块的形式是32bit*512. GEN_INITF这部分代码综合出来的结果满足需求。
对于SPEC板而言,他们采用的是PCIe的方法来upload软核的初始化代码,所以他们可以使用他们预先定义的办法来使得elf的文件格式满足前述要求(实际不需要额外的工作即可满足,因为他们是用wishbone总线直接烧写进去的)。
而如果是初始化ram文件,或者采用BMM的方法初始化文件,1bit(数据位)*16K形式的RAM会导致软核代码错误,软核无法工作。
问题结论
为了在cute上面能够更快速的编译,采用无RAM的方式,所以需要将判断语句及GEN_NO_INITF部分的代码全都注释掉。
另外,附上注释后cute的bmm文件,在工程项目中加入bmm文件后会随着工程的编译生成*_bd.bmm文件,之后使用data2mem工具将elf文件和bit文件进行合并。
data2mem -bm ../../elf/cutewr_bd.bmm -bd ../../elf/wrc.elf -bt cutewr.bit -o b cutewr_wrc.bit
/* FILE : cutewr.bmm
* Define a BRAM map for the LM32 memory "xwb_dpram".
* Run ISE Translate -> "Floorplan Area/IO/Logic (PlanAhead)" once (without this BMM file
* attached to the ISE Project) to find out that there are 46 ramloops and each RAMB16
* Note: *THE RAMLOOP ORDER WITHIN A BUS_BLOCK IS VERY IMPORTANT!!!*
* Define ramloop 45 downto 0 and databits 31 downto 0 !!! Otherwise the memory
* content will be swapped and the program fails to execute. Aperently the ramloop
* number and bit definitions are not read by data2mem.
*
*
* Address space LM32 memory "xwb_dpram"
* g_dpram_size = 131072/4
* 64 stacks of size 2048 bytes is 131072 bytes
*
****************************************************************************************/ ADDRESS_SPACE lm32_wrpc_memory RAMB16 [0x00000000:0x0001FFFF]
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram1 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram2 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram3 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram4 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram5 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram6 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram7 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram8 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram9 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram10 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram11 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram12 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram13 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram14 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram15 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram16 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram17 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram18 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram19 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram20 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram21 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram22 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram23 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram24 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram25 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram26 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram27 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram28 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram29 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram30 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram31 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram32 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram33 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram34 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram35 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram36 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram37 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram38 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram39 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram40 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram41 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram42 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram43 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram44 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram45 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram46 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram47 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram48 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram49 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram50 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram51 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram52 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram53 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram54 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram55 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram56 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram57 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram58 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram59 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram60 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram61 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram62 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram63 [:];
END_BUS_BLOCK;
BUS_BLOCK
U_WR_CORE/U_WR_CORE/DPRAM/U_DPRAM/gen_single_clk.U_RAM_SC/Mram_ram64 [:];
END_BUS_BLOCK;
END_ADDRESS_SPACE;
wrHDL编译中软核代码初始化及编译耗时长的问题的更多相关文章
- java如何在eclipse编译时自动生成代码
用eclipse写java代码,自动编译时,如何能够触发一个动作,这个动作是生成本项目的代码,并且编译完成后,自动生成的代码也编译好了, java编辑器中就可以做到对新生成的代码的自动提示? 不生成代 ...
- 各种软核处理器二进制文件FPGA初始化文件生成程序
不管是MIPS, Nios II, MicroBlaze, MSP430, 8051, OpenRISC, OpenSPARC, LEON2/LEON3等等软核处理器,在FPGA上实现的时候我们通常需 ...
- Java中String的intern方法,javap&cfr.jar反编译,javap反编译后二进制指令代码详解,Java8常量池的位置
一个例子 public class TestString{ public static void main(String[] args){ String a = "a"; Stri ...
- C++中引用编译过的C代码为什么要用“extern c”
函数经过编译系统的翻译成汇编,函数名对应着汇编标号. 因为C编译函数名与得到的汇编代号基本一样,如:fun()=>_fun, main=>_main 但是C++中函数名与得到的汇编代号 ...
- 【小梅哥FPGA进阶教程】MC8051软核在FPGA上的使用
十.MC8051软核在FPGA上的使用 本教程内容力求以详细的步骤和讲解让读者以最快的方式学会 MC8051 IP core 的应用以及相关设计软件的使用,并激起读者对 SOPC 技术的兴趣.本实验重 ...
- [置顶]
基于FPGA的VGA简易显存设计&NIOS ii软核接入
项目简介 本项目基于Altera公司的Cyclone IV型芯片,利用NIOS II软核,2-port RAM与时序控制模块,实现64*48分辨率的显存(再大的显存板载资源m9k不够用) 实现效果如下 ...
- Spartan6上软核系统自定义外设调用AXI Stream FFT经验
这几天希望能在Spartan系列新品xc6slx16csg324-2运行带有FFT的软核处理系统,基本系统早就搭建好了.需要做的就是建立一个封装有Xilinx提供的FFT IP的自定义外设.由于Xil ...
- 关于Quartus构建nios软核以及eclipse建立c语言工程以及成功下载到FPGA芯片过程遇到的各种问题以及解决方法详解
这不是一篇构建nios的教程,而是遇到的各种问题以及解决方法.至于构建教程,网上一大把,我推荐正点原子的FPGA教程,比较新,比较详细,通俗易懂!!! 这里以一个点亮LED灯的Nios软核为例,很明显 ...
- 【lattice软核】ROM的使用
=======================>>>>> 一.ROM核调用:==================>>>>> ======== ...
随机推荐
- RIDE安装遇到的问题及解决方法
1.按照虫师的方法,下载的wxpython3.0 ,启动robotframework-ride,无效,因为版本不一致,所以我又根据终端提示的网址:http://sourceforge.net/proj ...
- Volley简单封装
public interface IRequest { /** * 获取头部信息 * * @return */ public Map<String, String> getHeaderMa ...
- VaR实现实证
投资组合Var计算实例 http://financetrain.com/analytical-approach-to-calculating-var-variance-covariance-metho ...
- colorbox 自适应 高度
$(".example3").colorbox({ inline: true, scrolling: false , onComplete: ...
- X64操作系统组件Jmail无法正常服务问题
故障现象: 近日,在VMware虚拟化部署迁移中,之前物理服务器中部署网站ASP组件Jmail服务一切正常,迁移完成后发现Jmail无法正常工作,其余组件能正常工作. 环境:Windows Serve ...
- js和php对bool值的判断区别
一.将一种数据类型转换为bool值时,PHP和JS的转换规则不同 PHP中 当转换为 boolean 时,以下值被认为是 FALSE : 布尔值 FALSE 本身 整型值 0(零) 浮点型值 0.0( ...
- Asp.Net MVC4入门指南(10):第三方控件Studio for ASP.NET Wijmo MVC4 工具应用
ComponentOne Studio for ASP.NET Wijmo最新版本2013V1支持MVC4,其中包括: 新增 MVC 4 工程模板 (C# & VB) 开箱即用的MVC 4 工 ...
- python学习之路-day12-mysql && orm
一.数据库 1.数据库介绍 数据库(Database)是按照数据结构来组织.存储和管理数据的仓库,每个数据库都有一个或多个不同的API用于创建,访问,管理,搜索和复制所保存的数据.我们也可以将数据存储 ...
- 用jQuery修改background图片平铺方式
<html><head> <title>测试css修改</title></head><body> <img src=&qu ...
- dos2unix unix2dos
实现windows和linux之间的文件自动转换,消除^M.