|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
xilinx的文件中举了这样一个例子,可以使用STARTUP模块或不使用STARTUP模块,这个例子是不使用STARTUP模块。可是那个GSR信号要怎么描述呢,就这样系统能识别吗?还有,FDCE,STARTUP模块根本就没有出现,编译也没有通过,应该怎样调用呢?
module my_counter (CLK, D, Q, COUT);
input CLK, D;
output Q;
output [3:0] COUT;
wire GSR;
reg [3:0] COUT;
always @(posedge GSR or posedge CLK)
begin
if (GSR == 1’b1)
COUT = 4’h0;
else
COUT = COUT + 1’b1;
end
// GSR is modeled as a wire within a global module.
// So, CLR does not need to be connected to GSR and
// the flop will still be reset with GSR.
FDCE U0 (.Q (Q), .D (D), .C (CLK), .CE (1'b1), .CLR
(1’b0));
endmodule
下面的例子是使用STARTUP模块:
module my_counter (MYGSR, CLK, D, Q, COUT);
input MYGSR, CLK, D;
output Q;
output [3:0] COUT;
reg [3:0] COUT;
always @(posedge MYGSR or posedge CLK)
begin
if (MYGSR == 1’b1)
COUT = 4’h0;
else
COUT = COUT + 1’b1;
end
// GSR is modeled as a wire within a global
// module.So, CLR does not need to be connected
// to GSR and the flop will still be reset with GSR.
FDCE U0 (.Q (Q), .D (D), .C (CLK), .CE (1’b1),
.CLR (1’b0));
STARTUP U1 (.GSR (MYGSR), .GTS (1’b0), .CLK
(1’b0));
endmodule
可是,FDCE, |
|