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

Subversion Repositories mkjpeg

[/] [mkjpeg/] [trunk/] [design/] [mdct/] [DBUFCTL.VHD] - Blame information for rev 71

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 25 mikel262
--------------------------------------------------------------------------------
2
--                                                                            --
3
--                          V H D L    F I L E                                --
4
--                          COPYRIGHT (C) 2006                                --
5
--                                                                            --
6
--------------------------------------------------------------------------------
7
--
8
-- Title       : DBUFCTL
9
-- Design      : MDCT Core
10
-- Author      : Michal Krepa
11
--
12
--------------------------------------------------------------------------------
13
--
14
-- File        : DBUFCTL.VHD
15
-- Created     : Thu Mar 30 22:19 2006
16
--
17
--------------------------------------------------------------------------------
18
--
19
--  Description : Double buffer memory controller
20
--
21
--------------------------------------------------------------------------------
22
library IEEE;
23
  use IEEE.STD_LOGIC_1164.all;
24
 
25
library WORK;
26
  use WORK.MDCT_PKG.all;
27
 
28
entity DBUFCTL is
29
        port(
30
                clk          : in STD_LOGIC;
31
                rst          : in STD_LOGIC;
32
    wmemsel      : in STD_LOGIC;
33
    rmemsel      : in STD_LOGIC;
34
    datareadyack : in STD_LOGIC;
35
 
36
    memswitchwr  : out STD_LOGIC;
37
    memswitchrd  : out STD_LOGIC;
38
    dataready    : out STD_LOGIC
39
                );
40
end DBUFCTL;
41
 
42
architecture RTL of DBUFCTL is
43
 
44
  signal memswitchwr_reg : STD_LOGIC;
45
  signal memswitchrd_reg : STD_LOGIC;
46
 
47
begin
48
 
49
  memswitchwr  <= memswitchwr_reg;
50
  memswitchrd  <= memswitchrd_reg;
51
 
52
  memswitchrd_reg <= rmemsel;
53
 
54
  MEM_SWITCH : process(clk,rst)
55
  begin
56
    if rst = '1' then
57
      memswitchwr_reg <= '0'; -- initially mem 1 is selected
58
      dataready       <= '0';
59
    elsif clk = '1' and clk'event then
60
      memswitchwr_reg <= wmemsel;
61
 
62
      if wmemsel /= memswitchwr_reg then
63
        dataready <= '1';
64
      end if;
65
 
66
      if datareadyack = '1' then
67
        dataready <= '0';
68
      end if;
69
    end if;
70
  end process;
71
 
72
end RTL;
73
--------------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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