Advertisement
alex1232222

Untitled

Dec 12th, 2020
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.59 KB | None | 0 0
  1. LIBRARY ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4. use ieee.std_logic_unsigned.all;
  5. Entity Tester is
  6. Port (
  7.     r_CPU_cs        :OUT    std_logic;
  8.     r_CPU_RAM_data_in   :OUT    std_logic_vector (0 to 63);
  9.     r_CPU_RAM_address   :OUT    std_logic_vector (0 to 15);
  10.     r_output        :IN std_logic_vector (0 to 2);
  11.     r_ready         :OUT    std_logic; -- 0 ничё не меняется
  12.     r_request       :OUT    std_logic;
  13.     clk         :OUT    std_logic;
  14.     r_address_DMA_in        :OUT    std_logic_vector (0 to 15);
  15.     r_reset         :OUT    std_logic);
  16.  
  17. END Tester;
  18.  
  19. Architecture Test of Tester IS
  20. CONSTANT second     : TIME := 10 ns;
  21. CONSTANT second_100     : TIME := 1000 ns;
  22. CONSTANT second_3   : TIME := 30 ns;
  23. CONSTANT second_2   : TIME := 20 ns;
  24. CONSTANT second_10  : TIME := 100 ns;
  25. Begin
  26.  
  27. synchronizer : PROCESS --тактовая
  28. BEGIN
  29.     clk <= '0';
  30.     WAIT FOR second;
  31.     clk <= '1';
  32.     WAIT FOR second;
  33. END PROCESS;
  34.  
  35. work:
  36. Process
  37. Begin
  38. wait for second;
  39. r_ready <= '0';
  40. r_request <= '0';
  41. r_reset<= '1';
  42. wait for second_2;
  43. r_reset <= '0';
  44. wait for second_2;
  45. r_CPU_cs <= '0';
  46. wait for second_2;
  47. r_CPU_RAM_address <= x"0064";
  48. r_CPU_RAM_data_in <= x"000F01A7006800FA";
  49. wait for second_2;
  50. r_CPU_RAM_address <= x"00FA";
  51. r_CPU_RAM_data_in <= x"012C01F400400000";
  52. wait for second_2; 
  53. r_CPU_cs <= '1';
  54. r_CPU_RAM_address <= x"0000";
  55. r_CPU_RAM_data_in <= x"0000000000000000";
  56. wait for second_2;
  57. r_request <= '1';
  58. r_address_DMA_in    <= x"0064";
  59. wait for second_2;
  60. r_request <= '0';
  61. r_address_DMA_in <= x"0000";
  62. wait for second_10;
  63. r_ready <= '1';
  64. wait for second_10;
  65. r_ready<= '0';
  66. wait for second_100;
  67. end process;
  68.  
  69. end Test;
  70.  
  71.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement