亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ofdm_kernel_tx_tb.vhd

?? OFDM的fpga實(shí)現(xiàn)
?? VHD
字號(hào):
-- ================================================================================
-- (c) 2007 Altera Corporation. All rights reserved.
-- Altera products are protected under numerous U.S. and foreign patents, maskwork
-- rights, copyrights and other intellectual property laws.
-- These design examples may only be used within Altera Corporation devices and remain 
-- the property of Altera. They are being provided on "as-is" basis and as an accommodation; 
-- therefore, all warranties, representations, or guarantees of any kind (whether express, 
-- implied, or statutory) including, without limitation, warranties of merchantability,
-- non-infringement, or fitness for a particular purpose, are specifically disclaimed.
-- Altera expressly does not recommend, suggest, or require that these examples be used
-- in combination with any other product not provided by Altera.
-- ================================================================================
-- 
-- Filename    : ofdm_kernel_Tx_tb.vhd
--
-- Description : TestBench for OFDM Kernel Module.
--
--               Reads Input data from text files and applies to Module.
--               To test different FFT sizes, changes the FFT size and CP size
--               in the test vector.
-- ================================================================================

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
use std.textio.all;


entity ofdm_kernel_Tx_tb is
end ofdm_kernel_Tx_tb;


architecture rtl of ofdm_kernel_Tx_tb is

  -----------------------------------------------------------------------------
  -- COMPONENT DECLARATIONS
  -----------------------------------------------------------------------------
  component ofdm_kernel_Tx
    generic
      (
        DFFTOUTWIDTH : natural := 31;
        DOUTWIDTH    : natural := 32;
        DFFTINWIDTH  : natural := 16;
        MWIDTH       : natural := 64;
        MADDR_WIDTH  : natural := 12;
        CPWIDTH      : natural := 10;
        NWIDTH       : natural := 11;
        MDEPTH       : natural := 4096
        );
    port
      (
        clk_f   : in std_logic;
        clk_s   : in std_logic;
        rst_f_n : in std_logic;
        rst_s_n : in std_logic;

        -- Control 
        L : in std_logic_vector (CPWIDTH - 1 downto 0);

        Lout : out std_logic_vector (CPWIDTH - 1 downto 0);

        N    : in  std_logic_vector (NWIDTH - 1 downto 0);
        Nout : out std_logic_vector(NWIDTH -1 downto 0);
        inv : in std_logic;
        
        -- Avalon Streaming Data Sink Input Interface
        din_valid : in  std_logic;
        din_real  : in  std_logic_vector (DFFTINWIDTH - 1 downto 0);
        din_imag  : in  std_logic_vector (DFFTINWIDTH - 1 downto 0);
        din_sop   : in  std_logic;
        din_eop   : in  std_logic;
        din_error : in  std_logic_vector(1 downto 0);
        din_ready : out std_logic;


        --Avalon Streaming Data Source Output Interface 
        dout_ready : in  std_logic;
        dout_valid : out std_logic;
        dout_sop   : out std_logic;
        dout_eop   : out std_logic;
        dout_real  : out std_logic_vector (DOUTWIDTH - 1 downto 0);
        dout_imag  : out std_logic_vector (DOUTWIDTH - 1 downto 0)

        );    
  end component;

  -----------------------------------------------------------------------------
  -- CONSTANT DECLARATIONS
  -----------------------------------------------------------------------------

  constant DFFTINWIDTH  : natural := 16;
  constant DOUTWIDTH    : natural := 32;
  constant CPWIDTH      : natural := 10;  -- Cyclic Prefix Size
  constant NWIDTH       : natural := 12;  -- this value must match FFT instantiation
  constant DFFTOUTWIDTH : natural := 31;  -- this value must match FFT output
                                          -- data width
  
  constant MWIDTH       : natural := 2*DOUTWIDTH;
  constant MDEPTH       : natural := 2**NWIDTH;  -- = 2*(2**(NWIDTH-1))=2**NWIDTH
  constant MADDR_WIDTH  : natural := NWIDTH;  -- = log2(MDEPTH)  

  constant HPERIOD_F : time := 5 ns;
  constant HPERIOD_S : time := 10 ns;
  constant RST_DELAY : time := 50 ns;

  constant NUM_FRAMES_c : natural := 7;

  signal clk_f   : std_logic := '0';
  signal clk_s   : std_logic := '0';
  signal rst_f_n : std_logic := '0';
  signal rst_s_n : std_logic := '0';

  signal N, Nout : std_logic_vector (NWIDTH - 1 downto 0);
  signal L, Lout : std_logic_vector(CPWIDTH - 1 downto 0);

  signal inv : std_logic := '0';
  
  signal sink_valid : std_logic;
  signal sink_sop   : std_logic;

  signal sink_eop     : std_logic;
  signal sink_error   : std_logic_vector(1 downto 0);
  signal sink_real    : std_logic_vector (DFFTINWIDTH - 1 downto 0);
  signal sink_imag    : std_logic_vector (DFFTINWIDTH - 1 downto 0);
  signal source_ready : std_logic;
  signal sink_ready   : std_logic;
  signal source_sop   : std_logic;
  signal source_sop_r : std_logic;
  signal source_eop   : std_logic;

  signal source_valid : std_logic;
  signal source_real  : std_logic_vector (DOUTWIDTH - 1 downto 0);
  signal source_imag  : std_logic_vector (DOUTWIDTH - 1 downto 0);

  -- for testing purposes, the input file contains 4128 random data symbols
  type fftpts_list_t is array (NUM_FRAMES_c - 1 downto 0) of natural;
  signal fftpts_array    : fftpts_list_t                   := (2048,64,256,128,128,1024,512);
  type cp_list_t is array (NUM_FRAMES_c - 1 downto 0) of natural;
  signal cp_array        : cp_list_t                       := (512,8,32,32,16,16,128);
  signal start           : std_logic;
  -- number of input frames
  signal frames_in_index : natural range 0 to NUM_FRAMES_c := 0;

  signal cnt        : natural range 0 to 2**(NWIDTH-1);
  signal end_test   : std_logic;
  -- signal the end of the input data stream and output data stream.
  signal end_input  : std_logic;


begin
  -----------------------------------------------------------------------------
  -- Generating Clk and reset
  -----------------------------------------------------------------------------
  process
  begin
    wait for HPERIOD_F;
    clk_f <= not(clk_f);
  end process;

  process
  begin
    wait for HPERIOD_S;
    clk_s <= not(clk_s);
  end process;

  process
  begin
    wait for RST_DELAY;
    wait until (clk_f = '1');
    rst_f_n <= '1';
    wait;
  end process;

  process
  begin
    wait for RST_DELAY;
    wait until (clk_s = '1');
    rst_s_n <= '1';
    wait;
  end process;
  
  -- for example purposes, the ready signal is always asserted.
  source_ready <= '1';

--  -- test source_ready; source_ready is a clk_s domain signal
--  source_ready_test : process
--  begin

--    source_ready <= '1';
--    wait for HPERIOD_S*300;
--    wait until (clk_s = '1');
--    source_ready <= '0';
--    wait for HPERIOD_S*10;
--    wait until (clk_s = '1');
--    source_ready <= '1';
--  end process source_ready_test;


  -- no input error
  sink_error <= (others => '0');

  -- start valid for first cycle to indicate that the file reading should start.
  start_p : process (clk_f, rst_f_n)
  begin
    if rst_f_n = '0' then
      start <= '1';
    elsif rising_edge(clk_f) then
      if sink_valid = '1' and sink_ready = '1' then
        start <= '0';
      end if;
    end if;
  end process start_p;


  -- sop and eop asserted in first and last sample of data
  cnt_p : process (clk_f, rst_f_n)
  begin
    if rst_f_n = '0' then
      cnt <= 0;
    elsif rising_edge(clk_f) then
      if sink_valid = '1' and sink_ready = '1' then
        if cnt = fftpts_array(frames_in_index) - 1 then
          cnt <= 0;
        else
          cnt <= cnt + 1;
        end if;
      end if;
    end if;
  end process cnt_p;

  N <= std_logic_vector(to_unsigned(fftpts_array(frames_in_index), NWIDTH));

  L <= std_logic_vector(to_unsigned(cp_array(frames_in_index), CPWIDTH));

  -- count the input frames and increment the index
  increment_index_p : process (clk_f, rst_f_n)
  begin
    if rst_f_n = '0' then
      frames_in_index <= 0;
    elsif rising_edge(clk_f) then
      if sink_eop = '1' and sink_valid = '1' and sink_ready = '1' then
        if frames_in_index < NUM_FRAMES_c - 1 then
          frames_in_index <= frames_in_index + 1;
        end if;
      end if;
    end if;
  end process increment_index_p;

  -- signal when all of the input data has been sent to the DUT
  end_input <= '1' when (sink_eop = '1' and sink_valid = '1' and (frames_in_index = NUM_FRAMES_c - 1)) else
               '0';


  -- generate start and end of packet signals
  sink_sop <= '1' when cnt = 0 else
              '0';

  sink_eop <= '1' when cnt = fftpts_array(frames_in_index) - 1 else
              '0';

  -- flag when done
  end_test_p : process (clk_f, rst_f_n)
  begin
    if rst_f_n = '0' then
      end_test <= '0';
    elsif rising_edge(clk_f) then
      source_sop_r <= source_sop;
      if end_input = '1' then
        end_test <= '1';
      end if;
    end if;
  end process end_test_p;

  -----------------------------------------------------------------------------------------------
  -- Read input data from files                                                                  
  -----------------------------------------------------------------------------------------------

  testbench_i : process(clk_f) is
    file r_file     : text open read_mode is "real_input.txt";
    variable data_r : integer;
    variable rdata  : line;
    file i_file     : text open read_mode is "imag_input.txt";
    variable idata  : line;
    variable data_i : integer;
  begin
    if(rst_f_n = '0') then
      sink_real  <= std_logic_vector(to_signed(0, 16));
      sink_imag  <= std_logic_vector(to_signed(0, 16));
      sink_valid <= '0';
    elsif rising_edge(clk_f) then

      -- send in NUM_FRAMES_c of data or until the end of the file
      if not endfile(r_file) and (end_input = '0' and end_test = '0') then
        if((sink_valid = '1' and sink_ready = '1') or
           (start = '1' and not (sink_valid = '1' and sink_ready = '0'))) then
          readline(r_file, rdata);
          read(rdata, data_r);
          readline(i_file, idata);
          read(idata, data_i);
          sink_valid <= '1';
          sink_real  <= std_logic_vector(to_signed(data_r, 16));
          sink_imag  <= std_logic_vector(to_signed(data_i, 16));
        else
          sink_valid <= '1';
          sink_real  <= sink_real;
          sink_imag  <= sink_imag;
        end if;
      else
        sink_valid <= '0';
        sink_real  <= std_logic_vector(to_signed(0, 16));
        sink_imag  <= std_logic_vector(to_signed(0, 16));
      end if;
--      testsig <= endfile(r_file);
    end if;
    
  end process testbench_i;

  ---------------------------------------------------------------------------------------------
  -- Write Real and Imginary Components to Files                                               
  ---------------------------------------------------------------------------------------------

  testbench_o : process(clk_s, rst_s_n) is
    file ro_file    : text open write_mode is "real_output_vhd.txt";
    variable rdata  : line;
    variable data_r : integer;
    file io_file    : text open write_mode is "imag_output_vhd.txt";
    variable idata  : line;
    variable data_i : integer;
  begin
    if rising_edge(clk_s) and rst_s_n = '1' then
--      if(source_valid = '1' and source_ready = '1') then
      if(source_valid = '1') then       -- removed source_ready since output
                                        -- ready latency is 4
        data_r := to_integer(signed(source_real));
        data_i := to_integer(signed(source_imag));
        write(rdata, data_r);
        writeline(ro_file, rdata);
        write(idata, data_i);
        writeline(io_file, idata);
      end if;
    end if;
  end process testbench_o;

  -----------------------------------------------------------------------------
  -- Write the blocks sizes and CP sizes generated to files
  -----------------------------------------------------------------------------
  blksize_report_o : process(clk_f) is
    file blk_file     : text open write_mode is "blksize_report.txt";
    variable blkdata  : line;
    variable data_blk : integer;
    file inv_file     : text open write_mode is "inverse_report.txt";
    variable invdata  : line;
    variable data_inv : bit;
    file cp_file : text open write_mode is "cpsize_report.txt";
    variable cpdata : line;
    variable data_cp : integer;
  begin
    if rising_edge(clk_f) then
      if(sink_valid = '1' and sink_ready = '1' and sink_sop = '1') then
        data_blk := to_integer(unsigned(N));
        write(blkdata, data_blk);
        writeline(blk_file, blkdata);
        data_cp := to_integer(unsigned(L));
        write(cpdata, data_cp);
        writeline(cp_file, cpdata);        
        data_inv := to_bit(inv);
        write(invdata, data_inv);
        writeline(inv_file, invdata);
     end if;
    end if;
  end process blksize_report_o;  
  ---------------------------------------------------------------------------------------------
  -- Kernel Component Instantiation                                                               
  ---------------------------------------------------------------------------------------------
  kernel_Tx_inst : ofdm_kernel_Tx
    generic map
    (
      DFFTOUTWIDTH => DFFTOUTWIDTH,
      DFFTINWIDTH  => DFFTINWIDTH,
      DOUTWIDTH    => DOUTWIDTH,
      MDEPTH       => MDEPTH,
      NWIDTH       => NWIDTH,
      MWIDTH       => MWIDTH,
      CPWIDTH      => CPWIDTH,
      MADDR_WIDTH  => MADDR_WIDTH
      )
    port map (
      clk_f      => clk_f,
      clk_s      => clk_s,
      rst_f_n    => rst_f_n,
      rst_s_n    => rst_s_n,
      L          => L,
      Lout       => Lout,
      N          => N,
      Nout       => Nout,
      inv => inv,
      din_valid  => sink_valid,
      din_sop    => sink_sop,
      din_eop    => sink_eop,
      din_real   => sink_real,
      din_imag   => sink_imag,
      din_error  => sink_error,
      dout_ready => source_ready,
      din_ready  => sink_ready,
      dout_sop   => source_sop,
      dout_eop   => source_eop,
      dout_valid => source_valid,
      dout_real  => source_real,
      dout_imag  => source_imag);


end rtl;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品99久久久久久宅男| 欧美日韩精品专区| 91麻豆免费观看| 精品日韩欧美一区二区| 亚洲男同1069视频| 国产**成人网毛片九色| 日韩一区二区中文字幕| 亚洲综合男人的天堂| 国产凹凸在线观看一区二区| 日韩色视频在线观看| 一区二区高清视频在线观看| 成人高清视频在线| 日韩你懂的在线播放| 五月天激情综合网| 色婷婷精品大在线视频| 中文字幕国产一区二区| 久久99国内精品| 欧美一级理论片| 亚洲成人第一页| 91免费视频网址| 一区在线中文字幕| 从欧美一区二区三区| 久久亚区不卡日本| 久久99深爱久久99精品| 91精品午夜视频| 日韩精品每日更新| 69堂亚洲精品首页| 天天做天天摸天天爽国产一区 | 91成人看片片| 亚洲人一二三区| av在线不卡电影| 亚洲欧洲国产日韩| 91丝袜国产在线播放| 日韩一区在线看| 不卡电影免费在线播放一区| 伊人婷婷欧美激情| 国产99久久久久| 国产精品久久三区| 色综合婷婷久久| 亚洲国产日韩av| 欧美日韩免费不卡视频一区二区三区| 亚洲啪啪综合av一区二区三区| 99国产精品一区| 亚洲精品五月天| 欧美日韩精品免费观看视频| 亚洲国产日韩一级| 日韩精品一区二区三区中文精品| 久久99国产精品尤物| 国产欧美日韩麻豆91| 成人精品国产一区二区4080| 国产精品国产三级国产普通话蜜臀 | 久久99国产精品免费网站| 欧美大片顶级少妇| 国产精品一区专区| 亚洲欧美电影院| 欧美剧情片在线观看| 韩国一区二区三区| 亚洲色图清纯唯美| 欧美群妇大交群的观看方式| 久久精品99久久久| 中文字幕一区二区三| 欧美色综合久久| 国内偷窥港台综合视频在线播放| 欧美国产日韩在线观看| 欧美视频在线观看一区| 国产美女精品在线| 亚洲男人的天堂在线观看| 欧美精三区欧美精三区| 国产精品91一区二区| 亚洲精品中文在线| 精品福利一二区| 色菇凉天天综合网| 韩国av一区二区三区四区| 亚洲欧洲成人精品av97| 91精品国产色综合久久ai换脸| 成人午夜精品在线| 日韩av一级电影| 国产精品超碰97尤物18| 日韩一级黄色大片| 在线亚洲精品福利网址导航| 国内外成人在线视频| 亚洲电影一级片| 国产精品系列在线| 日韩精品一区国产麻豆| 91成人在线免费观看| 风间由美一区二区av101| 人妖欧美一区二区| 亚洲高清免费一级二级三级| 日本一区二区在线不卡| 欧美不卡一区二区三区| 欧美日韩在线免费视频| 99re热视频精品| 国产成人高清在线| 久久激五月天综合精品| 亚洲成av人片www| 亚洲日本一区二区| 国产精品国产三级国产普通话三级| 欧美成人猛片aaaaaaa| 67194成人在线观看| 在线观看中文字幕不卡| www.欧美色图| 成人丝袜18视频在线观看| 国模套图日韩精品一区二区| 日本不卡一区二区三区| 亚洲国产欧美在线| 亚洲一区二区视频| 亚洲欧美另类久久久精品2019| 中文字幕在线观看不卡视频| 久久蜜臀中文字幕| 久久亚洲一级片| 精品日韩欧美在线| 精品国产91久久久久久久妲己| 日韩欧美电影一区| 欧美成人video| 久久综合色综合88| 久久精品一级爱片| 亚洲国产成人在线| 国产精品卡一卡二| 亚洲丝袜美腿综合| 亚洲黄色免费网站| 亚洲第一二三四区| 免费美女久久99| 九色porny丨国产精品| 韩国成人在线视频| 丰满白嫩尤物一区二区| www.欧美色图| 在线观看亚洲一区| 日韩一区二区视频| 26uuu另类欧美亚洲曰本| 国产日韩精品一区二区三区在线| 久久久精品欧美丰满| 欧美国产日本韩| 亚洲欧美日韩在线| 午夜激情一区二区| 久久se这里有精品| 成人成人成人在线视频| 99精品热视频| 欧美日韩成人在线| 日韩欧美在线123| 国产精品欧美一级免费| 亚洲欧美成人一区二区三区| 日韩精品91亚洲二区在线观看| 精品一区二区三区欧美| 播五月开心婷婷综合| 欧美无砖专区一中文字| 欧美成人在线直播| **网站欧美大片在线观看| 婷婷综合另类小说色区| 国产精品资源网站| 色94色欧美sute亚洲13| 欧美一区二区黄| 国产精品女上位| 婷婷开心久久网| 国产精品亚洲专一区二区三区| 日本乱码高清不卡字幕| 久久综合九色综合欧美亚洲| 亚洲日本青草视频在线怡红院| 免费国产亚洲视频| 91在线精品秘密一区二区| 欧美一区二区播放| 国产精品成人一区二区艾草| 免费欧美日韩国产三级电影| 91香蕉视频mp4| 久久网站热最新地址| 亚洲综合色成人| 成人激情小说乱人伦| 欧美videos大乳护士334| 亚洲欧美区自拍先锋| 国产黄色精品视频| 91精品国产一区二区人妖| 国产精品美女久久久久久| 蜜臀va亚洲va欧美va天堂| 色综合久久99| 中文字幕巨乱亚洲| 国产一区二区成人久久免费影院| 欧美视频一区二区三区四区| 成人免费一区二区三区视频 | 亚洲国产成人va在线观看天堂| 福利一区在线观看| 久久综合九色综合97婷婷女人| 天天色图综合网| 色先锋资源久久综合| 国产精品沙发午睡系列990531| 六月丁香婷婷久久| 欧美日韩中字一区| 亚洲国产综合人成综合网站| 91麻豆国产福利在线观看| 中文字幕精品一区二区精品绿巨人 | 自拍偷拍亚洲激情| 懂色av中文字幕一区二区三区| 日韩精品在线一区| 美女免费视频一区| 欧美一卡二卡在线| 免费精品视频最新在线| 欧美久久久久久久久| 亚洲成a人v欧美综合天堂| 欧美视频一区二区三区在线观看 | www国产成人免费观看视频 深夜成人网| 亚洲国产一区二区三区| 欧美日韩综合色|