Update LFO and moving average filter implementations; fix signal assignments and improve clarity

This commit is contained in:
2025-05-23 17:06:00 +02:00
parent 86bf16abaf
commit 0b9c06d11e
4 changed files with 783 additions and 796 deletions

View File

@@ -1,7 +1,7 @@
--Copyright 1986-2020 Xilinx, Inc. All Rights Reserved.
----------------------------------------------------------------------------------
--Tool Version: Vivado v.2020.2 (win64) Build 3064766 Wed Nov 18 09:12:45 MST 2020
--Date : Fri May 23 15:41:37 2025
--Date : Fri May 23 16:56:48 2025
--Host : Davide-Samsung running 64-bit major release (build 9200)
--Command : generate_target lab_3_wrapper.bd
--Design : lab_3_wrapper

File diff suppressed because it is too large Load Diff

View File

@@ -44,7 +44,7 @@ ARCHITECTURE Behavioral OF LFO IS
SIGNAL step_clk_cycles : INTEGER RANGE LFO_CLK_CYCLES_MIN TO LFO_CLK_CYCLES_MAX := LFO_COUNTER_BASE_CLK_CYCLES;
SIGNAL step_counter : INTEGER RANGE 0 TO LFO_CLK_CYCLES_MAX := 0;
SIGNAL tri_counter : SIGNED(TRIANGULAR_COUNTER_LENGHT - 1 DOWNTO 0) := (OTHERS => '0');
SIGNAL tri_counter : SIGNED(TRIANGULAR_COUNTER_LENGHT DOWNTO 0) := (OTHERS => '0');
SIGNAL direction_up : STD_LOGIC := '1';
SIGNAL m_axis_tvalid_int : STD_LOGIC := '0';
@@ -68,7 +68,7 @@ BEGIN
ELSE
-- Set the step_clk_cycles based on the joystick input
step_clk_cycles <= LFO_COUNTER_BASE_CLK_CYCLES - ADJUSTMENT_FACTOR * (JSTK_CENTER_VALUE - to_integer(unsigned(lfo_period)));
step_clk_cycles <= LFO_COUNTER_BASE_CLK_CYCLES - ADJUSTMENT_FACTOR * (to_integer(unsigned(lfo_period)) - JSTK_CENTER_VALUE);
IF lfo_enable = '1' THEN

View File

@@ -72,22 +72,16 @@ ARCHITECTURE Behavioral OF moving_average_filter_en IS
END COMPONENT;
-- Internal signals for the all-pass filter
SIGNAL all_pass_s_tvalid : STD_LOGIC;
SIGNAL all_pass_s_tready : STD_LOGIC;
SIGNAL all_pass_m_tvalid : STD_LOGIC;
SIGNAL all_pass_m_tdata : STD_LOGIC_VECTOR(TDATA_WIDTH - 1 DOWNTO 0);
SIGNAL all_pass_m_tlast : STD_LOGIC;
SIGNAL all_pass_m_tready : STD_LOGIC;
SIGNAL all_pass_s_tready : STD_LOGIC;
-- Internal signals for the moving average filter
SIGNAL moving_avg_s_tvalid : STD_LOGIC;
SIGNAL moving_avg_s_tready : STD_LOGIC;
SIGNAL moving_avg_m_tvalid : STD_LOGIC;
SIGNAL moving_avg_m_tdata : STD_LOGIC_VECTOR(TDATA_WIDTH - 1 DOWNTO 0);
SIGNAL moving_avg_m_tlast : STD_LOGIC;
SIGNAL moving_avg_m_tready : STD_LOGIC;
SIGNAL moving_avg_s_tready : STD_LOGIC;
BEGIN
@@ -100,7 +94,7 @@ BEGIN
aclk => aclk,
aresetn => aresetn,
s_axis_tvalid => all_pass_s_tvalid,
s_axis_tvalid => s_axis_tvalid,
s_axis_tdata => s_axis_tdata,
s_axis_tlast => s_axis_tlast,
s_axis_tready => all_pass_s_tready,
@@ -108,7 +102,7 @@ BEGIN
m_axis_tvalid => all_pass_m_tvalid,
m_axis_tdata => all_pass_m_tdata,
m_axis_tlast => all_pass_m_tlast,
m_axis_tready => all_pass_m_tready
m_axis_tready => m_axis_tready
);
-- Instantiate the moving average filter
@@ -121,7 +115,7 @@ BEGIN
aclk => aclk,
aresetn => aresetn,
s_axis_tvalid => moving_avg_s_tvalid,
s_axis_tvalid => s_axis_tvalid,
s_axis_tdata => s_axis_tdata,
s_axis_tlast => s_axis_tlast,
s_axis_tready => moving_avg_s_tready,
@@ -129,16 +123,9 @@ BEGIN
m_axis_tvalid => moving_avg_m_tvalid,
m_axis_tdata => moving_avg_m_tdata,
m_axis_tlast => moving_avg_m_tlast,
m_axis_tready => moving_avg_m_tready
m_axis_tready => m_axis_tready
);
-- Assign filter control signals based on enable_filter
all_pass_s_tvalid <= s_axis_tvalid WHEN enable_filter = '0' ELSE '0';
moving_avg_s_tvalid <= s_axis_tvalid WHEN enable_filter = '1' ELSE '0';
all_pass_m_tready <= m_axis_tready WHEN enable_filter = '0' ELSE '0';
moving_avg_m_tready <= m_axis_tready WHEN enable_filter = '1' ELSE '0';
-- Main AXIS assignments based on enable_filter
s_axis_tready <= all_pass_s_tready WHEN enable_filter = '0' ELSE moving_avg_s_tready;