Advertisement
Guest User

Adress Decoder

a guest
Feb 9th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.all;
  3. use ieee.std_logic_arith.all;
  4. use ieee.std_logic_unsigned.all;
  5.  
  6. entity AddressDecoder is
  7. Port (
  8. Address : in Std_logic_vector(31 downto 0) ; -- address directly from 68k
  9.  
  10. -- outputs to activate rom,ram, sram, dram etc as per labs
  11.  
  12. OnChipRomSelect_H : out Std_Logic ;
  13. OnChipRamSelect_H : out Std_Logic ;
  14. DramSelect_H : out Std_logic ;
  15. DE2_512KSRamSelect_H : out Std_logic;
  16. IOSelect_H : out Std_logic;
  17. FlashSelect_H : out Std_logic;
  18. DMASelect_L : out Std_logic;
  19. GraphicsCS_L : out Std_logic
  20. );
  21. end ;
  22.  
  23.  
  24. architecture bhvr of AddressDecoder is
  25. Begin
  26. process(Address)
  27. begin
  28.  
  29. -- default values for all memory and IO Select Signals (default is NOT activated)
  30. -- override as required using if-endif statements based on range of addresses issued by 68k
  31.  
  32. OnChipRomSelect_H <= '0' ;
  33. OnChipRamSelect_H <= '0' ;
  34. DramSelect_H <= '0' ;
  35. DE2_512KSRamSelect_H <= '0';
  36. IOSelect_H <= '0' ;
  37. FlashSelect_H <= '0' ;
  38. DMASelect_L <= '1' ;
  39. GraphicsCS_L <= '1' ;
  40.  
  41. if(Address( 31 downto 15) = B"0000_0000_0000_0000_0") then -- ON CHIP ROM address hex 0000 0000 - 0000 7FFF 32k full decoding
  42. OnChipRomSelect_H <= '1' ; -- DO NOT CHANGE - debugger expects rom at this address
  43. end if ;
  44.  
  45. if(Address( 31 downto 14) = B"0000_0000_0000_0001_00") then -- address hex 0001 0000 - 0001 3FFF 16k full decoding
  46. OnChipRamSelect_H <= '1' ; -- DO NOT CHANGE - debugger expects Ram at this address
  47. end if ;
  48.  
  49. if(Address(31 downto 16) = B"0000_0000_0100_0000") then -- address hex 0040 0000 - 0040 FFFF Partial decoding
  50. IOSelect_H <= '1' ; -- DO NOT CHANGE - debugger expects IO at this address
  51. end if ;
  52.  
  53. if(Address(31 downto 19) = B"0000_0000_1000_0") then -- Addross hex 0080 000 - 0087 FFFF Partial Decoding
  54. DE2_512KSRamSelect_H <= '1';
  55. end if;
  56.  
  57. if(Address(31 downto 8) = B"0000_0000_0001_0") then
  58. if(Address(8) = '0') then
  59. FlashSelect_H <= '1';
  60. end if;
  61. end if;
  62.  
  63. -- add other decoder signals here for Sram, Dram, Flash, Graphics etc to fix their range of addresses (see relavent Lab/Assignment)
  64. -- SRam (i.e. DE2_512KSramSelect_H) should be active high when 68k accesses address in range 00800000 - 0087FFFF
  65.  
  66. end process ;
  67. END ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement