OpenCores
URL https://opencores.org/ocsvn/mcip_open/mcip_open/trunk

Subversion Repositories mcip_open

[/] [mcip_open/] [trunk/] [MCIPopen_XilinxISEproject/] [Address_Provider.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 mezzah
--------------------------------------------------------------------------------
2
-- Company:        Ferhat Abbas University - Algeria
3
-- Engineer:       Ibrahim MEZZAH
4
-- Progect Supervisor: Dr H. Chemali
5
-- Create Date:    20:38:55 05/21/01
6
-- Design Name:    Data adress provider
7
-- Module Name:    Control_Address - Address
8
-- Project Name:   Microcontroller IP (MCIP)
9
-- Target Device:  xc3s500e-4fg320
10
-- Tool versions:  Xilinx ISE 9.1.03i
11
-- Description:  This module provides the adress of Data in Data Memory
12
--                                               as specified in the instruction.
13
-- Revision:             07/06/2008
14
-- Revision  5
15
--------------------------------------------------------------------------------
16
library IEEE;
17
use IEEE.STD_LOGIC_1164.ALL;
18
use IEEE.STD_LOGIC_UNSIGNED.ALL;
19
 
20
entity Address_Provider is
21
    Port ( Q1           : in std_logic;
22
                          Q4           : in std_logic;
23
           nreset       : in std_logic;
24
           IR11_0       : in std_logic_vector(11 downto 0);
25
           R_W          : in std_logic_vector(1 downto 0);
26
                          call_return  : in std_logic_vector(1 downto 0);
27
                          MovFF_enable : in std_logic;
28
                          load_BSR     : in std_logic;
29
           DATA         : inout std_logic_vector(7 downto 0);
30
           Address_RAM  : out std_logic_vector(11 downto 0));
31
end Address_Provider;
32
 
33
architecture Behavioral of Address_Provider is
34
 
35
         signal BSR : std_logic_vector(3 downto 0);
36
 
37
         signal Address : std_logic_vector(11 downto 0);
38
         signal Address11_8 : std_logic_vector(3 downto 0);
39
 
40
         signal data_read : std_logic_vector(7 downto 0);
41
 
42
         signal BSRs : std_logic_vector(3 downto 0);
43
 
44
         signal AB : std_logic_vector(3 downto 0);               -- Access Bank
45
 
46
         signal Address_Latch : std_logic_vector(3 downto 0);
47
 
48
         alias RE : std_logic is R_W(1);
49
         alias WE : std_logic is R_W(0);
50
 
51
begin
52
 
53
         Address11_8 <= IR11_0(11 downto 8)                      when MovFF_enable = '1' else
54
                                                 AB                                                              when IR11_0(8) = '0' else
55
                                                 BSR;
56
         Address <= Address11_8 & IR11_0(7 downto 0);
57
 
58
         Address_Latch <= IR11_0(4 downto 3) & IR11_0(1 downto 0);
59
 
60
         data_read <= x"0"&BSR;
61
 
62
                 AB <= "0000"                                     when ( IR11_0(7 downto 0) < x"80" ) else
63
                                 "1111";
64
 
65
         Address_RAM <= Address;
66
 
67
         DATA <= data_read                                when (Q1 = '1' and RE = '1') else
68
                          (others => 'Z');
69
 
70
latchs :  process (nreset, Q4, WE, Address_Latch,
71
                                                IR11_0, load_BSR,
72
                                                call_return, BSRs, BSR)
73
  begin
74
         if nreset = '0' then
75
                 BSR   <= (others => '0');
76
                 BSRs  <= (others => '0');
77
 
78
         elsif (Q4'event and Q4='1') then
79
                  if WE = '1' then
80
                         case Address_Latch is
81
                          when "0000" =>  BSR  <= DATA(3 downto 0);
82
                          when others => null;
83
                         end case;
84
                        else
85
                                if load_BSR = '1' then
86
                                        BSR <= IR11_0(3 downto 0);
87
                                else
88
                                  if call_return(1) = '1' then
89
                                  if call_return(0) = '0' then
90
                                        BSRs <= BSR;                                            -- call
91
                                  else
92
                                        BSR <= BSRs;                                            -- return
93
                                  end if;
94
                                  end if;
95
                                end if;
96
                  end if;
97
         end if;
98
  end process;
99
 
100
end Behavioral;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.