Advertisement
lasthunter657

Untitled

Dec 2nd, 2021
251
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LIBRARY IEEE;
  2. USE IEEE.STD_LOGIC_1164.ALL;
  3. USE IEEE.NUMERIC_STD.ALL;
  4. USE work.logic_array_type.ALL;
  5. PACKAGE logic_array_type IS
  6.     CONSTANT number_of_PE : INTEGER := 16;
  7.     CONSTANT data_width : INTEGER := 8;
  8.     TYPE vector_array IS ARRAY (NATURAL RANGE <>) OF STD_LOGIC_VECTOR(data_width - 1 DOWNTO 0);--to allow use of signal as numberin(i) to connect to the ith generated instanciation of entity/component.
  9.     TYPE vector_array2 IS ARRAY (NATURAL RANGE <>) OF STD_LOGIC_VECTOR(data_width DOWNTO 0);
  10.  
  11. END PACKAGE logic_array_type;
  12.  
  13. ENTITY MEengine IS
  14.     GENERIC (
  15.         number_of_PE : INTEGER := 16;
  16.         data_width : INTEGER := 8;
  17.         y : INTEGER := 80;
  18.  
  19.         w : INTEGER := 8);
  20.  
  21.     PORT (
  22.         eni, reset, clk : IN STD_LOGIC;
  23.         mv : OUT STD_LOGIC_VECTOR (y - 1 DOWNTO 0)
  24.     );
  25. END MEengine;
  26.  
  27. ARCHITECTURE Behavioral OF MEengine IS
  28.     COMPONENT pe IS
  29.         GENERIC (w : INTEGER := 8);
  30.         PORT (
  31.             numberin : IN STD_LOGIC_VECTOR (w - 1 DOWNTO 0);
  32.             numberout, number : IN STD_LOGIC_VECTOR (w - 1 DOWNTO 0);
  33.             clk, eni, reset : IN STD_LOGIC;
  34.             Dlat : OUT STD_LOGIC_VECTOR (w - 1 DOWNTO 0));
  35.     END COMPONENT pe;
  36.  
  37.     --COMPONENT specification--
  38.  
  39.     FOR ALL : pe USE ENTITY work.pe(behavioral);
  40.  
  41.     --internal signals-------
  42.  
  43.     SIGNAL numberin : vector_array(data_width - 1 DOWNTO 0);
  44.     SIGNAL numberout : vector_array (data_width - 1 DOWNTO 0);
  45.     SIGNAL number : vector_array (data_width - 1 DOWNTO 0);
  46.  
  47. BEGIN
  48.     -----------create the processing elements---------
  49.     gen_pro_ele : FOR i IN 0 TO number_of_PE - 1 GENERATE
  50.         Processing_Element : pe PORT MAP(
  51.             numberin => numberin(i),
  52.             numberout => numberout(i),
  53.             number => number(i),
  54.             clk => clk,
  55.             reset => reset,
  56.             eni => eni);
  57.     END GENERATE gen_pro_ele;
  58. END behavioral;
Advertisement
RAW Paste Data Copied
Advertisement