OpenCores
URL https://opencores.org/ocsvn/motion_estimation_processor/motion_estimation_processor/trunk

Subversion Repositories motion_estimation_processor

[/] [motion_estimation_processor/] [trunk/] [src_me/] [macroblock_data5.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 eejlny
----------------------------------------------------------------------------
2
--  This file is a part of the LM VHDL IP LIBRARY
3
--  Copyright (C) 2009 Jose Nunez-Yanez
4
--
5
--  This program is free software; you can redistribute it and/or modify
6
--  it under the terms of the GNU General Public License as published by
7
--  the Free Software Foundation; either version 2 of the License, or
8
--  (at your option) any later version.
9
--
10
--  See the file COPYING for the full details of the license.
11
--
12
--  The license allows free and unlimited use of the library and tools for research and education purposes. 
13
--  The full LM core supports many more advanced motion estimation features and it is available under a 
14
--  low-cost commercial license. See the readme file to learn more or contact us at 
15
--  eejlny@byacom.co.uk or www.byacom.co.uk
16
-----------------------------------------------------------------------------
17
-- Entity:      
18
-- File:        macroblock_data.vhd
19
-- Author:      Jose Luis Nunez 
20
-- Description: macroblock data 5x5 macroblocks 
21
------------------------------------------------------------------------------
22
 
23
 
24
library IEEE;
25
use IEEE.std_logic_1164.all;
26
use IEEE.Numeric_STD.all;
27
 
28
entity macroblock_data5 is
29
    port(
30
      clk : in std_logic;
31
      reset : in std_logic;
32
      clear : in std_logic;
33
      addr : in std_logic_vector (4 downto 0);
34
      data : out std_logic_vector (63 downto 0)
35
      );
36
end;
37
 
38
 
39
architecture rtl of macroblock_data5 is
40
 
41
signal data_int: std_logic_vector(63 downto 0);
42
 
43
subtype word is integer range 0 to 255;
44
type mem is array (0 to 255) of word;
45
 
46
signal memory : mem := (
47
16#D5#,16#D8#,16#D4#,16#EF#,16#EB#,16#94#,16#38#,16#30#,16#4E#,16#45#,16#87#,16#DE#,16#CB#,16#C8#,16#CC#,16#CD#,
48
16#DC#,16#D2#,16#C6#,16#CE#,16#D0#,16#D9#,16#D9#,16#82#,16#3A#,16#36#,16#75#,16#D9#,16#D2#,16#C4#,16#C9#,16#CB#,
49
16#E1#,16#CE#,16#C2#,16#BF#,16#C0#,16#DE#,16#F9#,16#E4#,16#8B#,16#1D#,16#5A#,16#D9#,16#D2#,16#C0#,16#C6#,16#CA#,
50
16#C9#,16#CC#,16#C4#,16#C6#,16#C5#,16#C1#,16#BE#,16#EA#,16#F7#,16#54#,16#40#,16#D5#,16#D6#,16#C0#,16#D0#,16#DA#,
51
16#D6#,16#C2#,16#C7#,16#CA#,16#CA#,16#CA#,16#C9#,16#C1#,16#F2#,16#B8#,16#50#,16#BD#,16#DD#,16#C6#,16#D2#,16#C2#,
52
16#E5#,16#D2#,16#C0#,16#C6#,16#C8#,16#C8#,16#C7#,16#C2#,16#D3#,16#D5#,16#94#,16#B3#,16#D6#,16#C4#,16#9A#,16#65#,
53
16#96#,16#E3#,16#CF#,16#BC#,16#BF#,16#C4#,16#C3#,16#C2#,16#C1#,16#D3#,16#D4#,16#BF#,16#C9#,16#C3#,16#5F#,16#1C#,
54
16#48#,16#AA#,16#DD#,16#C4#,16#C0#,16#C4#,16#C5#,16#C8#,16#C3#,16#C4#,16#D5#,16#C9#,16#C5#,16#C9#,16#60#,16#1F#,
55
16#54#,16#4C#,16#A6#,16#EB#,16#D9#,16#C6#,16#C9#,16#C9#,16#C6#,16#C4#,16#C7#,16#C6#,16#CB#,16#C8#,16#55#,16#24#,
56
16#6F#,16#4A#,16#54#,16#83#,16#B9#,16#E1#,16#DA#,16#D4#,16#C9#,16#C6#,16#C9#,16#C8#,16#C6#,16#D1#,16#92#,16#18#,
57
16#6A#,16#73#,16#5A#,16#32#,16#68#,16#A3#,16#AE#,16#C7#,16#E4#,16#E2#,16#C8#,16#C6#,16#BF#,16#D2#,16#E1#,16#78#,
58
16#6B#,16#6B#,16#6F#,16#6C#,16#56#,16#50#,16#68#,16#89#,16#AA#,16#BE#,16#D4#,16#E0#,16#D0#,16#BC#,16#CA#,16#D6#,
59
16#6B#,16#6A#,16#70#,16#73#,16#65#,16#57#,16#58#,16#58#,16#44#,16#62#,16#AB#,16#C0#,16#D4#,16#D8#,16#C6#,16#E4#,
60
16#69#,16#69#,16#6B#,16#6A#,16#71#,16#6F#,16#68#,16#60#,16#4E#,16#54#,16#57#,16#4F#,16#9D#,16#E3#,16#CB#,16#C4#,
61
16#6C#,16#6A#,16#69#,16#68#,16#68#,16#6B#,16#6A#,16#6C#,16#75#,16#6D#,16#4F#,16#45#,16#4B#,16#76#,16#CB#,16#A5#,
62
16#6A#,16#6D#,16#6A#,16#68#,16#68#,16#6A#,16#6A#,16#68#,16#69#,16#6B#,16#6F#,16#75#,16#4A#,16#3C#,16#6E#,16#3A#
63
);
64
 
65
--attribute syn_romstyle : string;
66
--attribute syn_romstyle of memory : signal is "logic";
67
 
68
 
69
begin
70
 
71
  p : process(addr)
72
        variable vaddr1 : integer range 0 to 255;
73
        variable vaddr2 : integer range 0 to 255;
74
        variable vaddr3 : integer range 0 to 255;
75
        variable vaddr4 : integer range 0 to 255;
76
        variable vaddr5 : integer range 0 to 255;
77
        variable vaddr6 : integer range 0 to 255;
78
        variable vaddr7 : integer range 0 to 255;
79
        variable vaddr8 : integer range 0 to 255;
80
        begin
81
                        vaddr1 := To_integer(unsigned(addr&"000"));
82
                        vaddr2 := To_integer(unsigned(addr&"001"));
83
                        vaddr3 := To_integer(unsigned(addr&"010"));
84
                        vaddr4 := To_integer(unsigned(addr&"011"));
85
                        vaddr5 := To_integer(unsigned(addr&"100"));
86
                        vaddr6 := To_integer(unsigned(addr&"101"));
87
                        vaddr7 := To_integer(unsigned(addr&"110"));
88
                        vaddr8 := To_integer(unsigned(addr&"111"));
89
                        data_int <= (std_logic_vector(to_unsigned(memory(vaddr1),8)) &  std_logic_vector(to_unsigned(memory(vaddr2),8)) &  std_logic_vector(to_unsigned(memory(vaddr3),8)) & std_logic_vector(to_unsigned(memory(vaddr4),8)) & std_logic_vector(to_unsigned(memory(vaddr5),8)) & std_logic_vector(to_unsigned(memory(vaddr6),8)) & std_logic_vector(to_unsigned(memory(vaddr7),8)) & std_logic_vector(to_unsigned(memory(vaddr8),8)));
90
                --      data_int(23 downto 16) <= std_logic_vector(to_unsigned(memory(vaddr2),8));
91
                --      data_int(15 downto 8) <= std_logic_vector(to_unsigned(memory(vaddr3),8));
92
                --      data_int(7 downto 0) <= std_logic_vector(to_unsigned(memory(vaddr4),8));
93
  end process;
94
 
95
 
96
  ff: process(clear,clk)
97
  begin
98
        if (clear = '1') then
99
                        data <= (others => '0');
100
        elsif rising_edge(clk) then
101
                        if (reset = '1') then
102
                             data <= (others => '0');
103
                        else
104
                             data <= data_int;
105
                        end if;
106
        end if;
107
  end process;
108
 
109
 
110
 
111
 
112
 
113
end rtl;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.