Add to your testbench a monitor process that watches the output and compares it to the expected value, allowing for the delays through the filter.
Your VHDL style is better than some - even better than some textbook examples I have seen, but still: a few comments :
Using named rather than positional assignment for the "dff" component instantiations would save possible confusion between inputs and outputs for anyone trying to follow the pipeline. This doesn't really matter here, because :
you can eliminate the dffs altogether; replace them with lines of the form
Q1 <= MCM3;
in the same clocked process asYout <= add_out3;
that greatly simplifies the whole filter.You can reduce number of conversion functions by making H0..3 integer types; and if they are constant, make them constants! As multiplication between signed and integer is defined,no other changes are required.
type coefficient is new integer range -128 .. 127;
constant H0 : coefficient := -2;
Lose the redundant parentheses in
if ( rising_edge(Clk) ) then
- this isn't C!The DRY principle applies in VHDL too... there are several ways to apply it to the testbench : my choice would be a local procedure.
stim_proc: process
procedure Input(D : in integer range -128 .. 127) is
begin
Xin <= to_signed(D,8);
wait for clk_period*1;
end Input;
begin
wait for Clk_period*2;
Input(-3);
Input( 1);