Guest User

Untitled

a guest
Mar 28th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.48 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.all;
  3. USE ieee.numeric_std.ALL;
  4.  
  5. use work.my_package.all;
  6.  
  7. entity landmark_1 is
  8.   generic
  9.         (data_length :integer := 8;
  10.         address_length:integer:=3 );
  11.         port ( clk:in std_logic;
  12.         index: in unsigned(address_length-1 downto 0);
  13.         vin:in std_logic;
  14.         rst:in std_logic;
  15.         flag: in std_logic;
  16.         din: in signed(data_length -1 downto 0);
  17.         --dout: out big_matrix(0 to 3);
  18.         done: out std_logic
  19.         );
  20. end landmark_1;
  21.  
  22. architecture TB_ARCHITECTURE of landmark_1 is
  23.  
  24.  
  25. component ram IS
  26.     generic
  27.     (
  28.         ADDRESS_WIDTH   : integer := 3;
  29.         DATA_WIDTH  : integer := 8
  30.     );
  31.     port
  32.     (
  33.         clock           : IN  std_logic;
  34.         data            : IN  signed(DATA_WIDTH - 1 DOWNTO 0);
  35.         write_address           : IN  unsigned(ADDRESS_WIDTH - 1 DOWNTO 0);
  36.         read_address            : IN  unsigned(ADDRESS_WIDTH - 1 DOWNTO 0);
  37.         we          : IN  std_logic;
  38.         q           : OUT signed(DATA_WIDTH - 1 DOWNTO 0)
  39.     );
  40. end component;
  41.  
  42. signal inp1,inp2: matrix1_t(0 to address_length);
  43. signal out_temp: signed(data_length-1 downto 0);
  44. signal out_temp_2: signed(data_length-1 downto 0);
  45.  
  46. --to_integer(unsigned(i))
  47.  
  48. begin
  49. --i<=std_logic_vector(to_unsigned(k,address_length));  
  50. read1:ram generic map( ADDRESS_WIDTH=>address_length, DATA_WIDTH=>data_length) port map (clk,din,index,index,vin,out_temp);
  51. inp1(to_integer(index))<=out_temp;
  52.  
  53. process (clk)
  54.   begin
  55.   if (clk'event and clk='1') then
  56.     if (flag='1') then out_temp_2<=inp1(0)+inp1(1);
  57.     end if;
  58.   end if;
  59. end process ;  
  60.  
  61. end TB_ARCHITECTURE;
Advertisement
Add Comment
Please, Sign In to add comment