From 1417d6f5cd3fa500611405586ebcf8b8d2e9ff9b Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Tue, 13 Jan 2009 09:55:05 +0000 Subject: [PATCH] - bugfix 'x_out' register git-svn-id: http://moon:8086/svn/vhdl/trunk@236 cc03376c-175c-47c8-b038-4cd826a8556b --- lib/filter/src/fir_stage_sys.vhd | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/filter/src/fir_stage_sys.vhd b/lib/filter/src/fir_stage_sys.vhd index 95d6aa2..af0f74a 100644 --- a/lib/filter/src/fir_stage_sys.vhd +++ b/lib/filter/src/fir_stage_sys.vhd @@ -63,12 +63,11 @@ constant min_pipe_lat : integer := 4; subtype in_t is sfixed(shi(nbits_in, nbits_in_frac) downto slo(nbits_in, nbits_in_frac)); subtype out_t is sfixed(shi(nbits_out, nbits_out_frac) downto slo(nbits_out, nbits_out_frac)); -type input_pipe_t is array (min_pipe_lat-2 downto 0) of in_t; -type coef_pipe_t is array (min_pipe_lat-2 downto 0) of in_t; +type input_pipe_t is array (pipe_latency-2 downto 0) of in_t; +type coef_pipe_t is array (pipe_latency-2 downto 0) of in_t; - -signal yin : sfixed(shi(nbits_in, nbits_in_frac) downto slo(nbits_in, nbits_in_frac)); -signal prod : sfixed(shi(nbits_out, nbits_out_frac) downto slo(nbits_out, nbits_out_frac)); +signal yin : in_t; +signal prod : out_t; ------------------------------------------------------------ begin @@ -88,18 +87,20 @@ begin h_pipe := h_pipe(h_pipe'left-1 downto 0) & resize(h_in, h_pipe(0)); prod <= resize(x_pipe(x_pipe'left) * h_pipe(h_pipe'left), prod, fixed_wrap, fixed_truncate); end if; - x_out <= resize(x_pipe(x_pipe'left), shi(nbits_out, nbits_out_frac), slo(nbits_out, nbits_out_frac)); end if; end process; ------------------------------------------------------------ proc_out_reg: process(clk) - variable yout : sfixed(shi(nbits_out, nbits_out_frac) downto slo(nbits_out, nbits_out_frac)); + variable yout : out_t; + variable xout : in_t; begin if rising_edge(clk) then if ce = '1' then - yout := resize(yin + prod, yout, fixed_wrap, fixed_truncate); - y_out <= yout; + yout := resize(yin + prod, yout, fixed_wrap, fixed_truncate); + y_out <= yout; + xout := resize(x_in, xout, fixed_wrap, fixed_truncate); + x_out <= xout; end if; end if; end process;