سلام دوستان
وقتتون بخیر
من یک فیلتر درجه 3 طبق آموزش استاد پیاده کردم و خروجی آن طبق آموزش استاد برای ورودی پله در محیط سیمولینک خروجی دارد. ولی وقتی ورودی رو به یک موج سینوسی تغییر میدم خروجی قرمز شده و xxxxxxxxx رو نمایش میده. من در تستبنچ، ورودی پله رو کامنت کردم و ورودی پیشفرض سینوسی است. بی نهایت ممنونم اگر راهنمایی کنید.
فایل تستپنچ
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
use ieee.std_logic_textio.all;
use std.textio.all;
ENTITY IIR_TDF_II_tb IS
END IIR_TDF_II_tb;
ARCHITECTURE behavior OF IIR_TDF_II_tb IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT IIR_TDF_II_Top
PORT(
Clock : IN std_logic;
sine1 : IN signed(13 downto 0);
Filtered_Output : OUT signed(14 downto 0);
Delay_Accumulator_D3_out :OUT signed(31 downto 0)
);
END COMPONENT;
--Inputs
signal Clock : std_logic := '0';
signal sine1 : signed(13 downto 0) := (others => '0');
--Outputs
signal Filtered_Output : signed(14 downto 0);
signal Delay_Accumulator_D3_out : signed(31 downto 0);
-- DDS component declaration
COMPONENT Sin4Mhz_0
PORT(
clk : IN std_logic;
sine : OUT std_logic_vector(13 downto 0)
);
END COMPONENT;
-- Signal for DDS output
signal dds_output : std_logic_vector(13 downto 0); -- std_logic_vector for DDS output
-- Clock period definitions
constant Clock_period : time := 10 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: IIR_TDF_II_Top PORT MAP (
Clock => Clock,
sine1 => sine1,
Filtered_Output => Filtered_Output,
Delay_Accumulator_D3_out=>Delay_Accumulator_D3_out
);
-- Instantiate the DDS IP
Sin4Mhz_0_inst: Sin4Mhz_0 PORT MAP (
clk => Clock,
sine => dds_output -- Connect the DDS output to the std_logic_vector signal
);
-- Convert DDS output to signed and assign to sine1
sine1 <= signed(dds_output); -- Convert std_logic_vector to signed
-- Clock process definitions
Clock_process :process
begin
Clock <= '0';
wait for Clock_period/2;
Clock <= '1';
wait for Clock_period/2;
end process;
write_Output_Vector: process(Clock)
file output_text : text open write_mode is "C:\Users\maysam\Desktop\wind\Matlab\Output_Vec_HDL.txt";
variable LO1 : line;
begin
if rising_edge(Clock) then
write(LO1, to_integer(Filtered_Output));
writeline(output_text , LO1);
end if;
end process;
END;