w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
rlink_sp2c.vhd
Go to the documentation of this file.
1-- $Id: rlink_sp2c.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2016-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: rlink_sp2c - syn
7-- Description: rlink_core8 + serport_2clock2 combo
8--
9-- Dependencies: rlink_core8
10-- serport/serport_2clock2
11-- rbus/rbd_rbmon
12-- rbus/rb_sres_or_2
13--
14-- Test bench: -
15--
16-- Target Devices: generic
17-- Tool versions: viv 2015.4-2019.1; ghdl 0.33-0.35
18--
19-- Revision History:
20-- Date Rev Version Comment
21-- 2019-06-02 1159 1.0.1 use rbaddr_ constants
22-- 2016-03-28 755 1.0 Initial version (derived from rlink_sp1c)
23------------------------------------------------------------------------------
24
25library ieee;
26use ieee.std_logic_1164.all;
27use ieee.numeric_std.all;
28
29use work.slvtypes.all;
30use work.rblib.all;
31use work.rbdlib.all;
32use work.rlinklib.all;
33use work.serportlib.all;
34
35entity rlink_sp2c is -- rlink_core8+serport_2clock2 combo
36 generic (
37 BTOWIDTH : positive := 5; -- rbus timeout counter width
38 RTAWIDTH : positive := 12; -- retransmit buffer address width
39 SYSID : slv32 := (others=>'0'); -- rlink system id
40 IFAWIDTH : natural := 5; -- input fifo address width (0=none)
41 OFAWIDTH : natural := 5; -- output fifo address width (0=none)
42 ENAPIN_RLMON : integer := -1; -- SB_CNTL for rlmon (-1=none)
43 ENAPIN_RLBMON: integer := -1; -- SB_CNTL for rlbmon (-1=none)
44 ENAPIN_RBMON : integer := -1; -- SB_CNTL for rbmon (-1=none)
45 CDWIDTH : positive := 13; -- clk divider width
46 CDINIT : natural := 15; -- clk divider initial/reset setting
47 RBMON_AWIDTH : natural := 0; -- rbmon: buffer size, (0=none)
48 RBMON_RBADDR : slv16 := rbaddr_rbmon); -- rbmon: base addr
49 port (
50 CLK : in slbit; -- U|clock (user design)
51 CE_USEC : in slbit; -- U|1 usec clock enable
52 CE_MSEC : in slbit; -- U|1 msec clock enable
53 CE_INT : in slbit := '0'; -- U|rri ato time unit clock enable
54 RESET : in slbit; -- U|reset
55 CLKS : in slbit; -- S|clock (frontend:serial)
56 CES_MSEC : in slbit; -- S|1 msec clock enable
57 ENAXON : in slbit; -- U|enable xon/xoff handling
58 ESCFILL : in slbit; -- U|enable fill escaping
59 RXSD : in slbit; -- S|receive serial data (board view)
60 TXSD : out slbit; -- S|transmit serial data (board view)
61 CTS_N : in slbit := '0'; -- S|clear to send (act.low, board view)
62 RTS_N : out slbit; -- S|request to send (act.low, brd view)
63 RB_MREQ : out rb_mreq_type; -- U|rbus: request
64 RB_SRES : in rb_sres_type; -- U|rbus: response
65 RB_LAM : in slv16; -- U|rbus: look at me
66 RB_STAT : in slv4; -- U|rbus: status flags
67 RL_MONI : out rl_moni_type; -- U|rlink_core: monitor port
68 SER_MONI : out serport_moni_type -- U|serport: monitor port
69 );
70end entity rlink_sp2c;
71
72
73architecture syn of rlink_sp2c is
74
75 signal RLB_DI : slv8 := (others=>'0');
76 signal RLB_ENA : slbit := '0';
77 signal RLB_BUSY : slbit := '0';
78 signal RLB_DO : slv8 := (others=>'0');
79 signal RLB_VAL : slbit := '0';
80 signal RLB_HOLD : slbit := '0';
81
82 signal RB_MREQ_M : rb_mreq_type := rb_mreq_init;
83 signal RB_SRES_M : rb_sres_type := rb_sres_init;
84 signal RB_SRES_RBMON : rb_sres_type := rb_sres_init;
85
86begin
87
88 CORE : rlink_core8 -- rlink master ----------------------
89 generic map (
90 BTOWIDTH => BTOWIDTH,
91 RTAWIDTH => RTAWIDTH,
92 SYSID => SYSID,
93 ENAPIN_RLMON => ENAPIN_RLMON,
94 ENAPIN_RLBMON=> ENAPIN_RLBMON,
95 ENAPIN_RBMON => ENAPIN_RBMON)
96 port map (
97 CLK => CLK,
98 CE_INT => CE_INT,
99 RESET => RESET,
100 ESCXON => ENAXON,
101 ESCFILL => ESCFILL,
102 RLB_DI => RLB_DI,
103 RLB_ENA => RLB_ENA,
104 RLB_BUSY => RLB_BUSY,
105 RLB_DO => RLB_DO,
106 RLB_VAL => RLB_VAL,
107 RLB_HOLD => RLB_HOLD,
108 RL_MONI => RL_MONI,
109 RB_MREQ => RB_MREQ_M,
110 RB_SRES => RB_SRES_M,
111 RB_LAM => RB_LAM,
112 RB_STAT => RB_STAT
113 );
114
115 SERPORT : serport_2clock2 -- serport interface -----------------
116 generic map (
117 CDWIDTH => CDWIDTH,
118 CDINIT => CDINIT,
119 RXFAWIDTH => IFAWIDTH,
120 TXFAWIDTH => OFAWIDTH)
121 port map (
122 CLKU => CLK,
123 RESET => RESET,
124 CLKS => CLKS,
125 CES_MSEC => CES_MSEC,
126 ENAXON => ENAXON,
127 ENAESC => '0', -- escaping now in rlink_core8
128 RXDATA => RLB_DI,
129 RXVAL => RLB_ENA,
130 RXHOLD => RLB_BUSY,
131 TXDATA => RLB_DO,
132 TXENA => RLB_VAL,
133 TXBUSY => RLB_HOLD,
134 MONI => SER_MONI,
135 RXSD => RXSD,
136 TXSD => TXSD,
137 RXRTS_N => RTS_N,
138 TXCTS_N => CTS_N
139 );
140
141 RBMON : if RBMON_AWIDTH > 0 generate -- rbus monitor --------------
142 begin
143 I0 : rbd_rbmon
144 generic map (
147 port map (
148 CLK => CLK,
149 RESET => RESET,
153 );
154 end generate RBMON;
155
156 RB_SRES_OR : rb_sres_or_2 -- rbus or ---------------------------
157 port map (
158 RB_SRES_1 => RB_SRES,
159 RB_SRES_2 => RB_SRES_RBMON,
160 RB_SRES_OR => RB_SRES_M
161 );
162
163 RB_MREQ <= RB_MREQ_M; -- setup output signals
164
165end syn;
in RESET slbit
Definition: rbd_rbmon.vhd:98
RB_ADDR slv16 := rbaddr_rbmon
Definition: rbd_rbmon.vhd:94
AWIDTH natural := 9
Definition: rbd_rbmon.vhd:95
in CLK slbit
Definition: rbd_rbmon.vhd:97
in RB_MREQ rb_mreq_type
Definition: rbd_rbmon.vhd:99
out RB_SRES rb_sres_type
Definition: rbd_rbmon.vhd:100
in RB_SRES_SUM rb_sres_type
Definition: rbd_rbmon.vhd:102
Definition: rblib.vhd:32
std_logic_vector( 3 downto 0) slv4
Definition: slvtypes.vhd:36
std_logic_vector( 31 downto 0) slv32
Definition: slvtypes.vhd:59
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 7 downto 0) slv8
Definition: slvtypes.vhd:40