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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [rtl/] [sys_gen/] [tst_rlink/] [nexys2/] [sys_tst_rlink_n2.vhd] - Blame information for rev 15

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 wfjm
-- $Id: sys_tst_rlink_n2.vhd 433 2011-11-27 22:04:39Z mueller $
2 10 wfjm
--
3
-- Copyright 2010-2011 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:    sys_tst_rlink_n2 - syn
16
-- Description:    rlink tester design for nexys2
17
--
18 13 wfjm
-- Dependencies:   vlib/xlib/dcm_sfs
19 10 wfjm
--                 vlib/genlib/clkdivce
20 12 wfjm
--                 bplib/bpgen/bp_rs232_2l4l_iob
21
--                 bplib/bpgen/sn_humanio_rbus
22
--                 tst_rlink
23 15 wfjm
--                 vlib/nxcramlib/nx_cram_dummy
24 10 wfjm
--
25
-- Test bench:     tb/tb_tst_rlink_n2
26
--
27
-- Target Devices: generic
28 13 wfjm
-- Tool versions:  xst 12.1, 13.1; ghdl 0.29
29 10 wfjm
--
30
-- Synthesized (xst):
31
-- Date         Rev  ise         Target      flop lutl lutm slic t peri
32 12 wfjm
-- 2011-06-26   385 12.1    M53d xc3s1200e-4  688 1500   68  993 t 16.2
33 10 wfjm
-- 2011-04-02   375 12.1    M53d xc3s1200e-4  688 1572   68  994 t 13.8
34
-- 2010-12-29   351 12.1    M53d xc3s1200e-4  604 1298   68  851 t 14.7
35
--
36
-- Revision History: 
37
-- Date         Rev Version  Comment
38 15 wfjm
-- 2011-11-26   433   1.1.5  use nx_cram_dummy now
39
-- 2011-11-23   432   1.1.4  update O_FLA_CE_N usage
40 13 wfjm
-- 2011-11-17   426   1.1.3  use dcm_sfs now
41 12 wfjm
-- 2011-07-09   391   1.1.2  use now bp_rs232_2l4l_iob
42
-- 2011-07-08   390   1.1.1  use now sn_humanio
43
-- 2011-06-26   385   1.1    move s3_humanio_rbus from tst_rlink to top level
44 10 wfjm
-- 2010-12-29   351   1.0    Initial version
45
------------------------------------------------------------------------------
46 12 wfjm
-- Usage of Nexys 2 Switches, Buttons, LEDs:
47 10 wfjm
--
48 12 wfjm
--    SWI(0):   0 -> main board RS232 port  - implemented in bp_rs232_2l4l_iob
49
--              1 -> Pmod B/top RS232 port  /
50
--       (1:7): no function (only connected to s3_humanio_rbus)
51
--
52
--    LED(0):   timer 0 busy 
53
--    LED(1):   timer 1 busy 
54
--    LED(2:6): no function (only connected to s3_humanio_rbus)
55
--    LED(7):   RL_SER_MONI.abact
56
--
57
--    DSP:      RL_SER_MONI.clkdiv  (from auto bauder)
58
--    DP(0):    RL_SER_MONI.rxact
59
--    DP(1):    RTS_N  (shows rx back preasure)
60
--    DP(2):    RL_SER_MONI.txact
61
--    DP(3):    CTS_N  (shows tx back preasure)
62
--
63 10 wfjm
 
64
library ieee;
65
use ieee.std_logic_1164.all;
66
 
67
use work.slvtypes.all;
68
use work.xlib.all;
69
use work.genlib.all;
70 12 wfjm
use work.rblib.all;
71
use work.rlinklib.all;
72
use work.bpgenlib.all;
73 15 wfjm
use work.nxcramlib.all;
74 10 wfjm
use work.sys_conf.all;
75
 
76
-- ----------------------------------------------------------------------------
77
 
78
entity sys_tst_rlink_n2 is              -- top level
79
                                        -- implements nexys2_fusp_aif
80
  port (
81
    I_CLK50 : in slbit;                 -- 50 MHz clock
82
    O_CLKSYS : out slbit;               -- DCM derived system clock
83
    I_RXD : in slbit;                   -- receive data (board view)
84
    O_TXD : out slbit;                  -- transmit data (board view)
85 15 wfjm
    I_SWI : in slv8;                    -- n2 switches
86
    I_BTN : in slv4;                    -- n2 buttons
87
    O_LED : out slv8;                   -- n2 leds
88 10 wfjm
    O_ANO_N : out slv4;                 -- 7 segment disp: anodes   (act.low)
89
    O_SEG_N : out slv8;                 -- 7 segment disp: segments (act.low)
90
    O_MEM_CE_N : out slbit;             -- cram: chip enable   (act.low)
91
    O_MEM_BE_N : out slv2;              -- cram: byte enables  (act.low)
92
    O_MEM_WE_N : out slbit;             -- cram: write enable  (act.low)
93
    O_MEM_OE_N : out slbit;             -- cram: output enable (act.low)
94
    O_MEM_ADV_N  : out slbit;           -- cram: address valid (act.low)
95
    O_MEM_CLK : out slbit;              -- cram: clock
96
    O_MEM_CRE : out slbit;              -- cram: command register enable
97
    I_MEM_WAIT : in slbit;              -- cram: mem wait
98
    O_MEM_ADDR  : out slv23;            -- cram: address lines
99
    IO_MEM_DATA : inout slv16;          -- cram: data lines
100 15 wfjm
    O_FLA_CE_N : out slbit;             -- flash ce..          (act.low)
101 10 wfjm
    O_FUSP_RTS_N : out slbit;           -- fusp: rs232 rts_n
102
    I_FUSP_CTS_N : in slbit;            -- fusp: rs232 cts_n
103
    I_FUSP_RXD : in slbit;              -- fusp: rs232 rx
104
    O_FUSP_TXD : out slbit              -- fusp: rs232 tx
105
  );
106
end sys_tst_rlink_n2;
107
 
108
architecture syn of sys_tst_rlink_n2 is
109
 
110
  signal CLK :   slbit := '0';
111
 
112
  signal RXD :   slbit := '1';
113
  signal TXD :   slbit := '0';
114
  signal RTS_N : slbit := '0';
115
  signal CTS_N : slbit := '0';
116
 
117
  signal SWI     : slv8  := (others=>'0');
118
  signal BTN     : slv4  := (others=>'0');
119 12 wfjm
  signal LED     : slv8  := (others=>'0');
120
  signal DSP_DAT : slv16 := (others=>'0');
121
  signal DSP_DP  : slv4  := (others=>'0');
122 10 wfjm
 
123
  signal RESET   : slbit := '0';
124
  signal CE_USEC : slbit := '0';
125
  signal CE_MSEC : slbit := '0';
126
 
127 12 wfjm
  signal RB_MREQ_TOP : rb_mreq_type := rb_mreq_init;
128
  signal RB_SRES_TOP : rb_sres_type := rb_sres_init;
129
  signal RL_SER_MONI : rl_ser_moni_type := rl_ser_moni_init;
130
  signal STAT    : slv8  := (others=>'0');
131
 
132
  constant rbaddr_hio   : slv8 := "11000000"; -- 110000xx
133
 
134 10 wfjm
begin
135
 
136
  assert (sys_conf_clksys mod 1000000) = 0
137
    report "assert sys_conf_clksys on MHz grid"
138
    severity failure;
139 12 wfjm
 
140
  RESET <= '0';                         -- so far not used
141 10 wfjm
 
142 13 wfjm
  DCM : dcm_sfs
143 10 wfjm
    generic map (
144
      CLKFX_DIVIDE   => sys_conf_clkfx_divide,
145
      CLKFX_MULTIPLY => sys_conf_clkfx_multiply,
146
      CLKIN_PERIOD   => 20.0)
147
    port map (
148
      CLKIN   => I_CLK50,
149
      CLKFX   => CLK,
150
      LOCKED  => open
151
    );
152
 
153
  O_CLKSYS <= CLK;
154
 
155
  CLKDIV : clkdivce
156
    generic map (
157
      CDUWIDTH => 7,
158
      USECDIV  => sys_conf_clksys_mhz,
159
      MSECDIV  => 1000)
160
    port map (
161
      CLK     => CLK,
162
      CE_USEC => CE_USEC,
163
      CE_MSEC => CE_MSEC
164
    );
165
 
166 12 wfjm
  IOB_RS232 : bp_rs232_2l4l_iob
167 10 wfjm
    port map (
168
      CLK      => CLK,
169 12 wfjm
      RESET    => '0',
170 10 wfjm
      SEL      => SWI(0),
171
      RXD      => RXD,
172
      TXD      => TXD,
173
      CTS_N    => CTS_N,
174
      RTS_N    => RTS_N,
175
      I_RXD0   => I_RXD,
176
      O_TXD0   => O_TXD,
177
      I_RXD1   => I_FUSP_RXD,
178
      O_TXD1   => O_FUSP_TXD,
179
      I_CTS1_N => I_FUSP_CTS_N,
180
      O_RTS1_N => O_FUSP_RTS_N
181
    );
182
 
183 12 wfjm
  HIO : sn_humanio_rbus
184 10 wfjm
    generic map (
185
      DEBOUNCE => sys_conf_hio_debounce,
186 12 wfjm
      RB_ADDR  => rbaddr_hio)
187 10 wfjm
    port map (
188
      CLK     => CLK,
189
      RESET   => RESET,
190
      CE_MSEC => CE_MSEC,
191 12 wfjm
      RB_MREQ => RB_MREQ_TOP,
192
      RB_SRES => RB_SRES_TOP,
193 10 wfjm
      SWI     => SWI,
194
      BTN     => BTN,
195 12 wfjm
      LED     => LED,
196
      DSP_DAT => DSP_DAT,
197
      DSP_DP  => DSP_DP,
198 10 wfjm
      I_SWI   => I_SWI,
199
      I_BTN   => I_BTN,
200
      O_LED   => O_LED,
201
      O_ANO_N => O_ANO_N,
202
      O_SEG_N => O_SEG_N
203
    );
204
 
205 12 wfjm
  RLTEST : entity work.tst_rlink
206
    generic map (
207
      CDINIT   => sys_conf_ser2rri_cdinit)
208
    port map (
209
      CLK         => CLK,
210
      RESET       => RESET,
211
      CE_USEC     => CE_USEC,
212
      CE_MSEC     => CE_MSEC,
213
      RXD         => RXD,
214
      TXD         => TXD,
215
      CTS_N       => CTS_N,
216
      RTS_N       => RTS_N,
217
      RB_MREQ_TOP => RB_MREQ_TOP,
218
      RB_SRES_TOP => RB_SRES_TOP,
219
      RL_SER_MONI => RL_SER_MONI,
220
      STAT        => STAT
221
    );
222
 
223 15 wfjm
  SRAM_PROT : nx_cram_dummy            -- connect CRAM to protection dummy
224 10 wfjm
    port map (
225
      O_MEM_CE_N  => O_MEM_CE_N,
226
      O_MEM_BE_N  => O_MEM_BE_N,
227
      O_MEM_WE_N  => O_MEM_WE_N,
228
      O_MEM_OE_N  => O_MEM_OE_N,
229
      O_MEM_ADV_N => O_MEM_ADV_N,
230
      O_MEM_CLK   => O_MEM_CLK,
231
      O_MEM_CRE   => O_MEM_CRE,
232
      I_MEM_WAIT  => I_MEM_WAIT,
233
      O_MEM_ADDR  => O_MEM_ADDR,
234
      IO_MEM_DATA => IO_MEM_DATA
235
    );
236 12 wfjm
 
237 15 wfjm
  O_FLA_CE_N  <= '1';                   -- keep Flash memory disabled
238
 
239 12 wfjm
  DSP_DAT   <= RL_SER_MONI.clkdiv;
240
  DSP_DP(0) <= RL_SER_MONI.rxact;
241
  DSP_DP(1) <= RTS_N;
242
  DSP_DP(2) <= RL_SER_MONI.txact;
243
  DSP_DP(3) <= CTS_N;
244
 
245
  LED(7) <= RL_SER_MONI.abact;
246
  LED(6 downto 2) <= (others=>'0');
247
  LED(1) <= STAT(1);
248
  LED(0) <= STAT(0);
249
 
250 10 wfjm
end syn;

powered by: WebSVN 2.1.0

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