基于FPGA的DW8051移植(二)
基于上一篇博文继续,本来想换到oc8051,但是还是不甘心,弄了这么久还是没有弄出来,真是打击屎了。
上一篇说3f进入了operation code所以判断是代码错误,后来发现不可以这么判断。 因为地址00开始进入 operation code 的数据也是02 00 26.可是程序成功的转跳到了26 这个地址,所以不可以简单的说3f当operation code处理了所以core就错了。
最后采用的方法是屏蔽掉STARTUP.51A里面的初始化loop,就是将idatalength 改为0 ,这一改我就更懵了。
在keile C 中调试窗口看到的程序执行顺序是00 01 02 26 27 28 29 2a 2b 19 1a 1b 1c 1d 1e 1f 20 21 03 04 05 06 07 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 0f 10 11 12 13 14 15 16 17 03 04 05 06 07 08 0a 0b 0c 0d 0e 0f 10 一直到16 。。。。。。。。。。。。循环了。在modelsim中看到的是相同的,

为了进一步探求程序,所以又写了测试4
`timescale 1us/100ns module dw8051_tb ; reg clk , reset ;
reg int0_n, int1_n ;
reg rxd0_in , rxd1_in ;
reg t0 , t1 ; wire rst_out_n ;
wire stop_mode_n, idle_mode_n ;
wire rxd0_out , txd0 ;
wire rxd1_out , txd1 ;
wire t0_out , t1_out ; integer i ; DW8051_top cpu_core( .clk (clk) ,
.reset (reset) ,
.rst_out_n (rst_out_n) ,
.stop_mode_n (stop_mode_n) ,
.idle_mode_n (idle_mode_n) , //int
.int0_n (int0_n) ,
.int1_n (int1_n) , //serial port
.rxd0_in (rxd0_in) ,
.rxd0_out (rxd0_out) ,
.txd0 (txd0) , .rxd1_in (rxd1_in) ,
.rxd1_out (rxd1_out) ,
.txd1 (txd1) , //timer/counter input/output
.t0 (t0) ,
.t1 (t1) ,
.t0_out (t0_out) ,
.t1_out (t1_out) , //sfr interface
.sfr_data_in () ,
.sfr_addr () ,
.sfr_data_out () ,
.sfr_wr () ,
.sfr_rd () , //external ram interface or user-defined peripheral reg
.mem_data_in () ,
.mem_addr () ,
.mem_data_out (),
.mem_wr_n () ,
.mem_rd_n ()
); always # clk = ~clk ; initial begin
i = ;
clk = ; reset = ;
int0_n= ; int1_n= ;
rxd0_in= ; rxd1_in= ;
t0 = ; t1 = ;
# reset = ; //**********测试1 : 发现无论如何修改idata初始化空间大小,程序都会进入29-2a-2b-2c 这个循环,无法跳出
// while (i<'h1ff) begin
// @(cpu_core.irom_addr == 16'h0029) i = i+1 ;
// if (i>'h100) begin
// $display ("rom loop at 0029 is over 01 00h time ");
// $display (" i = %d \n", i );
// end
// end
//--------------------------------------------------------------------------------------- /**********测试2: 依据测试1追查27这个地址上的循环次数数值去了哪里
1,@(cpu_core.core.irom_addr == 16'h0027) 测试发现跑到最后一个displays里面去了 ,屏蔽掉所有的if
打印具体数据信息结果显示 cpu_core.core.i_cpu.biu_instr == 8'h78
而cpu_core.core.i_cpu.biu_data_in == 8'h00
2,@(cpu_core.core.irom_addr == 16'h0028) 测试发现cpu_core.core.i_cpu.biu_instr == 8'h3f而
cpu_core.core.i_cpu.biu_data_in == 8'h00。由1和2对比可知数据有一个周期的停滞期
*/
//@(cpu_core.core.irom_addr == 16'h0028) begin
// //if (cpu_core.core.int_rom_data_out == 8'h3f) begin
// //if (cpu_core.core.i_cpu.biu_instr == 8'h3f)
// $display ("the rom data 3f have get to biu_instr = %h \n ",cpu_core.core.i_cpu.biu_instr );
// //if (cpu_core.core.i_cpu.biu_data_in == 8'h3f)
// $display ("the rom data 3f have get to biu_data_in = %h\n", cpu_core.core.i_cpu.biu_data_in);
// end
// else begin
// $display ("operation error ! rom data 3f at address 27 have not load in ");
// end
// end
//----------------------------------------------------------------------------------------------------------- /********测试3 依据测试2追查内核执行情况 ,发现7f进入了operation——操作码,于是断定是核错误,可是后来追溯到最开始
的程序那一段 02 00 26 可以成功转跳到26这个地址,而26也进入了operation 操作码里面,这么一说,不可以简单的说由于3f
进入了operation 操作码段而断定核错误。
最后修改了STARTUP.51A 里面的idata length 为0 ,即不执行ram初始化,通过观测ram地址发现程序进入了用户程序段。
*/ // $display ("display data : \n");
// $monitor ("%h",cpu_core.core.i_cpu.i_opdec.op);
// #8000 $stop ;
//------------------------------------------------------------------------------------------------------------- /********测试4 既然测试3已经进入了用户程序,依据keilC里面显示,main函数入口地址19,子函数入口地址03,子函数
出口地址18,LED翻转地址22, 再一起进入子函数main的保存地址为 1B,所以有了下面的测试程序,结果发现只有前面五个
出来了,后面两个都不见了程序就进入了stop,加大了时长还是不行哦
*/
@(cpu_core.irom_addr == 'h0019)
$display ("enter customer code of main "); @(cpu_core.irom_addr == 'h001b)
$display ("at the door of delay loop at first "); @(cpu_core.irom_addr == 'h0003)
$display ("enter delay loop at first "); @(cpu_core.irom_addr == 'h000d)
$display ("enter delay loop of 'for' "); @(cpu_core.irom_addr == 'h0018)
$display ("over the loop at first "); @(cpu_core.irom_addr == 'h0022)
$display ("return to main at first "); @(cpu_core.irom_addr == 'h0024)
$display ("over the main at first ");
end initial begin
# ;
# ;
# ;
# ;
# ;
# ;
$stop ; end endmodule
都没有人给我指点一二,还要不要人活了啊。
追查第五个display输出 后这个地址是怎么变的

你丫这是想干啥 ,怎么跑到for里面去了啊
补充:
追查这个转跳地址是谁给的,最终找到了罪魁祸首

i_cpu里面的result这条bus上,这条暴死一头连接着DW8051_updn_ctr 模块的data作为了输入口,当然我们要找的是输出口,输出口就是DW8051_control,面对几十个input output 和 两千多行代码 石化了
result转跳地址给错了,怎么改啊怎么改啊
基于FPGA的DW8051移植(二)的更多相关文章
- 基于FPGA的DW8051移植(三)
总结一下问题: 1) http://www.cnblogs.com/sepeng/p/4137405.html 基于FPGA的DW8051移植(一)里面用modelsim观测波形发现程序进入了ida ...
- 基于FPGA的DW8051移植(一)
最近 半个月都在移植8051,看到DW8051内核资料比较齐全又是新思发布的,所以就开始玩弄 可是这半个月的努力几近白费 —— 移植失败了,不知道从何着手这个内核.可能大家能找到不同的版本,我的是最初 ...
- 38.基于FPGA的FIR设计二
利用fdatool工具生成的滤波器系数与用代码生成的系数不一致,在网上查询得知,fdatool生成的滤波器系数是有符号小数,而且是浮点型,而代码生成的滤波器系数是定点型有符号数,故不一样. 浮点型数据 ...
- 基于FPGA的VGA显示设计(二)
上一篇:基于FPGA的VGA显示设计(一) 参照 CrazyBingo 的 基于FPGA的VGA可移植模块终极设计代码 的工程代码风格,模块化处理了上一篇的代码,并增加了一点其它图形. 顶层 ...
- 基于FPGA的RGB565_YCbCr_Gray算法实现
前面我们讲了基于FPGA用VGA显示一副静态图片,那么接下来我们就接着前面的工程来实现我们图像处理的基础算法里最简单的一个那就是彩色图像转灰度的实现. 将彩色图像转化为灰度的方法有两种,一个是令RGB ...
- 基于FPGA的中值滤波算法实现
在这一篇开篇之前,我需要解决一个问题,上一篇我们实现了基于FPGA的均值滤波算法的实现,最后的显示效果图上发现有一些黑白色的斑点,我以为是椒盐噪声,然后在做基于FPGA的中值滤波算法的实验时,我发现黑 ...
- 基于FPGA的肤色识别算法实现
大家好,给大家介绍一下,这是基于FPGA的肤色识别算法实现. 我们今天这篇文章有两个内容一是实现基于FPGA的彩色图片转灰度实现,然后在这个基础上实现基于FPGA的肤色检测算法实现. 将彩色图像转化为 ...
- PCIE_DMA实例四:xapp1052在Xilinx 7系列(KC705/VC709)FPGA上的移植
PCIE_DMA实例四:xapp1052在Xilinx 7系列(KC705/VC709)FPGA上的移植 一:前言 这段时间有个朋友加微信请求帮忙调试一块PCIe采集卡.该采集卡使用xilinx xc ...
- 基于FPGA的VGA可移植模块终极设计【转】
本文转载自:http://www.cnblogs.com/lueguo/p/3373643.html 略过天涯 基于FPGA的VGA可移植模块终极设计 一.VGA的诱惑 首先,VGA的驱动,这事, ...
随机推荐
- 转几篇关于Android webView的网文
1,控件WebView显示网页 http://www.cnblogs.com/tinyphp/p/3858997.html http://blog.csdn.net/t12x3456/article/ ...
- Oracle不能导入空表解决方案
C:\Users\Administrator>sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on 星期日 8月 17 1 ...
- 有关FTPS和VNP的详解
http://hfang.blog.51cto.com/4449017/811744 http://www.h3c.com.cn/MiniSite/Technology_Circle/Technolo ...
- 百度云世界里的“七种武器”:PCS、BAE、Site App、ScreenX等
如果说去年百度世界的关键词是“百度新首页”的话,那么今年在研发者人群中,对百度世界最深的印象就是“七种武器”,即在云的世界里,百度为开发者所提供的包括个人云存储.LBS.移动云测试中心等在内的七种工具 ...
- (C#)Windows Shell 外壳编程系列6 - 执行
原文(C#)Windows Shell 外壳编程系列6 - 执行 (本系列文章由柠檬的(lc_mtt)原创,转载请注明出处,谢谢-) 接上一节:(C#)Windows Shell 外壳编程系列5 - ...
- HDU 3756 Dome of Circus
不会做,参见别人的程序: /* 底面为xy平面和轴为z轴的圆锥,给定一些点,使得圆锥覆盖所有点并且体积最小 点都可以投射到xz平面,问题转换为确定一条直线(交x,z与正半轴)使得与x的截距r 和与z轴 ...
- [C++ Basic] Const 用法
定义: const 主要用于声明常量.当常量为对象时,对象值不可改变:当常量为指针时,该指针不可移动或重新赋值,但我们可以通过它去修改该指针的指向对象的值(前提是无需移动指针的修改).所谓的形参.返回 ...
- Ajax概述及浅谈其与服务器的交互过程
概念: 首先AJAX不只是一个特定的客户端技术,更应算是一种技巧.Ajax技术的核心操作是用XmlHttpRequest(下称XHR)对象进行异步数据处理. 所谓异步,即通过 AJAX,JavaScr ...
- Enze fourth day(循环语句 一)
哈喽,大家好.又到了总结知识的时间了.今天在云和学院自学了一下循环语句,下面是自己总的一些知识点. 先补充一下选择结构中的switch语句. 理论:switch语句是一种多分支选择语句,当需要测试大量 ...
- 解决gnuplot中'Terminal type set to 'unknown'不能显示绘图的问题
安装gnuplot: sudo apt-get install gnuplot 安装成功后,在终端输入gnuplot,进入gnuplot. 直接进行一个小测试: plot sin(x) 发现不能显示绘 ...