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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [rtl/] [sys_gen/] [tst_fx2loop/] [tst_fx2looplib.vhd] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 17 wfjm
-- $Id: tst_fx2looplib.vhd 453 2012-01-15 17:51:18Z mueller $
2
--
3
-- Copyright 2011-2012 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
-- Package Name:   tst_fx2looplib
16
-- Description:    Definitions for tst_fx2loop records and helpers
17
--
18
-- Dependencies:   -
19
-- Tool versions:  xst 13.3; ghdl 0.29
20
-- Revision History: 
21
-- Date         Rev Version  Comment
22
-- 2012-01-15   453   1.1    drop pecnt, add rxhold,(tx|tx2)busy in hio_stat
23
-- 2011-12-26   445   1.0    Initial version 
24
------------------------------------------------------------------------------
25
 
26
library ieee;
27
use ieee.std_logic_1164.all;
28
 
29
use work.slvtypes.all;
30
use work.fx2lib.all;
31
 
32
package tst_fx2looplib is
33
 
34
  constant c_ctltyp_2fifo_as : integer := 0; -- fx2ctl type: 2fifo_as
35
  constant c_ctltyp_2fifo_ic : integer := 1; -- fx2ctl type: 2fifo_ic
36
  constant c_ctltyp_3fifo_ic : integer := 2; -- fx2ctl type: 3fifo_ic
37
 
38
  constant c_mode_idle    : slv2 := "00"; -- mode: idle (no tx activity)
39
  constant c_mode_rxblast : slv2 := "01"; -- mode: rxblast (check rx activity)
40
  constant c_mode_txblast : slv2 := "10"; -- mode: txblast (saturate tx)
41
  constant c_mode_loop    : slv2 := "11"; -- mode: loop (rx->tx loop-back)
42
 
43
  type hio_cntl_type is record          -- humanio controls
44
    mode : slv2;                        -- mode (idle,(tx|tx)blast,loop)
45
    tx2blast : slbit;                   -- enable tx2 blast
46
    throttle : slbit;                   -- enable 1 msec tx throttling
47
  end record hio_cntl_type;
48
 
49
  constant hio_cntl_init : hio_cntl_type := (
50
    c_mode_idle,                        -- mode
51
    '0','0'                             -- tx2blast,throttle
52
  );
53
 
54
  type hio_stat_type is record          -- humanio status
55
    rxhold : slbit;                     -- rx hold
56
    txbusy : slbit;                     -- tx busy
57
    tx2busy : slbit;                    -- tx2 busy
58
    rxsecnt : slv16;                    -- rx sequence error counter
59
    rxcnt : slv32;                      -- rx word counter
60
    txcnt : slv32;                      -- tx word counter
61
    tx2cnt : slv32;                     -- tx2 word counter
62
  end record hio_stat_type;
63
 
64
  constant hio_stat_init : hio_stat_type := (
65
    '0','0','0',                        -- rxhold,txbusy,tx2busy
66
    (others=>'0'),                      -- rxsecnt
67
    (others=>'0'),                      -- rxcnt
68
    (others=>'0'),                      -- txcnt 
69
    (others=>'0')                       -- tx2cnt 
70
  );
71
 
72
-- -------------------------------------
73
 
74
component tst_fx2loop is                -- tester for serport components
75
  port (
76
    CLK : in slbit;                     -- clock
77
    RESET : in slbit;                   -- reset
78
    CE_MSEC : in slbit;                 -- msec pulse
79
    HIO_CNTL : in hio_cntl_type;        -- humanio controls
80
    HIO_STAT : out hio_stat_type;       -- humanio status
81
    FX2_MONI : in fx2ctl_moni_type;     -- fx2ctl monitor
82
    RXDATA : in slv8;                   -- receiver data out
83
    RXVAL : in slbit;                   -- receiver data valid
84
    RXHOLD : out slbit;                 -- receiver data hold
85
    TXDATA : out slv8;                  -- transmit data in
86
    TXENA : out slbit;                  -- transmit data enable
87
    TXBUSY : in slbit;                  -- transmit busy
88
    TX2DATA : out slv8;                 -- transmit 2 data in
89
    TX2ENA : out slbit;                 -- transmit 2 data enable
90
    TX2BUSY : in slbit                  -- transmit 2 busy
91
  );
92
end component;
93
 
94
component tst_fx2loop_hiomap is         -- default human I/O mapper
95
  port (
96
    CLK : in slbit;                     -- clock
97
    RESET : in slbit;                   -- reset
98
    HIO_CNTL : out hio_cntl_type;       -- tester controls from hio
99
    HIO_STAT : in hio_stat_type;        -- tester status to display by hio
100
    FX2_MONI : in fx2ctl_moni_type;     -- fx2ctl monitor to display by hio
101
    SWI : in slv8;                      -- switch settings
102
    BTN : in slv4;                      -- button settings
103
    LED : out slv8;                     -- led data
104
    DSP_DAT : out slv16;                -- display data
105
    DSP_DP : out slv4                   -- display decimal points
106
  );
107
end component;
108
 
109
end package tst_fx2looplib;

powered by: WebSVN 2.1.0

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