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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.74/] [rtl/] [bplib/] [fx2rlink/] [ioleds_sp1c_fx2.vhd] - Blame information for rev 38

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 29 wfjm
-- $Id: ioleds_sp1c_fx2.vhd 649 2015-02-21 21:10:16Z mueller $
2 20 wfjm
--
3
-- Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
--
5
-- This program is free software; you may redistribute and/or modify it under
6
-- the terms of the GNU General Public License as published by the Free
7
-- Software Foundation, either version 2, or at your option any later version.
8
--
9
-- This program is distributed in the hope that it will be useful, but
10
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
-- for complete details.
13
-- 
14
------------------------------------------------------------------------------
15
-- Module Name:    ioleds_sp1c_fx2 - syn
16
-- Description:    io activity leds for rlink+serport_1clk+fx2_ic combo
17
--
18 29 wfjm
-- Dependencies:   genlib/led_pulse_stretch
19 20 wfjm
--
20
-- Test bench:     -
21
--
22
-- Target Devices: generic
23 29 wfjm
-- Tool versions:  xst 13.1-14.7; ghdl 0.29-0.31
24 20 wfjm
--
25
-- Revision History: 
26
-- Date         Rev Version  Comment
27
-- 2013-04-21   509   1.0    Initial version
28
------------------------------------------------------------------------------
29
 
30
library ieee;
31
use ieee.std_logic_1164.all;
32
use ieee.numeric_std.all;
33
 
34
use work.slvtypes.all;
35
use work.genlib.all;
36
use work.rblib.all;
37
use work.rlinklib.all;
38
use work.serportlib.all;
39
 
40
entity ioleds_sp1c_fx2 is               -- io activity leds for rlink_sp1c_fx2
41
  port (
42
    CLK  : in slbit;                    -- clock
43
    CE_USEC : in slbit;                 -- 1 usec clock enable
44
    RESET  : in slbit;                  -- reset
45
    ENAFX2 : in slbit;                  -- enable fx2 usage
46
    RB_SRES : in rb_sres_type;          -- rbus: response
47
    RLB_MONI : in rlb_moni_type;        -- rlink 8b: monitor port
48
    SER_MONI : in serport_moni_type;    -- ser: monitor port
49
    IOLEDS : out slv4                   -- 4 bit IO monitor (e.g. for DSP_DP)
50
  );
51
end entity ioleds_sp1c_fx2;
52
 
53
 
54
architecture syn of ioleds_sp1c_fx2 is
55
 
56
  signal R_LEDDIV : slv6 := (others=>'0');   -- clock divider for LED pulses
57
  signal R_LEDCE : slbit := '0';             -- ce every 64 usec
58
 
59
  signal TXENA_LED : slbit := '0';
60
  signal RXVAL_LED : slbit := '0';
61
 
62
begin
63
 
64
  RXVAL_PSTR : led_pulse_stretch
65
    port map (
66
      CLK        => CLK,
67
      CE_INT     => R_LEDCE,
68
      RESET      => '0',
69
      DIN        => RLB_MONI.rxval,
70
      POUT       => RXVAL_LED
71
    );
72
 
73
  TXENA_PSTR : led_pulse_stretch
74
    port map (
75
      CLK        => CLK,
76
      CE_INT     => R_LEDCE,
77
      RESET      => '0',
78
      DIN        => RLB_MONI.txena,
79
      POUT       => TXENA_LED
80
    );
81
 
82
  proc_leddiv: process (CLK)
83
  begin
84
 
85
    if rising_edge(CLK) then
86
      R_LEDCE  <= '0';
87
      if CE_USEC = '1' then
88
        R_LEDDIV <= slv(unsigned(R_LEDDIV) - 1);
89
        if unsigned(R_LEDDIV) = 0 then
90
          R_LEDCE <= '1';
91
        end if;
92
      end if;
93
    end if;
94
 
95
  end process proc_leddiv;
96
 
97
  proc_ledmux : process (ENAFX2, SER_MONI, RLB_MONI, RB_SRES,
98
                         TXENA_LED, RXVAL_LED)
99
  begin
100
 
101
    if ENAFX2 = '0' then
102
      IOLEDS(3) <= not SER_MONI.txok;
103
      IOLEDS(2) <= SER_MONI.txact;
104
      IOLEDS(1) <= not SER_MONI.rxok;
105
      IOLEDS(0) <= SER_MONI.rxact;
106
    else
107
      IOLEDS(3) <= RB_SRES.busy;
108
      IOLEDS(2) <= RLB_MONI.txbusy;
109
      IOLEDS(1) <= TXENA_LED;
110
      IOLEDS(0) <= RXVAL_LED;
111
    end if;
112
 
113
  end process proc_ledmux;
114
 
115
end syn;

powered by: WebSVN 2.1.0

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