在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
EETOP诚邀模拟IC相关培训讲师 创芯人才网--重磅上线啦!
查看: 2091|回复: 1

这是什么错误

[复制链接]
发表于 2008-5-7 16:55:17 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
AMBA总线中的一个文件,用modelsim6.2SE编译,总是提示这个错误:** Error: E:/Modeltech_6.2b/examples/AHB/ahb_stimuli.v(1): near "initial": syntax error, unexpected "initial", expecting "class"。找了很久都没找出来是什么错误,大家能帮我看一下吗?多谢了!

initial begin
@(posedge hresetn);
repeat (10) @(posedge hclk);
// fill the slave buffer
for (j=32'h0;j<32'h07FF;j=j+32'h1) begin
ahbslv_inst.slave_mem[j] = j[7:0];
end
// set a slave delay of 5 cycles on 2nd data beat of each transfer
ahbslv_inst.set_delay(1, 5);
// generate some sample transfers by mst0
// ahb_transfer(addr,size,burst,rn_w,count,store_rdata,comp_rdata,pass_fail)
@(posedge hclk);
// read all registers, should be 0
   ahbmst_inst.ahb_transfer(32'h10000000, BUS_32,INCR4,READ,32'h04,0,0,pass_fail);
// write DMA source address
ahbmst_inst.data_array[0] = 8'h00;
ahbmst_inst.data_array[1] = 8'h00;
ahbmst_inst.data_array[2] = 8'h00;
ahbmst_inst.data_array[3] = 8'h40;  // 32'h40000000
   ahbmst_inst.ahb_transfer(32'h10000004, BUS_32,SINGLE,WRITE,32'h01,0,0,pass_fail);
// write DMA dest address
ahbmst_inst.data_array[0] = 8'h00;
ahbmst_inst.data_array[1] = 8'h00;
ahbmst_inst.data_array[2] = 8'h01;
ahbmst_inst.data_array[3] = 8'h40;  // 32'h40010000
   ahbmst_inst.ahb_transfer(32'h10000008, BUS_32,SINGLE,WRITE,32'h01,0,0,pass_fail);

// write block size (3) and count (7)
ahbmst_inst.data_array[0] = 8'h07;
ahbmst_inst.data_array[1] = 8'h00;
ahbmst_inst.data_array[2] = 8'h03;
ahbmst_inst.data_array[3] = 8'h00;  // 32'h00030007
ahbmst_inst.ahb_transfer(32'h1000000c, BUS_32,SINGLE,WRITE,32'h01,0,0,pass_fail);
// read all registers, should be what we wrote above
   ahbmst_inst.ahb_transfer(32'h10000000, BUS_32,INCR4,READ,32'h04,0,0,pass_fail);
// delay a few cycles before beginning DMA
repeat (30) @(posedge hclk);
// start DMA
ahbmst_inst.data_array[0] = 8'h04;
ahbmst_inst.data_array[1] = 8'h00;
ahbmst_inst.data_array[2] = 8'h00;
ahbmst_inst.data_array[3] = 8'h00; // 32'h00000004
   ahbmst_inst.ahb_transfer(32'h10000000, BUS_32,SINGLE,WRITE,32'h01,0,0,pass_fail);
end
 楼主| 发表于 2008-5-9 11:17:47 | 显示全部楼层
麻烦大家帮忙看看啊,小弟实在是找不出来是什么错误,多谢了啊!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-19 06:52 , Processed in 0.022497 second(s), 10 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表