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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? uc_interface_tb.vhd

?? PLD與8051接口的參考設計
?? VHD
?? 第 1 頁 / 共 3 頁
字號:

-- uc_interface_tb.vhd
--
-- Created: 11/05/00 ALS
--      This file provides an 8051 uC model based on timing parameters from 8051 data sheet.
--
--
-- **************************************************************************************

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
use IEEE.std_logic_arith.all;

ENTITY testbench IS
END testbench;

ARCHITECTURE behavior OF testbench IS 

-- ************************************* Constant Declarations **************************
constant RESET_ACTIVE   : STD_LOGIC := '0';
constant CLK_PERIOD     : time := 50 nS;        -- system clock period


-- 8051 Timing constants
-- The constant TCLCL should be set to match the actual clock period of the 8051
-- The equations for the other constants to be modified to match the data sheet of the 
-- 8051 uC used in the design

constant TCLCL      : time := 62500 pS;         -- 8051 clock period - 16MHz
constant TLHLL      : time := 2*TCLCL - 40 nS;  -- ALE negated pulse width
constant TAVLL      : time := TCLCL - 50 nS;    -- Address valid to ALE low
constant TLLAX      : time := TCLCL - 35 nS;    -- Address low after ALE low
constant TQVWX      : time := TCLCL - 60 nS;    -- Data valid to WR_N transition
constant TWLWH      : time := 6*TCLCL - 100 nS; -- WR_N pulse width
constant TWHQX      : time := TCLCL - 50 nS;    -- Data hold after WR_N negation
constant TWHLH      : time := TCLCL - 40 nS;    -- WR_N or RD_N negation to ALE_N negation
constant TRLAZ      : time := 0 nS;             -- RD_N assertion to address float
constant TRLDV      : time := 5*TCLCL - 165 nS; -- RD_N assertion to valid data in
constant TRLRH      : time := 6*TCLCL - 100 nS; -- RD_N pulse width
constant TLLPL      : time := TCLCL - 40 nS;    -- ALE_N assertion to PSEN_N assertion
constant TPLAZ      : time := 10 nS;            -- PSEN_N assertion to address float
constant TPLIV      : time := 3*TCLCL - 115 nS; -- PSEN_N assertion to instruction valid
constant TPLPH      : time := 3*TCLCL - 45 nS;  -- PSEN_N pulse width
 
-- the constant below is used to assert ERROR. If set to 0, ERROR will never assert.
-- if non-zero, ERROR will assert this time period after beginning of simulation, stay
-- asserted for this time period, and then negate. 
-- Note that setting this constant and running a test of ERROR will probably cause the 
-- data read in from the SPIRR not to match the expected value, thus DATA_ERROR may assert for
-- a data period
constant ERROR_ASSERT_TIME  : time  := 0 uS;

-- the constants below are used to model the system clock cycles needed by the application logic to
-- grab the first data word from the input data register and the number of clock cycles needed
-- by the application logic to "work" on the data 
-- the signal CLK_CNT is used to count the clock
constant APP_FIRST_WORD_ACCESS  : integer    := 3;
constant APP_WORK_DATA_CLKS     : integer    := 40;

-- register addresses
-- Set the number of address bits representing the device address
constant DEVICE_ADDR_BITS   : integer       :=  8;    -- default is 8

-- Set the number of address bits representing the register addresses
constant REG_ADDR_BITS      : integer       :=  8;    -- default is 8

-- Set the base address for CoolRunner CPLD 
constant BASE_ADDR  : STD_LOGIC_VECTOR(DEVICE_ADDR_BITS-1 downto 0) := "00000000";

-- Set the Register Addresses (4 Total):
-- Status Register (BASE + 80h)
constant STATUS_ADDR     : STD_LOGIC_VECTOR(REG_ADDR_BITS-1 downto 0) := "10000000";

-- Control Register (BASE + 82h)
constant CTRL_ADDR     : STD_LOGIC_VECTOR(REG_ADDR_BITS-1 downto 0) := "10000010";

-- Input Data Register (BASE + 84h)
constant DATAIN_ADDR    : STD_LOGIC_VECTOR(REG_ADDR_BITS-1 downto 0) := "10000100";

-- Output Data Register (BASE + 86h)
constant DATAOUT_ADDR     : STD_LOGIC_VECTOR(REG_ADDR_BITS-1 downto 0) := "10000110";

-- number of data words and data words
constant NUM_DATA_WORDS : integer   := 4;
constant ALL_ONES   : std_logic_vector(7 downto 0) := "11111111";
constant ALL_ZEROS  : std_logic_vector(7 downto 0) := "00000000";
constant DE         : std_logic_vector(7 downto 0) := "11011110";
constant AD         : std_logic_vector(7 downto 0) := "10101101";
constant BE         : std_logic_vector(7 downto 0) := "10111110";
constant EF         : std_logic_vector(7 downto 0) := "11101111";
constant FA         : std_logic_vector(7 downto 0) := "11111010";
constant CE         : std_logic_vector(7 downto 0) := "11001110";

-- bit locations in status register
constant DONE_BIT       : integer   := 7;           -- DONE is bit 7 in Status Register
constant ERROR_BIT      : integer   := 6;           -- ERROR is bit 6 in Status Register
constant NEEDDATA_BIT   : integer   := 4;           -- NEED_DATA is bit 4 in Status Register
constant DATARDY_BIT    : integer   := 3;           -- DATA_RDY is bit 3 in Status Register


-- test data
type TEST_DATA is array (0 to NUM_DATA_WORDS-1) of std_logic_vector (7 downto 0);

-- assign data to be input to application logic in this array
constant TST_DATA_OUT : TEST_DATA := (
                        (DE),       -- write first word to be input to application logic
                        (AD),       -- next data word 
                        (BE),       -- next data word 
                        (EF)        -- last data word 
                        );

-- assign expected data output from application logic in this array
constant EXPECTED_DATA : TEST_DATA := (
                        (DE),       -- write first word to be output from application logic
                        (AD),       -- next data word 
                        (BE),       -- next data word 
                        (EF)        -- last data word 
                        );

--*************************************** Component Declaration *****************************
-- 
    component uc_interface
    port(
        clk             : in std_logic;
        reset           : in std_logic;
        addr            : in std_logic_vector(7 downto 0);
        ale_n           : in std_logic;
        psen_n          : in std_logic;
        rd_n            : in std_logic;
        wr_n            : in std_logic;
        done            : in std_logic;
        error           : in std_logic;
        need_data       : in std_logic;
        data_rdy        : in std_logic;
        data_rdy_reset  : out std_logic;
        dataout_load    : in std_logic;
        app_data        : in std_logic_vector(7 downto 0);    
        addr_data       : inout std_logic_vector(7 downto 0);
        int_n           : inout std_logic;
        app_en          : inout std_logic;
        start           : inout std_logic;      
        ctrl_bits       : inout std_logic_vector(4 downto 0);
        error_reset     : out std_logic;
        need_data_reset : out std_logic;
        data_in         : inout std_logic_vector(7 downto 0)
        );
    end component;
    
    
    
-- ************************************** Signal Declarations *******************************
-- uC bus signals
signal addr             :  std_logic_vector(7 downto 0);
signal addr_data        :  std_logic_vector(7 downto 0);
signal ale_n            :  std_logic;
signal psen_n           :  std_logic;
signal rd_n             :  std_logic;
signal wr_n             :  std_logic;
signal int_n            :  std_logic;

-- reset and clock
signal reset            :  std_logic;
signal clk              :  std_logic;

-- signals needed to interface to CoolRunner CPLD
signal app_en, en_app   :  std_logic;       -- app_en is from uC interface to application logic
                                            -- en_app is internal testbench signal
signal en_int           :  std_logic;       -- en_int is internal testbench signal
signal start            :  std_logic;
signal ctrl_bits        :  std_logic_vector(4 downto 0);
signal done             :  std_logic;
signal error            :  std_logic;
signal need_data        :  std_logic;
signal data_rdy         :  std_logic;
signal error_reset      :  std_logic;
signal need_data_reset  :  std_logic;
signal data_rdy_reset   :  std_logic;
signal dataout_load     :  std_logic;
signal app_data         :  std_logic_vector(7 downto 0);
signal data_in          :  std_logic_vector(7 downto 0);


-- testbench signals
signal ad_out,ucdata_in : std_logic_vector(7 downto 0);
signal ucdata_in_ce     : std_logic;    -- clock enable for input data register
signal write            : std_logic;    -- indicates a write cycle
signal assert_psen      : std_logic;    -- indicates a program store cycle
signal go, uc_done      : std_logic;    -- handshake signals to  state machine
signal ad_oe            : std_logic;    -- address/data bus output enable
signal uc_addr          : std_logic_vector(15 downto 0);-- addr to be output by uC 
signal uc_data          : std_logic_vector(7 downto 0); -- data to be output by uC
signal data_error       : std_logic;    -- indicates that data received <> data transmitted
signal exit_loop        : std_logic;    -- indicates that SPIERR was asserted
signal clk_cnt          : integer;      -- counts clks for APP_FIRST_WORD_ACCESS
                                        -- and for APP_WORK_DATA_CLKS
signal first_loop       : std_logic := '1';


BEGIN

-- ************************************ UUT Instantiation ********************************

UUT: uc_interface 
    port map(
        clk                 => clk,
        reset               => reset,
        addr_data           => addr_data,
        addr                => addr,
        ale_n               => ale_n,
        psen_n              => psen_n,
        rd_n                => rd_n,
        wr_n                => wr_n,
        int_n               => int_n,
        app_en              => app_en,
        start               => start,
        ctrl_bits           => ctrl_bits,
        done                => done,
        error               => error,
        need_data           => need_data,
        data_rdy            => data_rdy,
        error_reset         => error_reset,
        need_data_reset     => need_data_reset,
        data_rdy_reset      => data_rdy_reset,
        dataout_load        => dataout_load,
        app_data            => app_data,
        data_in             => data_in
    );


-- ************************************* Test Bench Processes and Code **************************

   -- Define the bi-directional data bus 
   -- use pulldowns when tri-stated
   addr_data <= ad_out when ad_oe = '1' 
        else (others => 'L');


-- ************************************ Clock Process *************************************
-- Process:  CREATE_CLK
-- Function:  Create 20Mhz clock
CREATE_CLK: process
    begin
        clk <= '0';
        wait for CLK_PERIOD/2;
        clk <= '1';
        wait for CLK_PERIOD/2;

    end process;


-- *********************************** Main Control Process *********************************
-- define the main controlling process that triggers the state machines
MAIN : process
   
   variable i,j,k   : integer := 0;     -- loop counters

   begin
        -- initialize control signals
        uc_addr <= (others => '0');
        uc_data <= (others => '0');
        go <= '0';
        write <= '0';
        assert_psen <= '0';
        data_error <= '0';
        en_app <= '0';
        en_int <= '0';
        exit_loop <= '0';

        -- assert RESET for two clocks
        reset <= RESET_ACTIVE;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品日日夜夜| 91亚洲国产成人精品一区二区三 | 国产98色在线|日韩| 欧美做爰猛烈大尺度电影无法无天| 91精品国产欧美一区二区18| 国产精品不卡视频| 国产在线国偷精品免费看| 在线观看91视频| 中文字幕成人在线观看| 韩国一区二区视频| 91麻豆精品国产91久久久 | 看电影不卡的网站| 欧美日韩在线精品一区二区三区激情| 久久免费看少妇高潮| 久久精品国产在热久久| 欧美日韩久久一区| 亚洲综合图片区| 91视频免费看| 国产精品久99| www.在线成人| 亚洲国产精品成人综合| 国产乱码字幕精品高清av| 欧美一区二区三区视频免费播放| 亚洲成人免费视| 欧美男男青年gay1069videost | 91精品国产色综合久久| 午夜天堂影视香蕉久久| 欧美视频一区二区三区| 亚洲在线中文字幕| 欧美性xxxxxxxx| 亚洲一区国产视频| 欧美高清视频在线高清观看mv色露露十八 | 亚洲成人中文在线| 欧洲一区二区av| 亚洲综合视频在线| 欧美日韩国产高清一区二区三区| 一区二区成人在线视频| 91久久一区二区| 亚洲成av人片一区二区三区| 欧美日韩三级一区二区| 午夜欧美视频在线观看| 日韩欧美一区电影| 国产麻豆精品视频| 中文字幕av免费专区久久| www.99精品| 亚洲一区二区三区免费视频| 欧美日韩一区高清| 青青草91视频| 欧美国产日韩精品免费观看| 91在线观看一区二区| 亚洲综合视频在线| 在线成人高清不卡| 国产一区二区三区日韩| 亚洲人快播电影网| 欧美精选一区二区| 韩国欧美国产一区| 亚洲欧洲日产国码二区| 欧美午夜电影一区| 国内成+人亚洲+欧美+综合在线 | 午夜视频一区在线观看| 精品欧美一区二区在线观看| 成人免费高清视频| 亚洲国产毛片aaaaa无费看| 日韩精品一区二区三区视频| 99久久婷婷国产精品综合| 日韩黄色一级片| 国产精品天美传媒沈樵| 中文一区二区完整视频在线观看| 久久99国内精品| 国产精品国产三级国产普通话三级 | 久久综合狠狠综合| 99精品在线观看视频| 秋霞午夜av一区二区三区| 亚洲国产成人午夜在线一区| 国产在线日韩欧美| 国产高清精品在线| 亚洲精品中文在线观看| 国产a精品视频| 亚洲欧洲av在线| 欧美日本韩国一区二区三区视频| 国产一区不卡在线| 午夜精品久久久久久久蜜桃app| 久久无码av三级| 欧美日韩国产a| 99视频精品在线| 韩国欧美国产1区| 午夜影视日本亚洲欧洲精品| 国产偷国产偷亚洲高清人白洁| 欧美亚洲国产一区二区三区va| 国产精品99久久久久久久vr | 视频一区在线视频| 亚洲欧洲日韩综合一区二区| 欧美mv日韩mv| 欧美日韩一二区| av不卡免费电影| 风间由美中文字幕在线看视频国产欧美 | 国产精品嫩草久久久久| 欧美不卡一区二区三区四区| 欧美三级电影网| 在线亚洲一区二区| av中文字幕一区| heyzo一本久久综合| 国产一区二区伦理片| 美女看a上一区| 日日摸夜夜添夜夜添精品视频| 亚洲一二三区在线观看| 成人免费在线视频| 国产精品对白交换视频| 中文在线资源观看网站视频免费不卡 | 色94色欧美sute亚洲线路一ni| 成人免费看视频| 成人av第一页| 91蜜桃视频在线| 色狠狠一区二区三区香蕉| 95精品视频在线| 一本到高清视频免费精品| 91美女精品福利| 色综合 综合色| 欧美日韩色综合| 欧美精品一卡二卡| 91精品国产综合久久久久久| 日韩一级片在线观看| 精品三级av在线| 国产日韩欧美a| 亚洲视频一二区| 一区二区三区在线不卡| 婷婷六月综合网| 精品一区二区日韩| 成人综合激情网| 97se亚洲国产综合自在线| 欧美写真视频网站| 日韩一区二区三区电影| 国产午夜精品一区二区三区视频 | 色综合天天在线| 欧美高清视频一二三区| 久久网站最新地址| 1区2区3区欧美| 亚洲国产精品久久人人爱蜜臀 | 欧美成人a∨高清免费观看| 337p日本欧洲亚洲大胆精品| 国产欧美日韩综合| 亚洲国产日韩精品| 国产一区二区视频在线播放| www.欧美精品一二区| 欧美日韩国产免费一区二区 | 欧美三级视频在线观看| 日韩欧美久久一区| 中文字幕日韩av资源站| 亚洲18色成人| 成人性生交大片免费看在线播放 | 国产调教视频一区| 亚洲精品第一国产综合野| 男人的天堂久久精品| 国产乱妇无码大片在线观看| 色av一区二区| 国产色一区二区| 亚洲午夜一二三区视频| 国产一区视频导航| 欧美日韩性生活| 中文字幕乱码一区二区免费| 日韩国产欧美三级| 成人性生交大合| 欧美一二三四区在线| 亚洲精品一二三| 成人精品视频一区二区三区| 日韩一级二级三级| 一区二区三区影院| 国产91精品免费| 精品av久久707| 亚洲a一区二区| 91天堂素人约啪| 国产欧美一区在线| 九色porny丨国产精品| 欧美撒尿777hd撒尿| 亚洲免费在线观看| www.久久精品| 国产欧美日韩麻豆91| 久久国产精品72免费观看| 欧美日韩视频在线一区二区| 一区二区三区四区视频精品免费| 国产成人精品综合在线观看 | 91同城在线观看| 国产欧美日韩不卡| 国模少妇一区二区三区| 日韩精品一区二区三区中文不卡 | 国产大陆亚洲精品国产| 精品久久五月天| 蜜桃精品在线观看| 欧美一级日韩免费不卡| 午夜久久久久久久久久一区二区| 欧美综合色免费| 亚洲国产视频一区二区| 欧美日韩精品一区二区天天拍小说 | 国产精品夫妻自拍| eeuss鲁片一区二区三区在线看| 久久久久久电影| 国产.精品.日韩.另类.中文.在线.播放| 精品国产乱码久久久久久蜜臀| 美女诱惑一区二区| 精品日本一线二线三线不卡|