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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 4759|回复: 9

[求助] 有人能给我解释一下这段fft的verilog代码的问题吗

[复制链接]
发表于 2016-4-11 13:24:52 | 显示全部楼层 |阅读模式

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

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

x
//********************************************************************************
//移位处理单元模块
//*********************************************************************************
module shift_process(clk,rst,shift_in_valid,shift_ctrl,up_in_real,up_in_image,
                     dn_in_real,dn_in_image,
                                                        shift_out_valid,up_out_real,up_out_image,dn_out_real,
                                                        dn_out_image);

input clk,rst,shift_in_valid,shift_out_valid;
input shift_ctrl[1:0],
      up_in_real[11:0],up_in_image[11:0], dn_in_real[11:0],  dn_in_image[11:0];
                //分别是上一级和下一级RAM中的复数的实部和虚部输入
output up_out_real[9:0],up_out_image[9:0],dn_out_real[9:0],        dn_out_image[9:0];
       //分别是进行移位操作后的复数的实部和虚部输出


endmodule

编译过后 wt.png
Error (10773): verilog hdl error at shift_process.v(10): declaring module ports or function arguments with unpacked array types requires SystemVerilog extensions
Error (10773): Verilog HDL error at shift_process.v(11): declaring module ports or function arguments with unpacked array types requires SystemVerilog extensions
Error (10773): Verilog HDL error at shift_process.v(13): declaring module ports or function arguments with unpacked array types requires SystemVerilog extensions
 楼主| 发表于 2016-4-11 13:26:19 | 显示全部楼层
手动顶
发表于 2016-4-11 13:59:14 | 显示全部楼层
Yeah, you must know what packed arrays and unpacked arrays are. Packed arrays are something like this: input [1:0]shift_ctrl; while unpacked arrays are something like this: input shift_ctrl[1:0]. The difference is that when you index some bit like shift_ctrl[0], if you define shift_ctrl as a packed array, then shift_ctrl[0] is just a bit. However, if you define shift_ctrl as an unpacked array, then shift_ctrl[0] is just an int type which takes 4-8 bytes depending on your machine. So maybe in this case, you should use packed arrays.
 楼主| 发表于 2016-4-11 14:45:44 | 显示全部楼层
回复 3# 411123879


    谢谢,但还是会报错Error (10170): Verilog HDL syntax error at shift_process.v(11) near text "[";  expecting an identifier
wt2.png
 楼主| 发表于 2016-4-11 14:48:17 | 显示全部楼层
回复 3# 411123879


    WT22.jpg
 楼主| 发表于 2016-4-11 14:49:04 | 显示全部楼层
回复 3# 411123879

改完之后报
    Error (10170): Verilog HDL syntax error at shift_process.v(11) near text "[";  expecting an identifier
Error (10170): Verilog HDL syntax error at shift_process.v(13) near text "[";  expecting an identifier
Error (10112): Ignored design unit "shift_process" at shift_process.v(4) due to previous errors
发表于 2016-4-11 15:22:15 | 显示全部楼层
module shift_process(clk,rst,shift_in_valid,shift_ctrl,up_in_real,up_in_image,
                      dn_in_real,dn_in_image,
                                                         shift_out_valid,up_out_real,up_out_image,dn_out_real,
                                                         dn_out_image);

input clk,rst,shift_in_valid,shift_out_valid;
input [1:0]shift_ctrl;
input [11:0]up_in_real;
output [9:0]up_out_image;
output [9:0]dn_out_real;
output [9:0]dn_out_image;
        //分别是进行移位操作后的复数的实部和虚部输出

endmodule

Try this.
发表于 2016-4-11 15:25:33 | 显示全部楼层
Or you could move input output identifiers into your module I/O list like this:

module arbiter(
    input clk,
    input req0,
    input req1,
    input rst,
    ouput gnt0,
    output gnt1
);
发表于 2016-4-12 16:56:44 | 显示全部楼层
input shift_ctrl[1:0] :
改为input 【1:0】 shift_ctrl;
发表于 2016-4-12 16:58:50 | 显示全部楼层
verilog 可综合的代码没有数组,只有数据位宽,在input 和端口名中间,并且其他的reg和wire型数据类型也类似,希望对你有帮助。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

×

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

GMT+8, 2024-4-27 14:52 , Processed in 0.032897 second(s), 8 queries , Gzip On, Redis On.

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