|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
下面是我写的一个示例程序, 实现 的功能是FPGA从外部接收低频数据及相应的数据有效信号。经过FPGA后,使用较高的频率再把数据发送出去。
module Test(
iClk,
iDval,
iData_2,
oDval,
oData_2
);
input iClk;
input iDval;
input [1:0] iData_2;
output reg oDval;
output reg [1:0] oData_2;
wire Clk198M;
PLL_Cfg pll0(
.iClk(iClk), //24M
.oClk1(Clk198M), //198M
.oClk2(),
.oClk3(),
.oClk4(),
.oClk5(),
.oClk6(),
.oPllLocked()
);
reg Dval0;
reg [1:0] Data0;
always @ (posedge iClk)
begin
Dval0 <= iDval;
Data0 <= iData_2;
end
wire prog_empty;
reg RdFifoEn;
wire [1:0] FifoOut;
TsetFifo fof0(
.rst (1'b0),
.wr_clk (iClk),
.rd_clk (Clk198M),
.din (iData_2),
.wr_en (iDval),
.rd_en (RdFifoEn),
.dout (FifoOut),
.full (),
.empty (),
.prog_empty (prog_empty)
);
always @ (posedge Clk198M)
begin
if(!prog_empty)
RdFifoEn <= 1'b1;
else
RdFifoEn <= 1'b0;
end
always @ (posedge Clk198M)
begin
oData_2 <= FifoOut;
oDval <= RdFifoEn;
end
endmodule
输入时钟约束如下:
NET "iClk" TNM_NET = iClk;
TIMESPEC TS_iClk = PERIOD "iClk" 41.667 ns HIGH 50%;
输入端口OFFSET_IN约束:
INST "iData_2<0>" TNM = group_in;
INST "iData_2<1>" TNM = group_in;
INST "iDval" TNM = group_in;
TIMEGRP "group_in" OFFSET = IN 10 ns VALID 5 ns BEFORE "iClk" RISING;
但是输出端相应的时钟已经变为了Clk198M了,请教诸位,应该怎样设置输出端的OFFSET_OUT约束呢? |
|