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

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_control_struc.vhd
  51. --
  52. --         Date of Creation:       Mon Aug  9 12:14:48 1999
  53. --
  54. --         Version:                $Revision: 1.5 $
  55. --
  56. --         Date of Latest Version: $Date: 2002/01/07 12:17:45 $
  57. --
  58. --
  59. --         Description: Connects the units control_fsm and control_mem. This
  60. --                      unit manages the whole microcontroller core.
  61. --
  62. --
  63. --
  64. --
  65. -------------------------------------------------------------------------------
  66. architecture struc of mc8051_control is
  67.   -- signals connecting the fsm and the mem unit
  68.   
  69.   signal s_pc_inc_en  : std_logic_vector (3 downto 0);
  70.   signal s_regs_wr_en : std_logic_vector (2 downto 0);
  71.   signal s_data_mux   : std_logic_vector (3 downto 0);
  72.   signal s_bdata_mux  : std_logic_vector (3 downto 0);
  73.   signal s_adr_mux    : std_logic_vector (3 downto 0);
  74.   signal s_adrx_mux   : std_logic_vector (1 downto 0);
  75.   signal s_wrx_mux    : std_logic;
  76.   signal s_help_en    : std_logic_vector (3 downto 0);
  77.   signal s_help16_en  : std_logic_vector (1 downto 0);
  78.   signal s_helpb_en   : std_logic;
  79.   signal s_intpre2_d  : std_logic;
  80.   signal s_intpre2_en : std_logic;
  81.   signal s_intlow_d   : std_logic;
  82.   signal s_intlow_en  : std_logic;
  83.   signal s_inthigh_d  : std_logic;
  84.   signal s_inthigh_en : std_logic;
  85.   signal s_nextstate  : t_state;   -- enable signal for state
  86.   signal state        : t_state;   -- actual state 
  87.   signal s_command    : std_logic_vector (7 downto 0);
  88.   signal s_help       : std_logic_vector(7 downto 0);  -- general help-register
  89.   signal s_bit_data   : std_logic;
  90.   signal s_intpre     : std_logic;   -- an interrupt must start 
  91.   signal s_intpre2    : std_logic;   -- prepare for interrupt 
  92.   signal s_inthigh    : std_logic;   -- high priority int is running 
  93.   signal s_intlow     : std_logic;   -- low priority int is running 
  94.   signal s_ri         : std_logic;
  95.   signal s_ti         : std_logic;
  96.   signal s_tf1        : std_logic;
  97.   signal s_tf0        : std_logic;
  98.   signal s_ie1        : std_logic;
  99.   signal s_it1        : std_logic;
  100.   signal s_ie0        : std_logic;
  101.   signal s_it0        : std_logic;
  102.   signal ie           : std_logic_vector(7 downto 0);
  103.   signal ip           : std_logic_vector(7 downto 0);
  104.   signal psw          : std_logic_vector(7 downto 0);
  105.   signal acc          : std_logic_vector(7 downto 0);
  106.     
  107. begin                 -- architecture structural
  108.   acc_o <= acc;
  109.     
  110.   i_control_fsm : control_fsm
  111.     port map(state_i    => state,
  112.              help_i     => s_help,
  113.              bit_data_i => s_bit_data,
  114.              aludata_i  => aludata_i,
  115.              command_i  => s_command,
  116.              inthigh_i  => s_inthigh,
  117.              intlow_i   => s_intlow,
  118.              intpre_i   => s_intpre,
  119.              intpre2_i  => s_intpre2,
  120.              ti_i       => s_ti,
  121.              ri_i       => s_ri,
  122.              it0_i      => s_it0,
  123.              ie0_i      => s_ie0,
  124.              it1_i      => s_it1,
  125.              ie1_i      => s_ie1,
  126.              tf0_i      => s_tf0,
  127.              tf1_i      => s_tf1,
  128.              acc        => acc,
  129.              psw        => psw,
  130.              ie         => ie,
  131.              ip         => ip,
  132.              alu_cmd_o    => alu_cmd_o,
  133.              pc_inc_en_o  => s_pc_inc_en,
  134.              nextstate_o  => s_nextstate,
  135.              adr_mux_o    => s_adr_mux,
  136.              adrx_mux_o   => s_adrx_mux,
  137.              wrx_mux_o    => s_wrx_mux,
  138.              data_mux_o   => s_data_mux,
  139.              bdata_mux_o  => s_bdata_mux,
  140.              regs_wr_en_o => s_regs_wr_en,
  141.              help_en_o    => s_help_en,
  142.              help16_en_o  => s_help16_en,
  143.              helpb_en_o   => s_helpb_en,
  144.              inthigh_en_o => s_inthigh_en,
  145.              intlow_en_o  => s_intlow_en,
  146.              intpre2_en_o => s_intpre2_en,
  147.              inthigh_d_o  => s_inthigh_d,
  148.              intlow_d_o   => s_intlow_d,
  149.              intpre2_d_o  => s_intpre2_d); 
  150.                    
  151.                    
  152.   i_control_mem : control_mem
  153.     port map(pc_o           => pc_o,
  154.              rom_data_i     => rom_data_i,
  155.              ram_data_o     => ram_data_o,
  156.              ram_data_i     => ram_data_i,
  157.              ram_adr_o      => ram_adr_o,
  158.              reg_data_o     => reg_data_o,
  159.              ram_wr_o       => ram_wr_o,
  160.              cy_o           => cy_o,
  161.              ov_o           => ov_o,
  162.              ram_en_o       => ram_en_o,
  163.              aludata_i      => aludata_i,
  164.              aludatb_i      => aludatb_i,
  165.              acc_o          => acc,
  166.              new_cy_i       => new_cy_i,
  167.              new_ov_i       => new_ov_i,
  168.              reset          => reset,
  169.              clk            => clk,
  170.              int0_i         => int0_i,
  171.              int1_i         => int1_i,
  172.              p0_i           => p0_i,
  173.              p1_i           => p1_i,
  174.              p2_i           => p2_i,
  175.              p3_i           => p3_i,
  176.              p0_o           => p0_o,
  177.              p1_o           => p1_o,
  178.              p2_o           => p2_o,
  179.              p3_o           => p3_o,
  180.              all_trans_o    => all_trans_o,
  181.              all_scon_o     => all_scon_o,
  182.              all_sbuf_o     => all_sbuf_o,
  183.              all_smod_o     => all_smod_o,
  184.              all_scon_i     => all_scon_i,
  185.              all_sbuf_i     => all_sbuf_i,
  186.              all_tcon_tr0_o => all_tcon_tr0_o,
  187.              all_tcon_tr1_o => all_tcon_tr1_o,
  188.              all_tmod_o     => all_tmod_o,
  189.              all_reload_o   => all_reload_o,
  190.              all_wt_o       => all_wt_o,
  191.              all_wt_en_o    => all_wt_en_o,
  192.              all_tf0_i      => all_tf0_i,
  193.              all_tf1_i      => all_tf1_i,
  194.              all_tl0_i      => all_tl0_i,
  195.              all_tl1_i      => all_tl1_i,
  196.              all_th0_i      => all_th0_i,
  197.              all_th1_i      => all_th1_i,
  198.              state_o    => state,
  199.              help_o     => s_help,
  200.              bit_data_o => s_bit_data,
  201.              command_o  => s_command,
  202.              inthigh_o  => s_inthigh,
  203.              intlow_o   => s_intlow,
  204.              intpre_o   => s_intpre,
  205.              intpre2_o  => s_intpre2,
  206.              ti_o       => s_ti,
  207.              ri_o       => s_ri,
  208.              it0_o      => s_it0,
  209.              ie0_o      => s_ie0,
  210.              it1_o      => s_it1,
  211.              ie1_o      => s_ie1,
  212.              tf0_o      => s_tf0,
  213.              tf1_o      => s_tf1,
  214.              psw_o      => psw,
  215.              ie_o       => ie,
  216.              ip_o       => ip,
  217.              adrx_o     => adrx_o,
  218.              datax_o    => datax_o,
  219.              wrx_o      => wrx_o,
  220.              datax_i      => datax_i,
  221.              pc_inc_en_i  => s_pc_inc_en,
  222.              nextstate_i  => s_nextstate,
  223.              adr_mux_i    => s_adr_mux,
  224.              adrx_mux_i   => s_adrx_mux,
  225.              wrx_mux_i    => s_wrx_mux,
  226.              data_mux_i   => s_data_mux,
  227.              bdata_mux_i  => s_bdata_mux,
  228.              regs_wr_en_i => s_regs_wr_en,
  229.              help_en_i    => s_help_en,
  230.              help16_en_i  => s_help16_en,
  231.              helpb_en_i   => s_helpb_en,
  232.              inthigh_en_i => s_inthigh_en,
  233.              intlow_en_i  => s_intlow_en,
  234.              intpre2_en_i => s_intpre2_en,
  235.              inthigh_d_i  => s_inthigh_d,
  236.              intlow_d_i   => s_intlow_d,
  237.              intpre2_d_i  => s_intpre2_d); 
  238.       
  239. end struc;