Advertisement
kernel_memory_dump

Untitled

Dec 16th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.21 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 10:30:01 12/18/2013
  6. -- Design Name:
  7. -- Module Name: LCD_BANNER - 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_arith.all;
  23. use ieee.std_logic_unsigned.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 LCD_BANNER is
  35. Port ( iREADY : in STD_LOGIC;
  36. iCLK : in STD_LOGIC;
  37. inRST : in STD_LOGIC;
  38. oEN : out STD_LOGIC;
  39. oDATA : out STD_LOGIC_VECTOR (7 downto 0));
  40. end LCD_BANNER;
  41.  
  42. architecture Behavioral of LCD_BANNER is
  43. type tSTATES is (sCLEAR, sWAIT_LCD, sSEND_CHAR, sNEXT_CHAR, sWAIT_HS);
  44. signal sSTATE : tSTATES :=sCLEAR;
  45.  
  46. constant cBR_CHAR:std_logic_vector(4 downto 0) :="11111";
  47. constant cBR_HSEC:std_logic_vector(16 downto 0) :="10110111000110110";
  48.  
  49. constant cK : std_logic_vector(7 downto 0):="01001011";
  50. constant ci : std_logic_vector(7 downto 0):="01101001";
  51. constant cm : std_logic_vector(7 downto 0):="01101101";
  52. constant cN : std_logic_vector(7 downto 0):="01001110";
  53. constant co : std_logic_vector(7 downto 0):="01101111";
  54. constant cv : std_logic_vector(7 downto 0):="01110110";
  55. constant ca : std_logic_vector(7 downto 0):="01100001";
  56. constant ck : std_logic_vector(7 downto 0):="01101011";
  57. constant cCLEAR : std_logic_vector(7 downto 0):="00011011";
  58. constant cBLANK : std_logic_vector(7 downto 0):="00100000";
  59.  
  60. signal sDAT : std_logic_vector(7 downto 0) :="00000000";
  61. signal sEN : std_logic :='0';
  62.  
  63. signal sSW : std_logic_vector(7 downto 0):="00000000";
  64. signal sHSEC_CNT : std_logic_vector(16 downto 0):="00000000000000000";
  65. signal sHSEC_EN : std_logic:='0';
  66. signal sCHAR_CNT : std_logic_vector(4 downto 0):="00000";
  67. signal sCHAR_EN : std_logic:='0';
  68.  
  69. signal sADRESS : integer RANGE 0 to 31;
  70. type tMEMORY is array (0 to 31) of std_logic_vector(7 downto 0);
  71. signal sRAM : tMEMORY;
  72. begin
  73. sADRESS <= CONV_INTEGER(sCHAR_CNT);
  74. process(iCLK,inRST) begin
  75. if (inRST= '0') then
  76. sHSEC_CNT <= (others=>'0');
  77. sHSEC_EN <= '0';
  78.  
  79. sRAM(0)<=cK;
  80. sRAM(1)<=ci;
  81. sRAM(2)<=cm;
  82. sRAM(3)<=cBLANK;
  83. sRAM(4)<=cBLANK;
  84. sRAM(5)<=cBLANK;
  85. sRAM(6)<=cBLANK;
  86. sRAM(7)<=cBLANK;
  87. sRAM(8)<=cBLANK;
  88. sRAM(9)<=cBLANK;
  89. sRAM(10)<=cBLANK;
  90. sRAM(11)<=cBLANK;
  91. sRAM(12)<=cBLANK;
  92. sRAM(13)<=cBLANK;
  93. sRAM(14)<=cBLANK;
  94. sRAM(15)<=sSW;
  95. sRAM(16)<=cN;
  96. sRAM(17)<=co;
  97. sRAM(18)<=cv;
  98. sRAM(19)<=ca;
  99. sRAM(20)<=ck;
  100. sRAM(21)<=cBLANK;
  101. sRAM(22)<=cBLANK;
  102. sRAM(23)<=cBLANK;
  103. sRAM(24)<=cBLANK;
  104. sRAM(25)<=cBLANK;
  105. sRAM(26)<=cBLANK;
  106. sRAM(27)<=cBLANK;
  107. sRAM(28)<=cBLANK;
  108. sRAM(29)<=cBLANK;
  109. sRAM(30)<=cBLANK;
  110. sRAM(31)<=cBLANK;
  111. elsif (iCLK'event and iCLK ='1') then
  112. if(sCHAR_EN='1') then
  113. sRAM(15)<=sSW;
  114. if (sHSEC_CNT = cBR_HSEC) then
  115. sHSEC_EN <= '1';
  116. sHSEC_CNT <= (others=>'0');
  117. sRAM <=sRAM(1 to 14)&sRAM(0)&sRAM(15)&sRAM(17 to 30)&sRAM(16)&sRAM(31);
  118. else
  119. sHSEC_CNT <= sHSEC_CNT + 1;
  120. sHSEC_EN <='0';
  121. end if;
  122.  
  123. end if;
  124. end if;
  125. end process;
  126.  
  127. --dozvola sledeceg stanja
  128. process (iCLK, inRST) begin
  129.  
  130. if (inRST= '0') then
  131. sCHAR_CNT <= (others=>'0');
  132. sCHAR_EN <= '0';
  133. elsif (iCLK'event and iCLK ='1') then
  134. if(sSTATE= sNEXT_CHAR) then
  135. if (sCHAR_CNT = cBR_CHAR) then
  136. sCHAR_EN <= '1';
  137. sCHAR_CNT <= (others=>'0');
  138. else
  139. sCHAR_CNT<= sCHAR_CNT + 1;
  140. sCHAR_EN <='0';
  141. end if;
  142.  
  143. end if;
  144. end if;
  145. end process;
  146.  
  147. --stanja
  148.  
  149. process (iCLK, inRST) begin
  150.  
  151. if (inRST= '0') then
  152. sSTATE <= sCLEAR;
  153. sEN <= '0';
  154. sDAT <= "00011011";
  155. elsif (iCLK'event and iCLK ='1') then
  156.  
  157. case(sSTATE) is
  158.  
  159. when sCLEAR =>
  160. if (iREADY='0') then
  161. sSTATE <= sCLEAR;
  162. else
  163. sDAT <= cCLEAR;
  164. sSTATE <= sWAIT_LCD;
  165. end if;
  166. when sWAIT_LCD =>
  167. if(iREADY='1') then
  168. sEN <= '1';
  169. sSTATE <= sSEND_CHAR;
  170. else
  171. sEN <= '0';
  172. sSTATE <= sWAIT_LCD;
  173. end if;
  174. when sSEND_CHAR =>
  175. if(iREADY='1') then
  176. sDAT <= sRAM(sADRESS);
  177. sSTATE <= sSEND_CHAR;
  178. else
  179. sEN<='0';
  180. sSTATE <= sNEXT_CHAR;
  181. end if;
  182. when sNEXT_CHAR =>
  183. if(sCHAR_CNT = cBR_CHAR) then
  184. sSTATE <= sWAIT_HS;
  185. else
  186. sSTATE <= sWAIT_LCD;
  187. end if;
  188. when sWAIT_HS =>
  189. if(sHSEC_EN='1') then
  190. sSTATE <= sCLEAR;
  191. else
  192. sSTATE <= sWAIT_HS;
  193. end if;
  194. end case;
  195. end if;
  196. end process;
  197.  
  198. oDAT <= cCLEAR when sSTATE = sCLEAR else
  199. sRAM(sADRESS) when sSTATE = sSEND_CHAR else
  200. "00000000";
  201. oEn<=sEN;
  202. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement