w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
rlink_sp1c_fx2.vhd
Go to the documentation of this file.
1-- $Id: rlink_sp1c_fx2.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: rlink_sp1c_fx2 - syn
7-- Description: rlink_core8 + serport_1clock + fx2 combo
8--
9-- Dependencies: rlinklib/rlink_core8
10-- serport/serport_1clock
11-- rlinklib/rlink_rlbmux
12-- fx2lib/fx2_2fifoctl_ic
13-- rbus/rbd_rbmon
14-- rbus/rb_sres_or_2
15--
16-- Test bench: -
17--
18-- Target Devices: generic
19-- Tool versions: xst 13.1-14.7; viv 2014.4-2019.1; ghdl 0.29-0.35
20--
21-- Synthesized (xst):
22-- Date Rev ise Target flop lutl lutm slic t peri ifa ofa
23-- 2015-05-02 672 14.7 131013 xc6slx16-2 618 875 90 340 s 7.2 - -
24-- 2013-04-20 509 13.3 O76d xc3s1200e-4 441 903 128 637 s 8.7 - -
25--
26-- Revision History:
27-- Date Rev Version Comment
28-- 2019-06-02 1159 1.3.1 use rbaddr_ constants
29-- 2015-05-02 672 1.3 add rbd_rbmon (optional via generics)
30-- 2015-04-11 666 1.2 drop ENAESC, rearrange XON handling
31-- 2014-08-28 588 1.1 use new rlink v4 iface generics and 4 bit STAT
32-- 2013-04-20 509 1.0 Initial version (derived from rlink_sp1c)
33------------------------------------------------------------------------------
34
35library ieee;
36use ieee.std_logic_1164.all;
37use ieee.numeric_std.all;
38
39use work.slvtypes.all;
40use work.rblib.all;
41use work.rbdlib.all;
42use work.rlinklib.all;
43use work.serportlib.all;
44use work.fx2lib.all;
45
46entity rlink_sp1c_fx2 is -- rlink_core8+serport_1clk+fx2_ic combo
47 generic (
48 BTOWIDTH : positive := 5; -- rbus timeout counter width
49 RTAWIDTH : positive := 12; -- retransmit buffer address width
50 SYSID : slv32 := (others=>'0'); -- rlink system id
51 IFAWIDTH : natural := 5; -- ser input fifo addr width (0=none)
52 OFAWIDTH : natural := 5; -- ser output fifo addr width (0=none)
53 PETOWIDTH : positive := 10; -- fx2 packet end time-out counter width
54 CCWIDTH : positive := 5; -- fx2 chunk counter width
55 ENAPIN_RLMON : integer := -1; -- SB_CNTL for rlmon (-1=none)
56 ENAPIN_RLBMON: integer := -1; -- SB_CNTL for rlbmon (-1=none)
57 ENAPIN_RBMON : integer := -1; -- SB_CNTL for rbmon (-1=none)
58 CDWIDTH : positive := 13; -- clk divider width
59 CDINIT : natural := 15; -- clk divider initial/reset setting
60 RBMON_AWIDTH : natural := 0; -- rbmon: buffer size, (0=none)
61 RBMON_RBADDR : slv16 := rbaddr_rbmon); -- rbmon: base addr
62 port (
63 CLK : in slbit; -- clock
64 CE_USEC : in slbit; -- 1 usec clock enable
65 CE_MSEC : in slbit; -- 1 msec clock enable
66 CE_INT : in slbit := '0'; -- rri ato time unit clock enable
67 RESET : in slbit; -- reset
68 ENAXON : in slbit; -- enable xon/xoff handling
69 ENAFX2 : in slbit; -- enable fx2 usage
70 RXSD : in slbit; -- receive serial data (board view)
71 TXSD : out slbit; -- transmit serial data (board view)
72 CTS_N : in slbit := '0'; -- clear to send (act.low, board view)
73 RTS_N : out slbit; -- request to send (act.low, board view)
74 RB_MREQ : out rb_mreq_type; -- rbus: request
75 RB_SRES : in rb_sres_type; -- rbus: response
76 RB_LAM : in slv16; -- rbus: look at me
77 RB_STAT : in slv4; -- rbus: status flags
78 RL_MONI : out rl_moni_type; -- rlink_core: monitor port
79 RLB_MONI : out rlb_moni_type; -- rlink 8b: monitor port
80 SER_MONI : out serport_moni_type; -- ser: monitor port
81 FX2_MONI : out fx2ctl_moni_type; -- fx2: monitor port
82 I_FX2_IFCLK : in slbit; -- fx2: interface clock
83 O_FX2_FIFO : out slv2; -- fx2: fifo address
84 I_FX2_FLAG : in slv4; -- fx2: fifo flags
85 O_FX2_SLRD_N : out slbit; -- fx2: read enable (act.low)
86 O_FX2_SLWR_N : out slbit; -- fx2: write enable (act.low)
87 O_FX2_SLOE_N : out slbit; -- fx2: output enable (act.low)
88 O_FX2_PKTEND_N : out slbit; -- fx2: packet end (act.low)
89 IO_FX2_DATA : inout slv8 -- fx2: data lines
90 );
91end entity rlink_sp1c_fx2;
92
93
94architecture syn of rlink_sp1c_fx2 is
95
96 signal RLB_DI : slv8 := (others=>'0');
97 signal RLB_ENA : slbit := '0';
98 signal RLB_BUSY : slbit := '0';
99 signal RLB_DO : slv8 := (others=>'0');
100 signal RLB_VAL : slbit := '0';
101 signal RLB_HOLD : slbit := '0';
102
103 signal SER_RXDATA : slv8 := (others=>'0');
104 signal SER_RXVAL : slbit := '0';
105 signal SER_RXHOLD : slbit := '0';
106 signal SER_TXDATA : slv8 := (others=>'0');
107 signal SER_TXENA : slbit := '0';
108 signal SER_TXBUSY : slbit := '0';
109
110 signal FX2_RXDATA : slv8 := (others=>'0');
111 signal FX2_RXVAL : slbit := '0';
112 signal FX2_RXHOLD : slbit := '0';
113 signal FX2_RXAEMPTY : slbit := '0';
114 signal FX2_TXDATA : slv8 := (others=>'0');
115 signal FX2_TXENA : slbit := '0';
116 signal FX2_TXBUSY : slbit := '0';
117 signal FX2_TXAFULL : slbit := '0';
118
119 signal RB_MREQ_M : rb_mreq_type := rb_mreq_init;
120 signal RB_SRES_M : rb_sres_type := rb_sres_init;
121 signal RB_SRES_RBMON : rb_sres_type := rb_sres_init;
122
123begin
124
125 CORE : rlink_core8 -- rlink master ----------------------
126 generic map (
127 BTOWIDTH => BTOWIDTH,
128 RTAWIDTH => RTAWIDTH,
129 SYSID => SYSID,
130 ENAPIN_RLMON => ENAPIN_RLMON,
131 ENAPIN_RLBMON=> ENAPIN_RLBMON,
132 ENAPIN_RBMON => ENAPIN_RBMON)
133 port map (
134 CLK => CLK,
135 CE_INT => CE_INT,
136 RESET => RESET,
137 ESCXON => ENAXON,
138 ESCFILL => '0', -- not used in FX2 enabled boards
139 RLB_DI => RLB_DI,
140 RLB_ENA => RLB_ENA,
141 RLB_BUSY => RLB_BUSY,
142 RLB_DO => RLB_DO,
143 RLB_VAL => RLB_VAL,
144 RLB_HOLD => RLB_HOLD,
145 RL_MONI => RL_MONI,
146 RB_MREQ => RB_MREQ_M,
147 RB_SRES => RB_SRES_M,
148 RB_LAM => RB_LAM,
149 RB_STAT => RB_STAT
150 );
151
152 SERPORT : serport_1clock -- serport interface -----------------
153 generic map (
154 CDWIDTH => CDWIDTH,
155 CDINIT => CDINIT,
156 RXFAWIDTH => IFAWIDTH,
157 TXFAWIDTH => OFAWIDTH)
158 port map (
159 CLK => CLK,
160 CE_MSEC => CE_MSEC,
161 RESET => RESET,
162 ENAXON => ENAXON,
163 ENAESC => '0', -- escaping now in rlink_core8
164 RXDATA => SER_RXDATA,
165 RXVAL => SER_RXVAL,
166 RXHOLD => SER_RXHOLD,
167 TXDATA => SER_TXDATA,
168 TXENA => SER_TXENA,
169 TXBUSY => SER_TXBUSY,
170 MONI => SER_MONI,
171 RXSD => RXSD,
172 TXSD => TXSD,
173 RXRTS_N => RTS_N,
174 TXCTS_N => CTS_N
175 );
176
177 RLBMUX : rlink_rlbmux -- rlink control mux -----------------
178 port map (
179 SEL => ENAFX2,
180 RLB_DI => RLB_DI,
181 RLB_ENA => RLB_ENA,
182 RLB_BUSY => RLB_BUSY,
183 RLB_DO => RLB_DO,
184 RLB_VAL => RLB_VAL,
185 RLB_HOLD => RLB_HOLD,
186 P0_RXDATA => SER_RXDATA,
187 P0_RXVAL => SER_RXVAL,
188 P0_RXHOLD => SER_RXHOLD,
189 P0_TXDATA => SER_TXDATA,
190 P0_TXENA => SER_TXENA,
191 P0_TXBUSY => SER_TXBUSY,
192 P1_RXDATA => FX2_RXDATA,
193 P1_RXVAL => FX2_RXVAL,
194 P1_RXHOLD => FX2_RXHOLD,
195 P1_TXDATA => FX2_TXDATA,
196 P1_TXENA => FX2_TXENA,
197 P1_TXBUSY => FX2_TXBUSY
198 );
199
200 RLB_MONI.rxval <= RLB_VAL;
201 RLB_MONI.rxhold <= RLB_HOLD;
202 RLB_MONI.txena <= RLB_ENA;
203 RLB_MONI.txbusy <= RLB_BUSY;
204
205 FX2CNTL : fx2_2fifoctl_ic -- FX2 interface ---------------------
206 generic map (
207 RXFAWIDTH => 5,
208 TXFAWIDTH => 5,
209 PETOWIDTH => PETOWIDTH,
210 CCWIDTH => CCWIDTH,
211 RXAEMPTY_THRES => 1,
212 TXAFULL_THRES => 1)
213 port map (
214 CLK => CLK,
215 RESET => RESET,
216 RXDATA => FX2_RXDATA,
217 RXVAL => FX2_RXVAL,
218 RXHOLD => FX2_RXHOLD,
219 RXAEMPTY => FX2_RXAEMPTY,
220 TXDATA => FX2_TXDATA,
221 TXENA => FX2_TXENA,
222 TXBUSY => FX2_TXBUSY,
223 TXAFULL => FX2_TXAFULL,
224 MONI => FX2_MONI,
225 I_FX2_IFCLK => I_FX2_IFCLK,
226 O_FX2_FIFO => O_FX2_FIFO,
227 I_FX2_FLAG => I_FX2_FLAG,
228 O_FX2_SLRD_N => O_FX2_SLRD_N,
229 O_FX2_SLWR_N => O_FX2_SLWR_N,
230 O_FX2_SLOE_N => O_FX2_SLOE_N,
231 O_FX2_PKTEND_N => O_FX2_PKTEND_N,
232 IO_FX2_DATA => IO_FX2_DATA
233 );
234
235 RBMON : if RBMON_AWIDTH > 0 generate -- rbus monitor --------------
236 begin
237 I0 : rbd_rbmon
238 generic map (
241 port map (
242 CLK => CLK,
243 RESET => RESET,
247 );
248 end generate RBMON;
249
250 RB_SRES_OR : rb_sres_or_2 -- rbus or ---------------------------
251 port map (
252 RB_SRES_1 => RB_SRES,
253 RB_SRES_2 => RB_SRES_RBMON,
254 RB_SRES_OR => RB_SRES_M
255 );
256
257 RB_MREQ <= RB_MREQ_M; -- setup output signals
258
259end 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
std_logic_vector( 1 downto 0) slv2
Definition: slvtypes.vhd:34