|

楼主 |
发表于 2011-11-29 09:25:35
|
显示全部楼层
回复 2# jack888518
你好,非常感谢你的回复,我这个问题想了几遍应该是DC对2001语法不支持的原因,我把代码贴上来
底层模块就是一个普通的移位寄存器
// 移位寄存器
module sr_cordic #(parameter WIDTH = 4, LENGTH = 8) //定义参数上层可以调用
(
input clk,
input en,
input [WIDTH-1:0] sr_in,
output[WIDTH-1:0] sr_out
);
// Declare the shift register
reg [WIDTH-1:0] sr [LENGTH-1:0];
// Declare an iterator
integer n;
always @ (posedge clk)
begin
if (en)
begin
// Shift everything over, load the incoming data
for (n = LENGTH-1; n>0; n = n-1)
begin
sr[n] <= sr[n-1];//<=
end
// Shift one position in
sr[0] <= sr_in;
end
end
// Catch the outgoing data
assign sr_out = sr[LENGTH-1];
endmodule
上层模块为:
wire sel;
sr_cordic #(.WIDTH(1), .LENGTH(16)) sr_select //调用底层的参数,如果底层模块WIDTH = 4, LENGTH = 8,就会出现不可综合
( //的情况,除非改成WIDTH = 1, LENGTH = 16,但是我上层的模块需要调用很多
.clk(clk), //个不同宽度的底层模块
.en(1'b1),
.sr_in(z_t[ANG_WIDTH-1]),
.sr_out(sel)
);
这个问题好纠结。。。。。 |
|