mc8051_top_struc.vhd
上传用户:sztwq510
上传日期:2007-04-20
资源大小:209k
文件大小:8k
源码类别:

VHDL/FPGA/Verilog

开发平台:

Matlab

  1. -------------------------------------------------------------------------------
  2. --                                                                           --
  3. --          X       X   XXXXXX    XXXXXX    XXXXXX    XXXXXX      X          --
  4. --          XX     XX  X      X  X      X  X      X  X           XX          --
  5. --          X X   X X  X         X      X  X      X  X          X X          --
  6. --          X  X X  X  X         X      X  X      X  X         X  X          --
  7. --          X   X   X  X          XXXXXX   X      X   XXXXXX      X          --
  8. --          X       X  X         X      X  X      X         X     X          --
  9. --          X       X  X         X      X  X      X         X     X          --
  10. --          X       X  X      X  X      X  X      X         X     X          --
  11. --          X       X   XXXXXX    XXXXXX    XXXXXX    XXXXXX      X          --
  12. --                                                                           --
  13. --                                                                           --
  14. --                       O R E G A N O   S Y S T E M S                       --
  15. --                                                                           --
  16. --                            Design & Consulting                            --
  17. --                                                                           --
  18. -------------------------------------------------------------------------------
  19. --                                                                           --
  20. --         Web:           http://www.oregano.at/                             --
  21. --                                                                           --
  22. --         Contact:       mc8051@oregano.at                                  --
  23. --                                                                           --
  24. -------------------------------------------------------------------------------
  25. --                                                                           --
  26. --  MC8051 - VHDL 8051 Microcontroller IP Core                               --
  27. --  Copyright (C) 2001 OREGANO SYSTEMS                                       --
  28. --                                                                           --
  29. --  This library is free software; you can redistribute it and/or            --
  30. --  modify it under the terms of the GNU Lesser General Public               --
  31. --  License as published by the Free Software Foundation; either             --
  32. --  version 2.1 of the License, or (at your option) any later version.       --
  33. --                                                                           --
  34. --  This library is distributed in the hope that it will be useful,          --
  35. --  but WITHOUT ANY WARRANTY; without even the implied warranty of           --
  36. --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        --
  37. --  Lesser General Public License for more details.                          --
  38. --                                                                           --
  39. --  Full details of the license can be found in the file LGPL.TXT.           --
  40. --                                                                           --
  41. --  You should have received a copy of the GNU Lesser General Public         --
  42. --  License along with this library; if not, write to the Free Software      --
  43. --  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  --
  44. --                                                                           --
  45. -------------------------------------------------------------------------------
  46. --
  47. --
  48. --         Author:                 Helmut Mayrhofer
  49. --
  50. --         Filename:               mc8051_top_struc.vhd
  51. --
  52. --         Date of Creation:       Mon Aug  9 12:14:48 1999
  53. --
  54. --         Version:                $Revision: 1.7 $
  55. --
  56. --         Date of Latest Version: $Date: 2002/01/07 12:17:45 $
  57. --
  58. --
  59. --         Description: Connect the mc8051 core to its instruction and data
  60. --                      memories.
  61. --
  62. --
  63. --
  64. --
  65. -------------------------------------------------------------------------------
  66. architecture struc of mc8051_top is
  67.     
  68.   signal s_rom_adr:      std_logic_vector(15 downto 0);  -- Programmcounter =
  69.                                                          -- ROM-adress
  70.   signal s_rom_data:     std_logic_vector(7 downto 0);   -- data input from ROM
  71.   signal s_ram_data_out: std_logic_vector(7 downto 0);   -- data output to
  72.                                                          -- internal RAM
  73.   signal s_ram_data_in:  std_logic_vector(7 downto 0);   -- data input from
  74.                                                          -- internal RAM
  75.   signal s_ram_adr:      std_logic_vector(6 downto 0);   -- internal RAM-adress
  76.   signal s_ram_wr:       std_logic;                      -- read (0)/write (1)
  77.                                                          -- internal RAM
  78.   signal s_ram_en:       std_logic;                      -- RAM-block enable
  79.   signal s_ramx_data_out: std_logic_vector(7 downto 0);  -- data output to
  80.                                                          -- ext. RAM
  81.   signal s_ramx_data_in:  std_logic_vector(7 downto 0);  -- data input from
  82.                                                          -- ext. RAM
  83.   signal s_ramx_adr:      std_logic_vector(15 downto 0); -- ext. RAM-adress
  84.   signal s_ramx_wr:       std_logic;                     -- read (0)/write (1)
  85.                                                          -- ext. RAM
  86. begin                 -- architecture structural
  87.   
  88.   i_mc8051_core : mc8051_core
  89.     port map(clk         => clk,
  90.              reset       => reset,
  91.              rom_data_i  => s_rom_data,
  92.              ram_data_i  => s_ram_data_out,
  93.              int0_i      => int0_i,
  94.              int1_i      => int1_i,
  95.              all_t0_i    => all_t0_i,
  96.              all_t1_i    => all_t1_i,
  97.              all_rxd_i   => all_rxd_i,
  98.              p0_i        => p0_i,
  99.              p1_i        => p1_i,
  100.              p2_i        => p2_i,
  101.              p3_i        => p3_i,
  102.              p0_o        => p0_o,
  103.              p1_o        => p1_o,
  104.              p2_o        => p2_o,
  105.              p3_o        => p3_o, 
  106.              all_rxd_o   => all_rxd_o,
  107.              all_txd_o   => all_txd_o,
  108.              all_rxdwr_o => all_rxdwr_o,
  109.              rom_adr_o   => s_rom_adr,
  110.              ram_data_o  => s_ram_data_in,
  111.              ram_adr_o   => s_ram_adr,
  112.              ram_wr_o    => s_ram_wr,
  113.              ram_en_o    => s_ram_en,
  114.              datax_i     => s_ramx_data_in,
  115.              datax_o     => s_ramx_data_out,
  116.              adrx_o      => s_ramx_adr,
  117.              wrx_o       => s_ramx_wr);
  118.  
  119.     
  120.   -----------------------------------------------------------------------------
  121.   -- Hook up the general purpose 128x8 synchronous on-chip RAM. 
  122.   i_mc8051_ram : mc8051_ram
  123.     port map (clk          => clk,
  124.       reset        => reset,
  125.       ram_adr_i    => s_ram_adr,
  126.               ram_data_i   => s_ram_data_in,
  127.               ram_wr_i     => s_ram_wr,
  128.               ram_en_i     => s_ram_en,
  129.               ram_data_o   => s_ram_data_out);
  130.   -- THIS RAM IS A MUST HAVE!!
  131.   -----------------------------------------------------------------------------
  132.   -----------------------------------------------------------------------------
  133.   -- Hook up the (up to) 64kx8 synchronous on-chip ROM.
  134.   i_mc8051_rom : mc8051_rom
  135.     port map (clk          => clk,
  136.       reset        => reset,
  137.       rom_adr_i    => s_rom_adr,
  138.               rom_data_o   => s_rom_data);
  139.   -- THE ROM OF COURSE IS A MUST HAVE, ALTHOUGH THE SIZE CAN BE SMALLER!!
  140.   -----------------------------------------------------------------------------
  141.   
  142.     
  143.   -----------------------------------------------------------------------------
  144.   -- Hook up the (up to) 64kx8 synchronous RAM.
  145.   i_mc8051_ramx : mc8051_ramx
  146.     port map (clk          => clk,
  147.       reset        => reset,
  148.       ram_adr_i    => s_ramx_adr,
  149.               ram_data_i   => s_ramx_data_out,
  150.               ram_wr_i     => s_ramx_wr,
  151.               ram_data_o   => s_ramx_data_in);
  152.   -- THIS RAM (IF USED) CAN BE ON OR OFF CHIP, THE SIZE IS ARBITRARY.
  153.   -----------------------------------------------------------------------------
  154.   
  155. end struc;