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

Subversion Repositories ofdm

[/] [ofdm/] [branches/] [avendor/] [io_control.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 tmsiqueira
library IEEE;
2
use IEEE.STD_LOGIC_1164.ALL;
3
use IEEE.STD_LOGIC_ARITH.ALL;
4
use IEEE.STD_LOGIC_UNSIGNED.ALL;
5
 
6
--  Uncomment the following lines to use the declarations that are
7
--  provided for instantiating Xilinx primitive components.
8
--library UNISIM;
9
--use UNISIM.VComponents.all;
10
 
11
entity io_control is
12
  generic (
13
    stage : natural:=3);
14
 
15
  port (
16
    clk     : in  std_logic;
17
    rst     : in  std_logic;
18
         mem_bk : in std_logic;
19
    Gen_state : in  std_logic_vector(2*stage+2 downto 0);
20
         bank0_busy : out std_logic;
21
         bank1_busy : out std_logic;
22
    Output_enable: out std_logic);
23
end io_control;
24
 
25
architecture io_control of io_control is
26
 
27
alias state: std_logic_vector(2 downto 0) is Gen_state(2*stage+2 downto 2*stage);
28
alias counter: std_logic_vector(2*stage-1 downto 0) is Gen_state(2*stage-1 downto 0);
29
 
30
begin
31
 
32
Outen:process (clk, rst)
33
  begin  -- process
34
    if rst = '1' then                   -- asynchronous reset (active low)
35
      Output_enable <= '0';
36
    elsif clk'event and clk = '1' then  -- rising clock edge
37
      if  unsigned(state)=stage-1 and unsigned(counter)=55 then
38
        Output_enable <= '1';
39
      else
40
        Output_enable <= '0';
41
      end if;
42
    end if;
43
  end process;
44
 
45
Bank_busy:process(clk, rst)
46
  begin
47
    if rst = '1' then
48
            bank0_busy <= '0';
49
            bank1_busy <= '0';
50
    elsif clk'event and clk = '1' then
51
       if unsigned(state)=0 then
52
          if mem_bk = '0' then
53
             bank0_busy <= '1';
54
          else
55
                 bank1_busy <= '1';
56
          end if;
57
                 else
58
          bank0_busy <= '0';
59
          bank1_busy <= '0';
60
       end if;
61
    end if;
62
  end process;
63
 
64
end io_control;

powered by: WebSVN 2.1.0

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