|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
请问是怎么回事呢?通过report_clocks检查约束添加正确
电路功能很简单,两个无符号数相乘,输出结果延迟几拍输出。
当设置延迟3拍/4拍/8拍时,均有WNS数值
- // Unsigned 16x24-bit Multiplier
- // 1 latency stage on operands
- // 3 latency stage after the multiplication
- // File: multipliers2.v
- `timescale 1ns/1ps
- module mult_unsigned (clk, A, B, RES);
- parameter WIDTHA = 16;
- parameter WIDTHB = 24;
- input clk;
- input [WIDTHA-1:0] A;
- input [WIDTHB-1:0] B;
- output [WIDTHA+WIDTHB-1:0] RES;
- reg [WIDTHA-1:0] rA;
- reg [WIDTHB-1:0] rB;
- reg [WIDTHA+WIDTHB-1:0] M [4:0];
- integer i;
- always @(posedge clk)
- begin
- rA <= A;
- rB <= B;
- M[0] <= rA * rB;
- for (i = 0; i < 4; i = i+1)
- M[i+1] <= M[i];
- end
-
- assign RES = M[4];
- endmodule
复制代码
但是设置为1拍/2拍时,就显示NA了
- // Unsigned 16x24-bit Multiplier
- // 1 latency stage on operands
- // 3 latency stage after the multiplication
- // File: multipliers2.v
- `timescale 1ns/1ps
- module mult_unsigned (clk, A, B, RES);
- parameter WIDTHA = 16;
- parameter WIDTHB = 24;
- input clk;
- input [WIDTHA-1:0] A;
- input [WIDTHB-1:0] B;
- output [WIDTHA+WIDTHB-1:0] RES;
- reg [WIDTHA-1:0] rA;
- reg [WIDTHB-1:0] rB;
- reg [WIDTHA+WIDTHB-1:0] M [2:0];
- integer i;
- always @(posedge clk)
- begin
- rA <= A;
- rB <= B;
- M[0] <= rA * rB;
- for (i = 0; i < 2; i = i+1)
- M[i+1] <= M[i];
- end
-
- assign RES = M[2];
- endmodule
复制代码
请问有人知道这是怎么回事吗
|
|