w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
ioleds_sp1c_fx2.vhd
Go to the documentation of this file.
1-- $Id: ioleds_sp1c_fx2.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: ioleds_sp1c_fx2 - syn
7-- Description: io activity leds for rlink+serport_1clk+fx2_ic combo
8--
9-- Dependencies: genlib/led_pulse_stretch
10--
11-- Test bench: -
12--
13-- Target Devices: generic
14-- Tool versions: xst 13.1-14.7; ghdl 0.29-0.31
15--
16-- Revision History:
17-- Date Rev Version Comment
18-- 2013-04-21 509 1.0 Initial version
19------------------------------------------------------------------------------
20
21library ieee;
22use ieee.std_logic_1164.all;
23use ieee.numeric_std.all;
24
25use work.slvtypes.all;
26use work.genlib.all;
27use work.rblib.all;
28use work.rlinklib.all;
29use work.serportlib.all;
30
31entity ioleds_sp1c_fx2 is -- io activity leds for rlink_sp1c_fx2
32 port (
33 CLK : in slbit; -- clock
34 CE_USEC : in slbit; -- 1 usec clock enable
35 RESET : in slbit; -- reset
36 ENAFX2 : in slbit; -- enable fx2 usage
37 RB_SRES : in rb_sres_type; -- rbus: response
38 RLB_MONI : in rlb_moni_type; -- rlink 8b: monitor port
39 SER_MONI : in serport_moni_type; -- ser: monitor port
40 IOLEDS : out slv4 -- 4 bit IO monitor (e.g. for DSP_DP)
41 );
42end entity ioleds_sp1c_fx2;
43
44
45architecture syn of ioleds_sp1c_fx2 is
46
47 signal R_LEDDIV : slv6 := (others=>'0'); -- clock divider for LED pulses
48 signal R_LEDCE : slbit := '0'; -- ce every 64 usec
49
50 signal TXENA_LED : slbit := '0';
51 signal RXVAL_LED : slbit := '0';
52
53begin
54
55 RXVAL_PSTR : led_pulse_stretch
56 port map (
57 CLK => CLK,
58 CE_INT => R_LEDCE,
59 RESET => '0',
60 DIN => RLB_MONI.rxval,
62 );
63
64 TXENA_PSTR : led_pulse_stretch
65 port map (
66 CLK => CLK,
67 CE_INT => R_LEDCE,
68 RESET => '0',
69 DIN => RLB_MONI.txena,
71 );
72
73 proc_leddiv: process (CLK)
74 begin
75
76 if rising_edge(CLK) then
77 R_LEDCE <= '0';
78 if CE_USEC = '1' then
79 R_LEDDIV <= slv(unsigned(R_LEDDIV) - 1);
80 if unsigned(R_LEDDIV) = 0 then
81 R_LEDCE <= '1';
82 end if;
83 end if;
84 end if;
85
86 end process proc_leddiv;
87
88 proc_ledmux : process (ENAFX2, SER_MONI, RLB_MONI, RB_SRES,
90 begin
91
92 if ENAFX2 = '0' then
93 IOLEDS(3) <= not SER_MONI.txok;
94 IOLEDS(2) <= SER_MONI.txact;
95 IOLEDS(1) <= not SER_MONI.rxok;
96 IOLEDS(0) <= SER_MONI.rxact;
97 else
98 IOLEDS(3) <= RB_SRES.busy;
99 IOLEDS(2) <= RLB_MONI.txbusy;
100 IOLEDS(1) <= TXENA_LED;
101 IOLEDS(0) <= RXVAL_LED;
102 end if;
103
104 end process proc_ledmux;
105
106end syn;
slv6 :=( others => '0') R_LEDDIV
slbit := '0' RXVAL_LED
slbit := '0' TXENA_LED
in SER_MONI serport_moni_type
in RLB_MONI rlb_moni_type
in RB_SRES rb_sres_type
in RESET slbit := '0'
Definition: rblib.vhd:32
std_logic_vector( 3 downto 0) slv4
Definition: slvtypes.vhd:36
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 5 downto 0) slv6
Definition: slvtypes.vhd:38
std_logic_vector slv
Definition: slvtypes.vhd:31