1 -- $Id: sys_tst_fx2loop_n3.vhd 638 2015-01-25 22:01:38Z mueller $
3 -- Copyright 2012-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
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.
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.
14 ------------------------------------------------------------------------------
15 -- Module Name: sys_tst_fx2loop_n3 - syn
16 -- Description: test of Cypress EZ-USB FX2 controller
18 -- Dependencies: vlib/xlib/s6_cmt_sfs
19 -- vlib/genlib/clkdivce
23 -- bplib/fx2lib/fx2_2fifoctl_ic [sys_conf_fx2_type="ic2"]
24 -- bplib/fx2lib/fx2_3fifoctl_ic [sys_conf_fx2_type="ic3"]
25 -- bplib/nxcramlib/nx_cram_dummy
29 -- Target Devices: generic
30 -- Tool versions: xst 13.3-14.7; ghdl 0.29-0.31
33 -- Date Rev ise Target flop lutl lutm slic t peri ctl/MHz
34 -- 2013-04-25 510 14.5 P58f xc6slx16-2 416 516 68 199 p 5.3 ic3/150
35 -- 2013-04-24 510 13.3 O76d xc6slx16-2 417 674 68 228 p 5.3 ic3/175
36 -- 2012-04-09 461 13.3 O76d xc6slx16-2 429 620 48 232 p 7.2 ic3/100
38 -- 2013-04-25 510 14.5 P58f xc6slx16-2 349 427 48 163 p 5.4 ic2/150
39 -- 2013-04-24 510 13.3 O76d xc6slx16-2 355 569 48 208 p 5.4 ic2/175
40 -- 2012-04-09 461 13.3 O76d xc6slx16-2 347 499 32 175 p 7.9 ic2/100
42 -- 2013-04-24 510 13.3 O76d xc6slx16-2 299 486 32 175 p FAIL as2/100
43 -- 2012-04-09 461 13.3 O76d xc6slx16-2 299 460 32 164 p FAIL as2/100
46 -- Date Rev Version Comment
47 -- 2013-10-06 538 1.1 pll support, use clksys_vcodivide ect
48 -- 2013-04-24 510 1.0.1 CLKDIV.CDUWIDTH now 8, support >127 sysclk
49 -- 2012-04-09 461 1.0 Initial version (derived from sys_tst_fx2loop_n2)
50 ------------------------------------------------------------------------------
53 use ieee.std_logic_1164.
all;
65 -- ----------------------------------------------------------------------------
68 -- implements nexys3_aif + fx2 pins
71 I_RXD : in slbit;
-- receive data (board view)
72 O_TXD : out slbit;
-- transmit data (board view)
76 O_ANO_N : out slv4;
-- 7 segment disp: anodes (act.low)
77 O_SEG_N : out slv8;
-- 7 segment disp: segments (act.low)
84 O_MEM_CRE : out slbit;
-- cram: command register enable
99 end sys_tst_fx2loop_n3;
103 signal CLK : slbit := '0';
109 signal SWI : slv8 := (others=>'0');
110 signal BTN : slv5 := (others=>'0');
111 signal LED : slv8 := (others=>'0');
132 signal FX2_MONI : fx2ctl_moni_type := fx2ctl_moni_init;
136 assert (sys_conf_clksys mod 1000000) = 0
137 report "assert sys_conf_clksys on MHz grid"
148 GEN_TYPE => sys_conf_clksys_gentype
)
157 CDUWIDTH =>
8,
-- good for up to 255 MHz !
158 USECDIV => sys_conf_clksys_mhz ,
186 RESET <= BTN(0);
-- BTN(0) will reset tester !!
241 FX2_CNTL_IC : if sys_conf_fx2_type = "ic2" generate
247 CCWIDTH => sys_conf_fx2_ccwidth ,
271 end generate FX2_CNTL_IC;
273 FX2_CNTL_IC3 : if sys_conf_fx2_type = "ic3" generate
279 CCWIDTH => sys_conf_fx2_ccwidth ,
308 end generate FX2_CNTL_IC3;
324 O_PPCM_CE_N <= '1';
-- keep parallel PCM memory disabled
327 O_TXD <= I_RXD;
-- loop-back in serial port...
in FX2_MONIfx2ctl_moni_type
slv4 :=( others =>'0' ) DSP_DP
out HIO_STAThio_stat_type
slv16 :=( others =>'0' ) DSP_DAT
nx_cram_dummy sram_protsram_prot
slv8 :=( others =>'0' ) LED
slv8 :=( others =>'0' ) FX2_RXDATA
hio_cntl_type :=hio_cntl_init HIO_CNTL
TX2AFULL_THRESnatural :=1
hio_stat_type :=hio_stat_init HIO_STAT
out O_LEDslv (LWIDTH - 1 downto 0)
out HIO_CNTLhio_cntl_type
slv8 :=( others =>'0' ) FX2_TX2DATA
in DSP_DPslv ((2 ** DCWIDTH) - 1 downto 0)
slv8 :=( others =>'0' ) LED_MAP
out SWIslv (SWIDTH - 1 downto 0)
in I_SWIslv (SWIDTH - 1 downto 0)
slv5 :=( others =>'0' ) BTN
slv8 :=( others =>'0' ) SWI
in I_BTNslv (BWIDTH - 1 downto 0)
STARTUP_WAITboolean :=false
in FX2_MONIfx2ctl_moni_type
RXAEMPTY_THRESnatural :=1
in DSP_DATslv (4 * (2 ** DCWIDTH) - 1 downto 0)
proc_ledSWI,LED_MAP,FX2_TX2BUSY,FX2_TX2ENA,FX2_TXBUSY,FX2_TXENA,FX2_RXHOLD,FX2_RXVAL
in LEDslv (LWIDTH - 1 downto 0)
out BTNslv (BWIDTH - 1 downto 0)
s6_cmt_sfs gen_clksysgen_clksys
fx2ctl_moni_type :=fx2ctl_moni_init FX2_MONI
RXAEMPTY_THRESnatural :=1
slv8 :=( others =>'0' ) FX2_TXDATA
out O_ANO_Nslv ((2 ** DCWIDTH) - 1 downto 0)
tst_fx2loop_hiomap hiomaphiomap