- added CFIR
git-svn-id: http://moon:8086/svn/vhdl/trunk@183 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
@@ -69,9 +69,12 @@ ARCHITECTURE behavior OF tb_ddc IS
|
||||
lo_phase_in : in unsigned(lo_nbits_phase-1 downto 0);
|
||||
din_i : in sfixed;
|
||||
din_q : in sfixed;
|
||||
din_vld : in std_logic;
|
||||
-- dec_i : out sfixed;
|
||||
-- dec_q : out sfixed;
|
||||
-- dec_vld : out std_logic;
|
||||
dout_i : out sfixed;
|
||||
dout_q : out sfixed;
|
||||
din_vld : in std_logic;
|
||||
dout_vld : out std_logic
|
||||
);
|
||||
END COMPONENT;
|
||||
@@ -128,10 +131,15 @@ ARCHITECTURE behavior OF tb_ddc IS
|
||||
--Outputs
|
||||
SIGNAL ddc_din_i : sfixed(shi(nbits_in, nbits_in_frac) downto slo(nbits_in, nbits_in_frac));
|
||||
SIGNAL ddc_din_q : sfixed(shi(nbits_in, nbits_in_frac) downto slo(nbits_in, nbits_in_frac));
|
||||
SIGNAL ddc_din_vld : std_logic := '0';
|
||||
|
||||
SIGNAL ddc_dec_i : sfixed(shi(nbits_out, nbits_out_frac) downto slo(nbits_out, nbits_out_frac));
|
||||
SIGNAL ddc_dec_q : sfixed(shi(nbits_out, nbits_out_frac) downto slo(nbits_out, nbits_out_frac));
|
||||
SIGNAL ddc_dec_vld : std_logic;
|
||||
|
||||
SIGNAL ddc_dout_i : sfixed(shi(nbits_out, nbits_out_frac) downto slo(nbits_out, nbits_out_frac));
|
||||
SIGNAL ddc_dout_q : sfixed(shi(nbits_out, nbits_out_frac) downto slo(nbits_out, nbits_out_frac));
|
||||
SIGNAL ddc_dout_vld : std_logic;
|
||||
SIGNAL ddc_din_vld : std_logic := '0';
|
||||
|
||||
SIGNAL rfgen_nco_rst : std_logic := '0';
|
||||
SIGNAL rfgen_nco_en : std_logic := '0';
|
||||
@@ -191,9 +199,12 @@ BEGIN
|
||||
lo_phase_in => ddc_phase_in,
|
||||
din_i => ddc_din_i,
|
||||
din_q => ddc_din_q,
|
||||
din_vld => ddc_din_vld,
|
||||
-- dec_i => ddc_dec_i,
|
||||
-- dec_q => ddc_dec_q,
|
||||
-- dec_vld => ddc_dec_vld,
|
||||
dout_i => ddc_dout_i,
|
||||
dout_q => ddc_dout_q,
|
||||
din_vld => ddc_din_vld,
|
||||
dout_vld => ddc_dout_vld
|
||||
);
|
||||
|
||||
@@ -343,10 +354,12 @@ BEGIN
|
||||
END PROCESS;
|
||||
|
||||
tb_fo : PROCESS(clk)
|
||||
file RESULT_Ii: text open write_mode is "i_in.txt";
|
||||
file RESULT_Qi: text open write_mode is "q_in.txt";
|
||||
file RESULT_Io: text open write_mode is "i_dec.txt";
|
||||
file RESULT_Qo: text open write_mode is "q_dec.txt";
|
||||
file RESULT_Ii: text open write_mode is "i_in.txt";
|
||||
file RESULT_Qi: text open write_mode is "q_in.txt";
|
||||
file RESULT_Ifir: text open write_mode is "i_fir.txt";
|
||||
file RESULT_Qfir: text open write_mode is "q_fir.txt";
|
||||
file RESULT_Idec: text open write_mode is "i_dec.txt";
|
||||
file RESULT_Qdec: text open write_mode is "q_dec.txt";
|
||||
variable L: line;
|
||||
|
||||
BEGIN
|
||||
@@ -356,8 +369,12 @@ BEGIN
|
||||
fprint(RESULT_Qi, L,"%s\n", REAL'image(to_real(rfgen_dout_q)));
|
||||
end if;
|
||||
if ddc_dout_vld = '1' then
|
||||
fprint(RESULT_Io, L,"%s\n", REAL'image(to_real(ddc_dout_i)));
|
||||
fprint(RESULT_Qo, L,"%s\n", REAL'image(to_real(ddc_dout_q)));
|
||||
fprint(RESULT_Ifir, L,"%s\n", REAL'image(to_real(ddc_dout_i)));
|
||||
fprint(RESULT_Qfir, L,"%s\n", REAL'image(to_real(ddc_dout_q)));
|
||||
end if;
|
||||
if ddc_dec_vld = '1' then
|
||||
fprint(RESULT_Idec, L,"%s\n", REAL'image(to_real(ddc_dec_i)));
|
||||
fprint(RESULT_Qdec, L,"%s\n", REAL'image(to_real(ddc_dec_q)));
|
||||
end if;
|
||||
end if;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user