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

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

?? test_sim_dp2.vhd

?? 常見的輸入輸出及存儲器件(ram及fifo)vhdl實(shí)現(xiàn)
?? VHD
字號:
----------------------------------------------------------------------------
----------------------------------------------------------------------------
--  The Free IP Project
--  VHDL Free-RAM Core
--  (c) 1999, The Free IP Project and David Kessner
--
--
--  FREE IP GENERAL PUBLIC LICENSE
--  TERMS AND CONDITIONS FOR USE, COPYING, DISTRIBUTION, AND MODIFICATION
--
--  1.  You may copy and distribute verbatim copies of this core, as long
--      as this file, and the other associated files, remain intact and
--      unmodified.  Modifications are outlined below.  
--  2.  You may use this core in any way, be it academic, commercial, or
--      military.  Modified or not.  
--  3.  Distribution of this core must be free of charge.  Charging is
--      allowed only for value added services.  Value added services
--      would include copying fees, modifications, customizations, and
--      inclusion in other products.
--  4.  If a modified source code is distributed, the original unmodified
--      source code must also be included (or a link to the Free IP web
--      site).  In the modified source code there must be clear
--      identification of the modified version.
--  5.  Visit the Free IP web site for additional information.
--      http://www.free-ip.com
--
----------------------------------------------------------------------------
----------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
library work;
use work.ram_lib.all;


entity ram_test is
end ram_test;


architecture arch_ram_test of ram_test is
  signal reset		:std_logic := '1';
  signal mask		:std_logic_vector (31 downto 0);
  type STATES is (WRITE, READ);

  signal clk1		:std_logic := '1';
  signal state1		:states;
  signal state_reg1	:states;
  signal addr1		:std_logic_vector (12 downto 0);
  signal addr_in1	:std_logic_vector (addr1'high+1 downto 0);
  signal din1		:std_logic_vector (7 downto 0);
  signal dout1		:std_logic_vector (din1'range);
  signal write_enable1	:std_logic;
  signal rand1_1	:std_logic_vector (mask'range);
  signal rand2_1	:std_logic_vector (mask'range);
  signal rand2_reg_1 	:std_logic_vector (mask'range);
  signal addr_top1	:std_logic;
  signal failure1 	:std_logic;

  signal clk2		:std_logic := '1';
  signal state2		:states;
  signal state_reg2	:states;
  signal addr2		:std_logic_vector (addr1'range);
  signal addr_in2	:std_logic_vector (addr1'high+1 downto 0);
  signal din2		:std_logic_vector (din1'range);
  signal dout2		:std_logic_vector (din1'range);
  signal write_enable2	:std_logic;
  signal rand1_2	:std_logic_vector (mask'range);
  signal rand2_2	:std_logic_vector (mask'range);
  signal rand2_reg_2 	:std_logic_vector (mask'range);
  signal addr_top2	:std_logic;
  signal failure2	:std_logic;

  signal addr_max	:std_logic_vector (addr1'range);

begin
  reset <= '1' after 0 ns, '0' after 125 ns;
  mask <= "10100011000000000000000000000000";  -- 0xA3000000
  addr_max <= (others=>'1');


  process (clk1)
  begin
    if clk1='1' then
      clk1 <= '0' after 20 ns, '1' after 40 ns;
    end if;
  end process;

  process (clk2)
  begin
    if clk2='1' then
      clk2 <= '0' after 21 ns, '1' after 42 ns;
    end if;
  end process;



  -- The address counter
  process (reset, clk1)
  begin
    if reset='1' then
      addr1 <= (others=>'0');
    elsif clk1'event and clk1='1' then
      addr1 <= addr1 + 1;
    end if;
  end process;

  process (reset, clk2)
  begin
    if reset='1' then
      addr2 <= (others=>'0');
    elsif clk2'event and clk2='1' then
      addr2 <= addr2 + 1;
    end if;
  end process;


  -- The addr_top signal
  addr_top1 <= '1' when addr1=addr_max else '0';
  addr_top2 <= '1' when addr2=addr_max else '0';
  

  -- The state machine
  process (reset, clk1)
  begin
    if reset='1' then
      state1 <= WRITE;
    elsif clk1'event and clk1='1' then
      case state1 is
        when WRITE =>
            if addr_top1='1' then
              state1 <= READ;
            end if;
            
        when READ =>
            if addr_top1='1' then
              state1 <= WRITE;
            end if;
            
        when others =>
            state1 <= WRITE;
      end case;
    end if;
  end process;


  process (reset, clk2)
  begin
    if reset='1' then
      state2 <= WRITE;
    elsif clk2'event and clk2='1' then
      case state2 is
        when WRITE =>
            if addr_top2='1' then
              state2 <= READ;
            end if;
            
        when READ =>
            if addr_top2='1' then
              state2 <= WRITE;
            end if;
            
        when others =>
            state2 <= WRITE;
      end case;
    end if;
  end process;


  -- Generate a delayed version of state
  process (reset, clk1)
  begin
    if reset='1' then
      state_reg1 <= WRITE;
    elsif clk1'event and clk1='1' then
      state_reg1 <= state1;
    end if;
  end process;

  process (reset, clk2)
  begin
    if reset='1' then
      state_reg2 <= WRITE;
    elsif clk2'event and clk2='1' then
      state_reg2 <= state2;
    end if;
  end process;


  -- The write data generator
  process (reset, clk1)
  begin
    if reset='1' then
      rand1_1 <= (others => '1');
    elsif clk1'event and clk1='1' then
      if state1=WRITE then
        if rand1_1(0)='1' then
          rand1_1 <= ("0" & rand1_1(rand1_1'high downto 1)) xor mask;
        else
          rand1_1 <= ("0" & rand1_1(rand1_1'high downto 1));
        end if;
      end if;
    end if;
  end process;

  addr_in1 <= "0" & addr1;
  din1 <= rand1_1(din1'range);


  process (reset, clk2)
  begin
    if reset='1' then
      rand1_2 <= (others => '1');
    elsif clk2'event and clk2='1' then
      if state2=WRITE then
        if rand1_2(0)='1' then
          rand1_2 <= ("0" & rand1_2(rand1_2'high downto 1)) xor mask;
        else
          rand1_2 <= ("0" & rand1_2(rand1_2'high downto 1));
        end if;
      end if;
    end if;
  end process;

  addr_in2 <= "1" & addr2;
  din2 <= rand1_2(din2'range);


  -- The READ data generator
  process (reset, clk1)
  begin
    if reset='1' then
      rand2_1 <= (others => '1');
      rand2_reg_1 <= (others => '1');
    elsif clk1'event and clk1='1' then
      rand2_reg_1 <= rand2_1;
      
      if state1=READ then
        if rand2_1(0)='1' then
          rand2_1 <= ("0" & rand2_1(rand2_1'high downto 1)) xor mask;
        else
          rand2_1 <= ("0" & rand2_1(rand2_1'high downto 1));
        end if;
      end if;
    end if;
  end process;

  process (reset, clk2)
  begin
    if reset='1' then
      rand2_2 <= (others => '1');
      rand2_reg_2 <= (others => '1');
    elsif clk2'event and clk2='1' then
      rand2_reg_2 <= rand2_2;
      
      if state2=READ then
        if rand2_2(0)='1' then
          rand2_2 <= ("0" & rand2_2(rand2_2'high downto 1)) xor mask;
        else
          rand2_2 <= ("0" & rand2_2(rand2_2'high downto 1));
        end if;
      end if;
    end if;
  end process;


  -- Write Enable
  process (reset, clk1)
  begin
    if reset='1' then
      write_enable1 <= '1';
    elsif clk1'event and clk1='1' then
      if addr_top1='1' then
        if state1=READ then
          write_enable1 <= '1';
        else
          write_enable1 <= '0';
        end if;
      elsif state1=WRITE then
        write_enable1 <= '1';
      else
        write_enable1 <= '0';
      end if;
    end if;
  end process;

  process (reset, clk2)
  begin
    if reset='1' then
      write_enable2 <= '1';
    elsif clk2'event and clk2='1' then
      if addr_top2='1' then
        if state2=READ then
          write_enable2 <= '1';
        else
          write_enable2 <= '0';
        end if;
      elsif state2=WRITE then
        write_enable2 <= '1';
      else
        write_enable2 <= '0';
      end if;
    end if;
  end process;


  -- The RAM under test
  U1: ram_dp2
  	generic map (addr_bits => addr_in1'high+1,
  	             data_bits => din1'high+1,
  	             block_type => 0)
  	port map (reset,
                  clk1, write_enable1, addr_in1, din1, dout1,
                  clk2, write_enable2, addr_in2, din2, dout2);

  -- Generate the failure signal
  process (reset, clk1)
  begin
    if reset='1' then
      failure1 <= '0';
    elsif clk1'event and clk1='1' then
      if failure1='0' then
        if state_reg1=READ then
          if dout1/=rand2_reg_1(dout2'range) then
            failure1 <= '1';
            assert 1=0
            report "Error in port 1."
                    severity failure;           
          end if;
        end if;
      end if;
    end if;
  end process;

  process (reset, clk2)
  begin
    if reset='1' then
      failure2 <= '0';
    elsif clk2'event and clk2='1' then
      if failure2='0' then
        if state_reg2=READ then
          if dout2/=rand2_reg_2(dout2'range) then
            failure2 <= '1';
            assert 1=0
            report "Error in port 2."
                    severity failure;
          end if;
        end if;
      end if;
    end if;
  end process;

end arch_ram_test;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久婷婷国产综合精品电影| 99精品视频在线免费观看| 国产精品三级av在线播放| 欧美三级韩国三级日本三斤| 国产一区在线观看麻豆| 亚洲成av人片观看| 亚洲人成精品久久久久| 久久免费看少妇高潮| 欧美色电影在线| a级精品国产片在线观看| 美日韩一区二区| 亚洲一二三四区| 日韩美女视频19| 久久久久久久综合日本| 欧美一区二区三区不卡| av电影在线不卡| 国产91精品一区二区| 理论电影国产精品| 日本成人在线网站| 亚洲电影一区二区三区| 亚洲色图欧美在线| 亚洲欧美综合网| 国产精品乱子久久久久| 久久在线观看免费| 日韩一区二区影院| 91.成人天堂一区| 在线观看免费一区| 色天使久久综合网天天| 99久久99久久精品免费看蜜桃| 国产精品性做久久久久久| 麻豆国产精品一区二区三区 | 中文字幕欧美区| 日韩美一区二区三区| 欧美一区二区在线视频| 欧美精品丝袜中出| 欧美日韩国产成人在线免费| 欧美中文字幕一区二区三区| 欧美三级日韩在线| 欧美日韩一卡二卡三卡| 欧美日韩和欧美的一区二区| 欧美午夜电影网| 欧美日韩三级一区| 欧美一级一级性生活免费录像| 制服丝袜在线91| 精品国产伦一区二区三区观看方式| 日韩午夜三级在线| 精品免费视频.| 国产日韩欧美在线一区| 国产精品久久久久久久久快鸭| 国产精品家庭影院| 一区二区三区免费看视频| 亚洲影院理伦片| 亚洲高清一区二区三区| 日韩av一级电影| 国产一区二区精品久久91| 国产91清纯白嫩初高中在线观看| 99re在线视频这里只有精品| 欧洲在线/亚洲| 日韩欧美一区在线| 久久久精品天堂| 最新日韩av在线| 婷婷一区二区三区| 国产在线精品一区二区三区不卡| 成人激情免费电影网址| 欧美优质美女网站| 日韩一区二区在线看片| 国产精品视频一二三| 亚洲精品美国一| 全国精品久久少妇| 国产激情精品久久久第一区二区 | 日韩一区二区三区在线视频| 久久久综合视频| 亚洲视频精选在线| 日本aⅴ精品一区二区三区| 国产成人自拍网| 欧美三级电影网站| 久久久久久久久久电影| 亚洲午夜免费福利视频| 国模少妇一区二区三区| 在线中文字幕一区| 精品国产制服丝袜高跟| 亚洲精选一二三| 久久99这里只有精品| 色悠悠亚洲一区二区| 欧美不卡激情三级在线观看| 最新中文字幕一区二区三区| 老汉av免费一区二区三区| 色噜噜夜夜夜综合网| 久久亚洲免费视频| 偷窥国产亚洲免费视频| 成人av在线一区二区| 欧美电影免费观看高清完整版| 亚洲欧美一区二区视频| 久久国产精品色| 在线亚洲一区二区| 国产精品午夜免费| 久久超碰97人人做人人爱| 色欲综合视频天天天| 亚洲国产经典视频| 久久99最新地址| 欧美区在线观看| 亚洲精选免费视频| 成人高清视频在线观看| 精品黑人一区二区三区久久| 亚洲国产你懂的| 一本大道av一区二区在线播放| 2017欧美狠狠色| 日本三级韩国三级欧美三级| 色偷偷成人一区二区三区91| 国产欧美一区二区精品忘忧草| 免费看日韩精品| 欧美美女黄视频| 亚洲影院在线观看| 一本久道久久综合中文字幕| 国产精品素人视频| 国产美女在线观看一区| 日韩欧美国产精品| 日本免费新一区视频| 欧美日韩国产电影| 亚洲午夜激情av| 91久久线看在观草草青青| 中文字幕中文字幕一区| 国产盗摄女厕一区二区三区| 精品久久久三级丝袜| 久久se精品一区二区| 欧美一区二区二区| 日本不卡1234视频| 日韩午夜在线观看| 久久激情五月激情| 久久一留热品黄| 国产成人精品影院| 国产精品美女久久久久久2018| 国产成人av一区| 国产精品美女一区二区| a美女胸又www黄视频久久| 亚洲特级片在线| 91国偷自产一区二区使用方法| 一区二区三区日韩在线观看| 91福利国产成人精品照片| 亚洲第一狼人社区| 91精品国产aⅴ一区二区| 日本免费在线视频不卡一不卡二| 日韩午夜中文字幕| 国产精品一二三四| 国产精品久久看| 日本精品一区二区三区四区的功能| 亚洲精品欧美综合四区| 色婷婷久久99综合精品jk白丝| 亚洲综合在线电影| 69堂国产成人免费视频| 久久国产精品免费| 国产精品青草综合久久久久99| 91在线porny国产在线看| 亚洲国产精品综合小说图片区| 91麻豆精品国产91久久久资源速度 | 国产高清视频一区| 国产精品麻豆视频| 欧美亚洲综合一区| 蜜臀99久久精品久久久久久软件| 久久综合色鬼综合色| 不卡一二三区首页| 午夜精品福利一区二区三区蜜桃| 欧美一区二区三区在线电影| 国产精品91一区二区| 亚洲精品欧美综合四区| 正在播放亚洲一区| 国产河南妇女毛片精品久久久| 亚洲欧美另类久久久精品2019| 欧美视频一区在线观看| 极品少妇一区二区| 亚洲视频网在线直播| 日韩一区二区三区电影| 国产69精品久久久久毛片| 亚洲国产综合在线| 久久网站热最新地址| 一本大道久久a久久综合| 久久福利视频一区二区| 亚洲丝袜另类动漫二区| 日韩欧美色综合网站| 91在线观看高清| 韩国三级在线一区| 亚洲一区二区三区中文字幕 | 日韩一区二区中文字幕| 成人黄色小视频| 日本v片在线高清不卡在线观看| 欧美国产激情一区二区三区蜜月 | 337p粉嫩大胆色噜噜噜噜亚洲| 99国产精品久久久久久久久久| 老司机精品视频导航| 亚洲蜜臀av乱码久久精品蜜桃| 精品国精品国产| 欧美日韩一区二区三区在线 | 色欧美日韩亚洲| 国产一区二区三区综合| 亚洲国产精品久久艾草纯爱 | 人人精品人人爱| 一区二区三区四区不卡在线| 国产亚洲成aⅴ人片在线观看| 欧美高清视频在线高清观看mv色露露十八 | 91精品视频网|