mc8051_alu_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:                 Roland H鰈ler
  49. --
  50. --         Filename:               mc8051_alu_struc.vhd
  51. --
  52. --         Date of Creation:       Mon Aug  9 12:14:48 1999
  53. --
  54. --         Version:                $Revision: 1.8 $
  55. --
  56. --         Date of Latest Version: $Date: 2002/01/07 12:17:44 $
  57. --
  58. --
  59. --         Description: Connects the units alumux, alucore, addsub_core,
  60. --                      comb_mltplr, comb_divider, and dcml_adjust together.
  61. --                      The whole design is made up of combinational logic.
  62. --
  63. --
  64. --
  65. --
  66. -------------------------------------------------------------------------------
  67. architecture struc of mc8051_alu is
  68.   signal s_alu_result   : std_logic_vector(DWIDTH-1 downto 0);
  69.   signal s_alu_new_cy   : std_logic_vector((DWIDTH-1)/4 downto 0);
  70.   signal s_alu_op_a     : std_logic_vector(DWIDTH-1 downto 0);
  71.   signal s_alu_op_b     : std_logic_vector(DWIDTH-1 downto 0);
  72.   signal s_alu_cmd      : std_logic_vector(3 downto 0);
  73.   signal s_dvdnd        : std_logic_vector(DWIDTH-1 downto 0);
  74.   signal s_dvsor        : std_logic_vector(DWIDTH-1 downto 0);
  75.   signal s_qutnt        : std_logic_vector(DWIDTH-1 downto 0);
  76.   signal s_rmndr        : std_logic_vector(DWIDTH-1 downto 0);
  77.   signal s_mltplcnd     : std_logic_vector(DWIDTH-1 downto 0);
  78.   signal s_mltplctr     : std_logic_vector(DWIDTH-1 downto 0);
  79.   signal s_product      : std_logic_vector((DWIDTH*2)-1 downto 0);
  80.   signal s_dcml_data    : std_logic_vector(DWIDTH-1 downto 0);
  81.   signal s_dcml_rslt    : std_logic_vector(DWIDTH-1 downto 0);
  82.   signal s_dcml_cy      : std_logic;
  83.   signal s_addsub_rslt  : std_logic_vector(DWIDTH-1 downto 0);
  84.   signal s_addsub_newcy : std_logic_vector((DWIDTH-1)/4 downto 0);
  85.   signal s_addsub_ov    : std_logic;
  86.   signal s_addsub_cy    : std_logic;
  87.   signal s_addsub       : std_logic;
  88.   signal s_addsub_opa   : std_logic_vector(DWIDTH-1 downto 0);
  89.   signal s_addsub_opb   : std_logic_vector(DWIDTH-1 downto 0);
  90. begin                 -- architecture structural
  91.   i_alumux : alumux
  92.     generic map (
  93.       DWIDTH => DWIDTH)
  94.     port map (
  95.       -- Primary I/Os of the ALU unit.
  96.       rom_data_i    => rom_data_i,
  97.       ram_data_i    => ram_data_i,
  98.       acc_i         => acc_i,
  99.       cmd_i         => cmd_i,
  100.       cy_i          => cy_i,
  101.       ov_i          => ov_i,
  102.       cy_o          => new_cy_o,
  103.       ov_o          => new_ov_o,
  104.       result_a_o    => result_a_o,
  105.       result_b_o    => result_b_o,
  106.       -- I/Os connecting the submodules.
  107.       result_i      => s_alu_result,
  108.       new_cy_i      => s_alu_new_cy,
  109.       addsub_rslt_i => s_addsub_rslt,
  110.       addsub_cy_i   => s_addsub_newcy,
  111.       addsub_ov_i   => s_addsub_ov,
  112.       op_a_o        => s_alu_op_a,
  113.       op_b_o        => s_alu_op_b,
  114.       alu_cmd_o     => s_alu_cmd,
  115.       opa_o         => s_addsub_opa,
  116.       opb_o         => s_addsub_opb,
  117.       addsub_o      => s_addsub,
  118.       addsub_cy_o   => s_addsub_cy,
  119.       dvdnd_o       => s_dvdnd,
  120.       dvsor_o       => s_dvsor,
  121.       qutnt_i       => s_qutnt,
  122.       rmndr_i       => s_rmndr,
  123.       mltplcnd_o    => s_mltplcnd,
  124.       mltplctr_o    => s_mltplctr,
  125.       product_i     => s_product,
  126.       dcml_data_o   => s_dcml_data,
  127.       dcml_data_i   => s_dcml_rslt,
  128.       dcml_cy_i     => s_dcml_cy);
  129.   i_alucore : alucore
  130.     generic map (
  131.       DWIDTH    => DWIDTH)
  132.     port map (
  133.       op_a_i    => s_alu_op_a,
  134.       op_b_i    => s_alu_op_b,
  135.       alu_cmd_i => s_alu_cmd,
  136.       cy_i      => cy_i,
  137.       cy_o      => s_alu_new_cy,
  138.       result_o  => s_alu_result);
  139.   i_addsub_core : addsub_core
  140.     generic map (DWIDTH => DWIDTH)
  141.     port map (opa_i    => s_addsub_opa,
  142.               opb_i    => s_addsub_opb,
  143.               addsub_i => s_addsub,
  144.               cy_i     => s_addsub_cy,
  145.               cy_o     => s_addsub_newcy,
  146.               ov_o     => s_addsub_ov,
  147.               rslt_o   => s_addsub_rslt);
  148.   gen_multiplier : if C_IMPL_MUL = 1 generate
  149.     i_comb_mltplr : comb_mltplr
  150.       generic map (
  151.         DWIDTH     => DWIDTH)
  152.       port map (
  153.         mltplcnd_i => s_mltplcnd,
  154.         mltplctr_i => s_mltplctr,
  155.         product_o  => s_product);
  156.   end generate gen_multiplier;
  157.   gen_divider  : if C_IMPL_DIV = 1 generate
  158.     i_comb_divider : comb_divider
  159.       generic map (
  160.         DWIDTH  => DWIDTH)
  161.       port map (
  162.         dvdnd_i => s_dvdnd,
  163.         dvsor_i => s_dvsor,
  164.         qutnt_o => s_qutnt,
  165.         rmndr_o => s_rmndr);
  166.   end generate gen_divider;
  167.   gen_dcml_adj  : if C_IMPL_DA = 1 generate
  168.     i_dcml_adjust : dcml_adjust
  169.       generic map (
  170.         DWIDTH => DWIDTH)
  171.       port map (
  172.         data_i => s_dcml_data,
  173.         cy_i   => cy_i,
  174.         data_o => s_dcml_rslt,
  175.         cy_o   => s_dcml_cy);
  176.   end generate gen_dcml_adj;
  177. end struc;