Guest User

Untitled

a guest
May 16th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.09 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:    18:13:05 12/10/2011
  6. -- Design Name:
  7. -- Module Name:    instr_rom - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20. library IEEE;
  21. use IEEE.STD_LOGIC_1164.ALL;
  22. use ieee.std_logic_unsigned.all;
  23. use ieee.std_logic_arith.all;
  24.  
  25. -- Uncomment the following library declaration if using
  26. -- arithmetic functions with Signed or Unsigned values
  27. --use IEEE.NUMERIC_STD.ALL;
  28.  
  29. -- Uncomment the following library declaration if instantiating
  30. -- any Xilinx primitives in this code.
  31. --library UNISIM;
  32. --use UNISIM.VComponents.all;
  33.  
  34. entity instr_rom is
  35.     Generic (
  36.         pData_width : integer := 15;
  37.         pAddress_width : integer := 5;
  38.         pNO_Words : integer := 32);
  39.     Port ( iA : in  STD_LOGIC_VECTOR (paddress_width-1 downto 0);
  40.            oQ : out  STD_LOGIC_VECTOR (pdata_width-1 downto 0));
  41. end instr_rom;
  42.  
  43. architecture Behavioral of instr_rom is
  44.     type tRAM is array (0 to pno_words-1) of std_logic_vector (pdata_width-1 downto 0);
  45.     signal sRAM: tRAM :=("000110001001000","000001000001000","001000000000000","000110001001000",
  46.                                 "000001000001000","001000000000000","001000000000000","000110001001000",
  47.                                 "000001000001000","001000000000000","001000000000000","001000000000000",
  48.                                 "000110001001000","000001000001000","001000000000000","001000000000000",
  49.                                 "001000000000000","001000000000000","110000000000000","000000000000000",
  50.                                 "000000000000000","000000000000000","000000000000000","000000000000000",
  51.                                 "000000000000000","000000000000000","000000000000000","000000000000000",
  52.                                 "000000000000000","000000000000000","000000000000000","000000000000000");
  53.     signal sAddress : integer range 0 to pno_words-1;
  54.     signal sData : std_logic_vector (14 downto 0);
  55.    
  56. begin
  57.     oQ <= sram(conv_integer(iA));
  58.  
  59. end Behavioral;
Add Comment
Please, Sign In to add comment