I need to design DNF(Digital Noise Filter) using VHDL, which is able to eliminate glitches by calculating pulse width. that is is a pulse width is less than a specified value it will not come in output but if more than specified value it will come in output. for pulsewidth calculation I am using this following code
`timescale1ns/1ps////////////////////////////////////////////////////////////////////////////////// Company: // Engineer://// Create Date: 16:47:11 03/12/2015// Design Name: Pulse_Measure// Module Name: G:/DNF design/DNF/Pulse_measuretest3.v// Project Name: DNF// Target Device: // Tool versions: // Description: //// Verilog Test Fixture created by ISE for module: Pulse_Measure//// Dependencies:// // Revision:// Revision 0.01 - File Created// Additional Comments:// ////////////////////////////////////////////////////////////////////////////////module Pulse_measuretest3;// Inputsreg i_Rst;reg i_Clk;reg i_Pulse;// Outputswire[15:0] o_Pulse_Width;wire o_Overflow;wire o_Measurement_Valid;wire Pulse_out;// Instantiate the Unit Under Test (UUT)
Pulse_Measure uut (
.i_Rst(i_Rst),
.i_Clk(i_Clk),
.i_Pulse(i_Pulse),
.o_Pulse_Width(o_Pulse_Width),
.o_Overflow(o_Overflow),
.o_Measurement_Valid(o_Measurement_Valid),
.Pulse_out(Pulse_out));initialbegin// Initialize Inputs
i_Clk =0;forever#5i_Clk =~i_Clk;endinitialbegin
i_Rst =0;
i_Pulse =0;// Wait 100 ns for global reset to finish#100;
i_Rst =0;
i_Pulse =1;// Wait 100 ns for global reset to finish#100;
i_Rst =0;
i_Pulse =0;// Wait 100 ns for global reset to finish#100;
i_Rst =0;
i_Pulse =1;// Wait 100 ns for global reset to finish#100;
i_Rst =0;
i_Pulse =0;// Wait 100 ns for global reset to finish#80;
i_Rst =0;
i_Pulse =1;// Wait 100 ns for global reset to finish#80;
i_Rst =0;
i_Pulse =0;// Wait 100 ns for global reset to finish#100;
i_Rst =0;
i_Pulse =1;// Wait 100 ns for global reset to finish#200;
i_Rst =0;
i_Pulse =0;// Wait 100 ns for global reset to finish#80;
i_Rst =0;
i_Pulse =1;// Wait 100 ns for global reset to finish#100;
i_Rst =0;
i_Pulse =0;// Wait 100 ns for global reset to finish#100;
i_Rst =0;
i_Pulse =0;// Wait 100 ns for global reset to finish#50;
i_Rst =0;
i_Pulse =1;// Wait 100 ns for global reset to finish#50;
i_Rst =0;
i_Pulse =0;// Wait 100 ns for global reset to finish#50;
i_Rst =0;
i_Pulse =1;// Wait 100 ns for global reset to finish#50;
i_Rst =0;
i_Pulse =0;// Wait 100 ns for global reset to finish#200;
i_Rst =0;
i_Pulse =1;// Wait 100 ns for global reset to finish#200;// Add stimulus hereendendmodule