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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.storage/] [fifos/] [synch_fifos/] [1.0/] [vhd/] [shift_slot.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-------------------------------------------------------------------------------
2
-- File        : shift_slot.vhdl
3
-- Description : One slot for shift register
4
--               Basically a Register(valid bit+data) and mux
5
-- Author      : Erno Salminen
6
-- Date        : 29.05.2003
7
-- Modified    : 
8
--
9
-------------------------------------------------------------------------------
10
library ieee;
11
use ieee.std_logic_1164.all;
12
use ieee.std_logic_arith.all;
13
use ieee.std_logic_unsigned.all;
14
 
15
 
16
entity shift_slot is
17
 
18
  generic (
19
    width : integer := 0);
20
 
21
  port (
22
    Clk          : in  std_logic;
23
    Rst_n        : in  std_logic;
24
    Valid_In     : in  std_logic;
25
    Data_In      : in  std_logic_vector ( width-1 downto 0);
26
    Shift_Enable : in  std_logic;
27
    Valid_Out    : out std_logic;
28
    Data_Out     : out std_logic_vector ( width-1 downto 0)
29
    );
30
 
31
end shift_slot;
32
 
33
 
34
 
35
architecture rtl of shift_slot is
36
 
37
  type Shift_slot_type is record
38
                           Valid : std_logic;
39
                           Data  : std_logic_vector ( width-1 downto 0);
40
                         end record;
41
 
42
  signal Data_reg : Shift_slot_type;
43
 
44
 
45
begin  -- rtl
46
 
47
 
48
  -- CONC
49
  Data_Out  <= Data_reg.Data;
50
  Valid_Out <= Data_reg.Valid;
51
 
52
  -- PROC
53
  Sync : process (Clk, Rst_n)
54
  begin  -- process Sync
55
    if Rst_n = '0' then                 -- asynchronous reset (active low)
56
      Data_reg.Data  <= (others => '0');
57
      Data_reg.Valid <= '0';
58
 
59
    elsif Clk'event and Clk = '1' then  -- rising clock edge
60
 
61
      if Shift_Enable = '1' then
62
        Data_reg.Data  <= Data_In;
63
        Data_reg.Valid <= Valid_In;
64
      else
65
        Data_reg.Data  <= Data_reg.Data;
66
        Data_reg.Valid <= Data_reg.Valid;
67
      end if;
68
 
69
 
70
    end if;
71
  end process Sync;
72
 
73
end rtl;

powered by: WebSVN 2.1.0

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