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/] [led_pkt_codec_mk2/] [1.0/] [vhd/] [led_pkt_codec_mk2.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
-------------------------------------------------------------------------------
2
-- Title      : Led blinker for ase_mesh1
3
-- Project    : 
4
-------------------------------------------------------------------------------
5
-- File       : led_pkt_codec_mk2.vhd
6
-- Author     : Lasse Lehtonen
7
-- Company    : 
8
-- Created    : 2011-11-09
9
-- Last update: 2011-12-02
10
-- Platform   : 
11
-- Standard   : VHDL'87
12
-------------------------------------------------------------------------------
13
-- Description: Inverts led output for evey data word received.
14
-------------------------------------------------------------------------------
15
-- Copyright (c) 2011 
16
-------------------------------------------------------------------------------
17
-- Revisions  :
18
-- Date        Version  Author  Description
19
-- 2011-11-09  1.0      lehton87        Created
20
-------------------------------------------------------------------------------
21
-------------------------------------------------------------------------------
22
-- Funbase IP library Copyright (C) 2011 TUT Department of Computer Systems
23
--
24
-- This source file may be used and distributed without
25
-- restriction provided that this copyright statement is not
26
-- removed from the file and that any derivative work contains
27
-- the original copyright notice and the associated disclaimer.
28
--
29
-- This source file is free software; you can redistribute it
30
-- and/or modify it under the terms of the GNU Lesser General
31
-- Public License as published by the Free Software Foundation;
32
-- either version 2.1 of the License, or (at your option) any
33
-- later version.
34
--
35
-- This source is distributed in the hope that it will be
36
-- useful, but WITHOUT ANY WARRANTY; without even the implied
37
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
38
-- PURPOSE.  See the GNU Lesser General Public License for more
39
-- details.
40
--
41
-- You should have received a copy of the GNU Lesser General
42
-- Public License along with this source; if not, download it
43
-- from http://www.opencores.org/lgpl.shtml
44
-------------------------------------------------------------------------------
45
 
46
library ieee;
47
use ieee.std_logic_1164.all;
48
 
49
entity led_pkt_codec_mk2 is
50
 
51
  port (
52
    clk       : in  std_logic;
53
    rst_n     : in  std_logic;
54
    cmd_in    : in  std_logic_vector(1 downto 0);
55
    data_in   : in  std_logic_vector(31 downto 0);
56
    stall_out : out std_logic;
57
 
58
    cmd_out   : out std_logic_vector(1 downto 0);
59
    data_out  : out std_logic_vector(31 downto 0);
60
    stall_in  : in  std_logic;
61
 
62
    led_out   : out std_logic
63
    );
64
 
65
end led_pkt_codec_mk2;
66
 
67
 
68
architecture rtl of led_pkt_codec_mk2 is
69
 
70
  signal led_r : std_logic;
71
 
72
begin  -- rtl
73
 
74
  data_out  <= (others => '0');
75
  cmd_out   <= (others => '0');
76
  stall_out <= '0';                     -- This accepts all incoming data
77
  led_out   <= led_r;
78
 
79
  --
80
  -- Read input
81
  --   
82
  main_p : process (clk, rst_n)
83
  begin  -- process main_p
84
    if rst_n = '0' then                 -- asynchronous reset (active low)
85
 
86
      led_r <= '1';
87
 
88
    elsif clk'event and clk = '1' then  -- rising clock edge
89
 
90
      if cmd_in = "00" then
91
        -- no data coming in
92
      elsif cmd_in = "01" then
93
        -- address coming in, don't care what it is
94
      elsif cmd_in = "10" then
95
        -- data coming in, donät care about its value
96
        led_r <= not led_r;
97
      else
98
        -- not defined
99
      end if;
100
 
101
    end if;
102
  end process main_p;
103
 
104
 
105
 
106
end rtl;

powered by: WebSVN 2.1.0

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