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

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [projects/] [ambpex5_v20_sx50t_core/] [src/] [testbench/] [stend_ambpex5_core_m2.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dsmv
-------------------------------------------------------------------------------
2
--
3
-- Title       : stend_ambpex5_core
4
-- Author      : Dmitry Smekhov
5
-- Company     : Instrumental Systems
6
-- E-mail      : dsmv@insys.ru
7
--
8
-- Version     : 1.0
9
--
10
-------------------------------------------------------------------------------
11
--
12
-- Description : 
13
--
14
-------------------------------------------------------------------------------
15
 
16
 
17
library ieee;
18
use ieee.std_logic_1164.all;
19
use ieee.std_logic_textio.all;
20
 
21
library work;
22
 
23
use work.cmd_sim_pkg.all;
24
use work.block_pkg.all;
25
use work.ambpex5_v20_sx50t_core_pkg.all;
26
use work.xilinx_pcie_rport_m2_pkg.all;
27
 
28
use work.test_pkg.all;
29
 
30
use std.textio.all;
31
use std.textio;
32
 
33
entity stend_ambpex5_core_m2 is
34
end stend_ambpex5_core_m2;
35
 
36
 
37
architecture stend_ambpex5_core_m2 of stend_ambpex5_core_m2 is
38
 
39
--component xilinx_pcie_2_0_rport_v6 is
40
--generic (
41
--          REF_CLK_FREQ   : integer;          -- 0 - 100 MHz, 1 - 125 MHz,  2 - 250 MHz
42
--          ALLOW_X8_GEN2  : boolean;
43
--          PL_FAST_TRAIN  : boolean;
44
--          LINK_CAP_MAX_LINK_SPEED : bit_vector;
45
--          DEVICE_ID : bit_vector;
46
--          LINK_CAP_MAX_LINK_WIDTH  : bit_vector;
47
--          LINK_CAP_MAX_LINK_WIDTH_int  : integer;
48
--          LINK_CTRL2_TARGET_LINK_SPEED  : bit_vector;
49
--          LTSSM_MAX_LINK_WIDTH  : bit_vector;
50
--          DEV_CAP_MAX_PAYLOAD_SUPPORTED : integer;
51
--          USER_CLK_FREQ : integer;
52
--          VC0_TX_LASTPACKET : integer;
53
--          VC0_RX_RAM_LIMIT : bit_vector;
54
--          VC0_TOTAL_CREDITS_PD : integer;
55
--          VC0_TOTAL_CREDITS_CD : integer
56
--);
57
--port  (
58
--
59
--  sys_clk : in std_logic;
60
--  sys_reset_n : in std_logic;
61
--
62
--  pci_exp_rxn : in std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0);
63
--  pci_exp_rxp : in std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0);
64
--  pci_exp_txn : out std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0);
65
--  pci_exp_txp : out std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0)
66
--
67
--);
68
--end component;
69
 
70
signal  clk250                  : std_logic:='0';
71
signal  clk250p                 : std_logic;
72
signal  clk250n                 : std_logic;
73
 
74
signal  clk100                  : std_logic:='0';
75
 
76
signal  reset                   : std_logic;
77
 
78
signal  txp                             : std_logic_vector( 7 downto 0 ):=(others=>'0');
79
signal  txn                             : std_logic_vector( 7 downto 0 ):=(others=>'1');
80
signal  rxp                             : std_logic_vector( 7 downto 0 ):=(others=>'0');
81
signal  rxn                             : std_logic_vector( 7 downto 0 ):=(others=>'1');
82
 
83
signal  rp_txp                  : std_logic_vector( 0 downto 0 ):=(others=>'0');
84
signal  rp_txn                  : std_logic_vector( 0 downto 0 ):=(others=>'1');
85
signal  rp_rxp                  : std_logic_vector( 0 downto 0 ):=(others=>'0');
86
signal  rp_rxn                  : std_logic_vector( 0 downto 0 ):=(others=>'1');
87
 
88
signal  tp                              : std_logic_vector( 3 downto 1 );
89
signal  led1                    : std_logic;
90
signal  led2                    : std_logic;
91
signal  led3                    : std_logic;
92
signal  led4                    : std_logic;
93
 
94
signal  cmd                             : bh_cmd;       -- команда
95
signal  ret                             : bh_ret;       -- ответ
96
 
97
 
98
begin
99
 
100
 amb: ambpex5_v20_sx50t_core
101
        generic map(
102
                is_simulation   => 2    -- 0 - синтез, 1 - моделирование ADM, 2 - моделирование pcie_core  
103
        )
104
        port map(
105
                ---- PCI-Express ----
106
                txp                                     => txp,
107
                txn                                     => txn,
108
 
109
                rxp                                     => rxp,
110
                rxn                                     => rxn,
111
 
112
                mgt251_p                        => clk250p,   -- тактовая частота 250 MHz от PCI_Express
113
                mgt251_n                        => clk250n,
114
 
115
                bperst                          => reset,       -- 0 - сброс                                               
116
 
117
                btp                                     => tp, -- контрольные точки
118
 
119
                ---- Светодиоды ----
120
                bled1                           => led1,
121
                bled2                           => led2,
122
                bled3                           => led3,
123
                bled4                           => led4
124
        );
125
 
126
 
127
rp : xilinx_pcie_rport_m2
128
generic map (
129
      REF_CLK_FREQ => 0,
130
      ALLOW_X8_GEN2 => FALSE,
131
      PL_FAST_TRAIN => TRUE,
132
      LINK_CAP_MAX_LINK_SPEED => X"1",
133
      DEVICE_ID => X"6011",
134
      LINK_CAP_MAX_LINK_WIDTH => X"01",
135
      LINK_CAP_MAX_LINK_WIDTH_int => 1,
136
      LINK_CTRL2_TARGET_LINK_SPEED => X"1",
137
      LTSSM_MAX_LINK_WIDTH => X"01",
138
      DEV_CAP_MAX_PAYLOAD_SUPPORTED => 2,
139
      VC0_TX_LASTPACKET => 29,
140
      VC0_RX_RAM_LIMIT => X"7FF",
141
      VC0_TOTAL_CREDITS_PD => (308),
142
      VC0_TOTAL_CREDITS_CD => (308),
143
      USER_CLK_FREQ => 1
144
)
145
port map (
146
 
147
                sys_clk => clk100,
148
                sys_reset_n => reset,
149
 
150
                pci_exp_txn => rp_txn,
151
                pci_exp_txp => rp_txp,
152
                pci_exp_rxn => rp_rxn,
153
                pci_exp_rxp => rp_rxp,
154
 
155
                cmd                     => cmd, -- команда
156
                ret                     => ret  -- ответ
157
 
158
);
159
 
160
 
161
clk100 <= not clk100 after 5 ns;
162
clk250 <= not clk250 after 2 ns;
163
 
164
clk250p <= clk250;
165
clk250n <= not clk250;
166
 
167
rxp(0) <= rp_txp(0);
168
rxn(0) <= rp_txn(0);
169
 
170
rp_rxp(0) <= txp(0);
171
rp_rxn(0) <= txn(0);
172
 
173
reset <= '0', '1' after 5002 ns;
174
 
175
pr_main: process
176
 
177
variable        data    : std_logic_vector( 31 downto 0 );
178
variable        str     : LINE;         -- pointer to string
179
begin
180
 
181
        --test_init( "src\log\test.log" );
182
        test_init( "test.log" );
183
 
184
        wait for 180 us;
185
 
186
 
187
        --test_dsc_incorrect( cmd, ret );          
188
 
189
        --test_read_4kb( cmd, ret );
190
        --test_adm_read_8kb( cmd, ret );
191
        test_adm_read_16kb( cmd, ret );
192
        --test_adm_write_16kb( cmd, ret );
193
        --test_block_main( cmd, ret );
194
 
195
        test_close;
196
        --
197
        -- Print Final Banner
198
        report "Init END OF TEST" severity WARNING;
199
        assert false
200
        report "End of TEST; Ending simulation (not a Failure)"
201
        severity FAILURE;
202
        wait;
203
 
204
end process;
205
 
206
end stend_ambpex5_core_m2;

powered by: WebSVN 2.1.0

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