Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 03/20/2018 10:30:04 AM
  6. -- Design Name:
  7. -- Module Name: topLevel - 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.  
  21.  
  22. library IEEE;
  23. use IEEE.STD_LOGIC_1164.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 leaf cells in this code.
  31. --library UNISIM;
  32. --use UNISIM.VComponents.all;
  33.  
  34. entity topLevel is
  35. Port ( clk : in STD_LOGIC;
  36. rst : in STD_LOGIC;
  37. sw : in std_logic_vector(4 downto 0);
  38. hsync : out std_logic;
  39. vsync : out std_logic;
  40. R,G,B : out std_logic_vector(2 downto 0));
  41. end topLevel;
  42.  
  43. architecture Behavioral of topLevel is
  44. signal pixel_y,pixel_x : std_logic_vector (9 downto 0);
  45. signal wallOn : STD_LOGIC;
  46. signal wallRGB : std_logic_vector(2 downto 0);
  47. signal x_left : std_logic_vector(9 downto 0);
  48. signal x_right : std_logic_vector(9 downto 0);
  49. signal y_bottom : std_logic_vector(9 downto 0);
  50. signal y_top : std_logic_vector(9 downto 0);
  51. signal p_tick: std_logic;
  52. begin
  53.  
  54. sync : entity work.vga_sync port map(
  55. clk => clk,
  56. reset => rst,
  57. hsync => hsync,
  58. vsync => vsync,
  59. p_tick => p_tick,
  60. pixel_x=>pixel_x,
  61. pixel_y=>pixel_y
  62. );
  63.  
  64. x_left <= "0000100000" when sw(1 downto 0) = "00" else "1001011101" when sw(1 downto 0) = "01"
  65. else "0000000000";
  66. x_right <= "0000100011" when sw(1 downto 0) = "00" else "1001100000" when sw(1 downto 0) = "01"
  67. else "1001111111";
  68.  
  69. --buildDaWall : entity work.wallGen port map(
  70. -- pixel_x=>pixel_x,
  71. -- pixel_y=>pixel_y,
  72. -- x_left=>x_left,
  73. -- x_right=> x_right,
  74. ---- y_top => y_top,
  75. ---- y_bottom => y_bottom,
  76. -- wallOn=>wallOn,
  77. -- wallRGB=>wallRGB
  78. --);
  79.  
  80. process(clk)
  81. begin
  82. if(rising_edge(clk)) then
  83. if( p_tick= '1') then
  84. R <= "111";
  85. G<= "000";
  86. B<= "000";
  87. end if;
  88. end if;
  89. end process;
  90.  
  91.  
  92. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement