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.interface/] [button_messenger/] [1.0/] [tb/] [led_rx.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-------------------------------------------------------------------------------
2
-- Title      : A block that turns leds on and off. Controlled by writing one
3
--              byte which will then go directly to led outputs.
4
-- Project    : Nocbench, Funbase
5
-------------------------------------------------------------------------------
6
-- File       : led_Rx.vhd
7
-- Author     : ege
8
-- Created    : 2012-02-10
9
-- Last update: 2012-02-10
10
-------------------------------------------------------------------------------
11
-- Copyright (c) 2010
12
-------------------------------------------------------------------------------
13
-- Revisions  :
14
-- Date        Version  Author  Description
15
-- 2012-02-10  1.0      ES      First version
16
-------------------------------------------------------------------------------
17
library ieee;
18
use ieee.std_logic_1164.all;
19
 
20
entity led_rx is
21
 
22
  generic (
23
    comm_width_g : integer := 5;
24
    data_width_g : integer := 0
25
    );
26
  port (
27
    clk      : in  std_logic;
28
    rst_n    : in  std_logic;
29
    leds_out : out std_logic_vector(7 downto 0);
30
 
31
    -- HIBI wrapper ports
32
    agent_av_in    : in  std_logic;
33
    agent_data_in  : in  std_logic_vector (data_width_g-1 downto 0);
34
    agent_comm_in  : in  std_logic_vector (comm_width_g-1 downto 0);
35
    agent_re_out   : out std_logic;
36
    agent_empty_in : in  std_logic;
37
    agent_one_d_in : in  std_logic
38
    );
39
 
40
end led_rx;
41
 
42
 
43
architecture rtl of led_rx is
44
 
45
 
46
begin  -- rtl
47
  main : process (clk, rst_n)
48
 
49
  begin  -- process main
50
 
51
    if rst_n = '0' then                 -- asynchronous reset (active low)
52
 
53
      agent_re_out <= '1';
54
      leds_out     <= (others => '0');
55
 
56
    elsif clk'event and clk = '1' then  -- rising clock edge
57
 
58
      agent_re_out <= '1';
59
 
60
      if agent_empty_in = '0' and agent_av_in = '0' then
61
        leds_out <= agent_data_in (7 downto 0);
62
      end if;
63
 
64
    end if;
65
  end process main;
66
 
67
 
68
end rtl;

powered by: WebSVN 2.1.0

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