--------------------------------------------------
-- Model        :   8051 Behavioral Model,
--                  VHDL Entity mc8051.p0_drv.interface
--
-- Author       :   Michael Mayer (mrmayer@computer.org),
--                  Dr. Hardy J. Pottinger,
--                  Department of Electrical Engineering
--                  University of Missouri - Rolla
--
-- Created at   :   09/22/98 19:32:38
--
LIBRARY ieee ;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
LIBRARY mc8051 ;
USE mc8051.synth_pack.all;

ENTITY p0_drv IS
   PORT( 
      addr_gb : IN     std_logic_vector( 7 DOWNTO 0 )  ;
      indirect_sel : IN     std_logic ;
      int_clk : IN     std_logic ;
      int_rst : IN     std_logic ;
      latch_pins : IN     std_logic ;
      p0_addr : IN     std_logic_vector( 7 DOWNTO 0 )  ;
      p0_ctrl : IN     std_logic ;
      rd_gb : IN     std_logic ;
      read_latch : IN     std_logic ;
      wr_gb : IN     std_logic ;
      acknow : OUT    std_logic ;
      P0 : INOUT  std_logic_vector( 7 DOWNTO 0 )  ;
      data_gb : INOUT  std_logic_vector( 7 DOWNTO 0 ) 
   );

-- Declarations

END p0_drv ;
--
-- VHDL Architecture mc8051.p0_drv.spec
--
-- Created:
--          by - mrmayer.UNKNOWN (eceultra20.ece.umr.edu)
--          at - 19:46:14 09/19/98
--
-- Generated by Mentor Graphics' Renoir(TM) 3.4 (Build 18)
--
architecture spec of p0_drv is
    SIGNAL  p0_reg   : bvec := "00000000";
    SIGNAL  p0_sel   : std_logic;

begin
    -- The p0 is selected by addr 80 and NOT indirect_sel
    p0_sel <= '1' WHEN (addr_gb = "10000000") AND (indirect_sel = '0') ELSE
              '0';
 
    -- The p0 is reset to 1's during reset,
    -- set to the data_gb during a write to p0, or else left alone.
    p0_reg <= "11111111" WHEN (int_rst = '1' OR p0_ctrl = '1') ELSE -- reset
               unsigned(data_gb)  WHEN (wr_gb = '1' AND p0_sel = '1') ELSE -- async
               p0_reg;

    p0 <= p0_addr WHEN p0_ctrl = '1' ELSE
          std_logic_vector(to_high_imped(p0_reg));
 
    -- The data_gb is driven with the p0_ref during a read from p0_reg,
    -- or else left in high impedance.
    data_gb <= to_x01(p0) WHEN rd_gb = '1' AND p0_sel = '1' AND read_latch = '0'
 ELSE
               std_logic_vector(p0_reg)    WHEN rd_gb = '1' AND p0_sel = '1' AND read_latch = '1'
ELSE
               "ZZZZZZZZ";
 
    -- The acknowledge is pulled high when the global bus and p0
    -- reg become equal (considered stable) and the acc is selected.
    acknow <= '1' WHEN data_gb = std_logic_vector(p0_reg) AND p0_sel = '1' ELSE
              'Z';

end spec;

<div align="center"><br /><script type="text/javascript"><!--
google_ad_client = "pub-7293844627074885";
//468x60, Created at 07. 11. 25
google_ad_slot = "8619794253";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />&nbsp;</div>