/*
2009 Intellignet Control Laborator of Tamkang University. All rights reserved
Filename : ShowFPS.v
Compiler : Quartus II 9.0
Description : Show CMOS and LTM FPS
Author : Shih-An Li
Release : 04/29/2009 1.0
//=============================================================================
// Structural coding
//=============================================================================
always@(posedge iCLK_50) begin
// Calculate the CMOS Frame
pre_CMOS_V <= iCMOS_V;
if({pre_CMOS_V,iCMOS_V}==2'b10) begin
CMOS_V_cnt <= CMOS_V_cnt + 1;
end
// Calculate the LTM Frame
pre_LTM_V <= iLTM_V;
if({pre_LTM_V,iLTM_V}==2'b10) begin
LTM_V_cnt <= LTM_V_cnt + 1;
end
end
always@(posedge iCLK_50) begin
if (Count >=SystemClk) begin
Count <= 0;
pre_CMOS_Frame_Cont <= CMOS_V_cnt;
CMOS_FPS <= CMOS_V_cnt - pre_CMOS_Frame_Cont;
pre_LTM_Frame_Cont <= LTM_V_cnt;
LTM_FPS <= LTM_V_cnt - pre_LTM_Frame_Cont;
end
else begin
Count <= Count +1;
end