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

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [projects/] [sp605_lx45t_core/] [src/] [testbench/] [stend_sp605_core_m2.vhd] - Blame information for rev 37

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.sp605_lx45t_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  clk125                  : std_logic:='0';
71
signal  clk125p                 : std_logic;
72
signal  clk125n                 : std_logic;
73
 
74
signal  clk100                  : std_logic:='0';
75
signal  clk100p                 : std_logic;
76
signal  clk100n                 : std_logic;
77
 
78
signal  reset                   : std_logic;
79
 
80
signal  txp                             : std_logic_vector( 0 downto 0 ):=(others=>'0');
81
signal  txn                             : std_logic_vector( 0 downto 0 ):=(others=>'1');
82
signal  rxp                             : std_logic_vector( 0 downto 0 ):=(others=>'0');
83
signal  rxn                             : std_logic_vector( 0 downto 0 ):=(others=>'1');
84
 
85
signal  rp_txp                  : std_logic_vector( 0 downto 0 ):=(others=>'0');
86
signal  rp_txn                  : std_logic_vector( 0 downto 0 ):=(others=>'1');
87
signal  rp_rxp                  : std_logic_vector( 0 downto 0 ):=(others=>'0');
88
signal  rp_rxn                  : std_logic_vector( 0 downto 0 ):=(others=>'1');
89
 
90
signal  tp                              : std_logic_vector( 3 downto 1 );
91
signal  led1                    : std_logic;
92
signal  led2                    : std_logic;
93
signal  led3                    : std_logic;
94
signal  led4                    : std_logic;
95
 
96
signal  cmd                             : bh_cmd;       -- команда
97
signal  ret                             : bh_ret;       -- ответ
98
 
99
 
100
begin
101
 
102
 amb: sp605_lx45t_core
103
        generic map(
104
                is_simulation   => 2    -- 0 - синтез, 1 - моделирование ADM, 2 - моделирование pcie_core  
105
        )
106
        port map(
107
                ---- PCI-Express ----
108
                pci_exp_txp                     => txp,
109
                pci_exp_txn                     => txn,
110
 
111
                pci_exp_rxp                     => rxp,
112
                pci_exp_rxn                     => rxn,
113
 
114
                sys_clk_p                       => clk125p,   -- тактовая частота 125 MHz от PCI_Express
115
                sys_clk_n                       => clk125n,
116
 
117
                sys_reset_n                     => reset,       -- 0 - сброс                                               
118
 
119
 
120
                ---- Светодиоды ----
121
                gpio_led1                       => led1,
122
                gpio_led2                       => led2,
123
                gpio_led3                       => led3,
124
                gpio_led0                       => led4
125
        );
126
 
127
 
128
rp : xilinx_pcie_rport_m2
129
generic map (
130
      REF_CLK_FREQ => 0,
131
      ALLOW_X8_GEN2 => FALSE,
132
      PL_FAST_TRAIN => TRUE,
133
      LINK_CAP_MAX_LINK_SPEED => X"1",
134
      DEVICE_ID => X"6011",
135
      LINK_CAP_MAX_LINK_WIDTH => X"01",
136
      LINK_CAP_MAX_LINK_WIDTH_int => 1,
137
      LINK_CTRL2_TARGET_LINK_SPEED => X"1",
138
      LTSSM_MAX_LINK_WIDTH => X"01",
139
      DEV_CAP_MAX_PAYLOAD_SUPPORTED => 2,
140
      VC0_TX_LASTPACKET => 29,
141
      VC0_RX_RAM_LIMIT => X"7FF",
142
      VC0_TOTAL_CREDITS_PD => (308),
143
      VC0_TOTAL_CREDITS_CD => (308),
144
      USER_CLK_FREQ => 1
145
)
146
port map (
147
 
148
                sys_clk => clk100,
149
                sys_reset_n => reset,
150
 
151
                pci_exp_txn => rp_txn,
152
                pci_exp_txp => rp_txp,
153
                pci_exp_rxn => rp_rxn,
154
                pci_exp_rxp => rp_rxp,
155
 
156
                cmd                     => cmd, -- команда
157
                ret                     => ret  -- ответ
158
 
159
);
160
 
161
 
162
clk125 <= not clk125 after 4 ns;
163
 
164
clk125p <= clk125;
165
clk125n <= not clk125;
166
 
167
clk100 <= not clk100 after 5 ns;
168
 
169
clk100p <= clk100;
170
clk100n <= not clk100;
171
 
172
rxp(0) <= rp_txp(0);
173
rxn(0) <= rp_txn(0);
174
 
175
rp_rxp(0) <= txp(0);
176
rp_rxn(0) <= txn(0);
177
 
178
reset <= '0', '1' after 5002 ns;
179
 
180
pr_main: process
181
 
182
variable        data    : std_logic_vector( 31 downto 0 );
183
variable        str     : LINE;         -- pointer to string
184
begin
185
 
186 37 dsmv
        test_init( "src\log\test.log" );
187
        --test_init( "test.log" );
188 2 dsmv
 
189
        wait for 180 us;
190
 
191
 
192
        --test_dsc_incorrect( cmd, ret );          
193
 
194
        --test_read_4kb( cmd, ret );
195
        --test_adm_read_8kb( cmd, ret );
196
        test_adm_read_16kb( cmd, ret );
197
        --test_adm_write_16kb( cmd, ret );
198
        --test_block_main( cmd, ret );
199
 
200
        test_close;
201
        wait;
202
 
203
end process;
204
 
205
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.