Advertisement
Device-Cheat

Untitled

Jul 2nd, 2020
1,850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.36 KB | None | 0 0
  1. ----------------------------------------------------------------------------------------
  2. --
  3. --                                      CounterUpDown
  4. --
  5. --                                Grzegorz Radomski
  6. --
  7. --                     Data rozpoczecia projektu:
  8. --                     Data ostatniej modyfikacji:
  9. --
  10. ----------------------------------------------------------------------------------------
  11.  
  12. library ieee;
  13. use ieee.std_logic_1164.all;
  14. use ieee.std_logic_arith.all;
  15. use ieee.std_logic_signed.all;
  16.  
  17. --use work.Types.all;
  18.  
  19.  
  20. ----------------------------------------------------------------------------------------
  21. --  Deklaracja interfejsu kontrolera ARCP dla 1 fazy (galezi falownika)
  22.  
  23. -- use work.Types.all;
  24.  
  25.  
  26. entity MemoryChip is
  27.  
  28.  port(Clock : in std_logic;       -- sygnal zegarowy
  29.  Reset      : in std_logic;       -- sygnal zerujacy
  30.  CS         : in std_logic;       -- sygnal wyboru ukladu
  31.  WR, RD : in std_logic;
  32.  Data : inout std_logic_vector(15 downto 0); -- sygnaly pelny pusty
  33.  Address : in integer range 0 to 15);
  34. end MemoryChip;
  35.  
  36. ----------------------------------------------------------------------------------------
  37.  
  38. architecture behavior of MemoryChip is
  39.  
  40. ----------------------------------------------------------------------------------------
  41. --  
  42. begin
  43. --  opis dzialania
  44.      
  45. ----------------------------------------------------------------------------------------
  46. -- Sterownik PWM
  47.  
  48. Mem_system: process
  49.  
  50.  type TMem is array(0 to 16) of std_logic_vector(15 downto 0);
  51.  variable Count       : std_logic_vector (15 downto 0); -- licznik
  52.  variable DataB       : std_logic_vector (15 downto 0); -- bufor
  53.  variable Mem : TMem;
  54. begin
  55.  wait until Clock='1';
  56.  
  57.  
  58. DataB:="ZZZZZZZZZZZZZZZZ";
  59.  if (Reset='0') then
  60.  
  61.      
  62.  
  63.  else -- Reset
  64.  
  65. -------------------------------------------------------------------------------------------------------------------
  66.    
  67.   -- Dekoder wyboru do zapisu/odczytu
  68.   if (CS='0') then
  69.    if (RD='0') then DataB := Mem(Address); end if;
  70.    if (WR='0') then Mem(Address) := Data; end if;      
  71.   end if; -- ((CS='0')
  72.  
  73.  
  74.  end if; -- Reset
  75.  
  76.   Data <= DataB;
  77.    
  78. end process Mem_system;
  79. ----------------------------------------------------------------------------------------
  80.  
  81. end behavior;
  82.  
  83. ----------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement