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_wishbone/] [src/] [testbench/] [stend_sp605_wishbone.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 dsmv
-------------------------------------------------------------------------------
2
--
3
-- Title       : stend_sp605_wishbone 
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
--  Version 1.1 (25.10.2011) Kuzmi4
17
--      Description: add "assert" for stop simulation after TEST finished.
18
--
19
-------------------------------------------------------------------------------
20
 
21
 
22
library ieee;
23
use ieee.std_logic_1164.all;
24
use ieee.std_logic_textio.all;
25
 
26
library work;
27
 
28
use work.cmd_sim_pkg.all;
29
use work.block_pkg.all;
30
use work.sp605_lx45t_wishbone_pkg.all;
31
use work.xilinx_pcie_rport_m2_pkg.all;
32
 
33
use work.test_pkg.all;
34
 
35
use std.textio.all;
36
use std.textio;
37
 
38
entity stend_sp605_wishbone is
39
end stend_sp605_wishbone;
40
 
41
 
42
architecture stend_sp605_wishbone of stend_sp605_wishbone is
43
 
44
--component xilinx_pcie_2_0_rport_v6 is
45
--generic (
46
--          REF_CLK_FREQ   : integer;          -- 0 - 100 MHz, 1 - 125 MHz,  2 - 250 MHz
47
--          ALLOW_X8_GEN2  : boolean;
48
--          PL_FAST_TRAIN  : boolean;
49
--          LINK_CAP_MAX_LINK_SPEED : bit_vector;
50
--          DEVICE_ID : bit_vector;
51
--          LINK_CAP_MAX_LINK_WIDTH  : bit_vector;
52
--          LINK_CAP_MAX_LINK_WIDTH_int  : integer;
53
--          LINK_CTRL2_TARGET_LINK_SPEED  : bit_vector;
54
--          LTSSM_MAX_LINK_WIDTH  : bit_vector;
55
--          DEV_CAP_MAX_PAYLOAD_SUPPORTED : integer;
56
--          USER_CLK_FREQ : integer;
57
--          VC0_TX_LASTPACKET : integer;
58
--          VC0_RX_RAM_LIMIT : bit_vector;
59
--          VC0_TOTAL_CREDITS_PD : integer;
60
--          VC0_TOTAL_CREDITS_CD : integer
61
--);
62
--port  (
63
--
64
--  sys_clk : in std_logic;
65
--  sys_reset_n : in std_logic;
66
--
67
--  pci_exp_rxn : in std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0);
68
--  pci_exp_rxp : in std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0);
69
--  pci_exp_txn : out std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0);
70
--  pci_exp_txp : out std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0)
71
--
72
--);
73
--end component;
74
 
75
signal  clk125                  : std_logic:='0';
76
signal  clk125p                 : std_logic;
77
signal  clk125n                 : std_logic;
78
 
79
signal  clk100                  : std_logic:='0';
80
signal  clk100p                 : std_logic;
81
signal  clk100n                 : std_logic;
82
 
83
signal  reset                   : std_logic;
84
 
85
signal  txp                             : std_logic_vector( 0 downto 0 ):=(others=>'0');
86
signal  txn                             : std_logic_vector( 0 downto 0 ):=(others=>'1');
87
signal  rxp                             : std_logic_vector( 0 downto 0 ):=(others=>'0');
88
signal  rxn                             : std_logic_vector( 0 downto 0 ):=(others=>'1');
89
 
90
signal  rp_txp                  : std_logic_vector( 0 downto 0 ):=(others=>'0');
91
signal  rp_txn                  : std_logic_vector( 0 downto 0 ):=(others=>'1');
92
signal  rp_rxp                  : std_logic_vector( 0 downto 0 ):=(others=>'0');
93
signal  rp_rxn                  : std_logic_vector( 0 downto 0 ):=(others=>'1');
94
 
95
signal  tp                              : std_logic_vector( 3 downto 1 );
96
signal  led1                    : std_logic;
97
signal  led2                    : std_logic;
98
signal  led3                    : std_logic;
99
signal  led4                    : std_logic;
100
 
101
signal  cmd                             : bh_cmd;       -- команда
102
signal  ret                             : bh_ret;       -- ответ
103
 
104
--
105
-- Additional TEST signals:
106
--
107
signal  s_spy_fifo_clk              :   std_logic:='0';
108
signal  s_spy_fifo_wr_ena           :   std_logic:='0';
109
signal  s_spy_fifo_final            :   std_logic:='0';
110
signal  si_wb_outgoing_fifo_counter :   integer:=0;
111
 
112
 
113
begin
114
 
115
 dut: sp605_lx45t_wishbone
116
        generic map(
117
                is_simulation   => 2    -- 0 - синтез, 1 - моделирование ADM, 2 - моделирование pcie_core  
118
        )
119
        port map(
120
                ---- PCI-Express ----
121
                pci_exp_txp                     => txp,
122
                pci_exp_txn                     => txn,
123
 
124
                pci_exp_rxp                     => rxp,
125
                pci_exp_rxn                     => rxn,
126
 
127
                sys_clk_p                       => clk125p,   -- тактовая частота 125 MHz от PCI_Express
128
                sys_clk_n                       => clk125n,
129
 
130
                sys_reset_n                     => reset,       -- 0 - сброс                                               
131
 
132
 
133
                ---- Светодиоды ----
134
                gpio_led1                       => led1,
135
                gpio_led2                       => led2,
136
                gpio_led3                       => led3,
137
                gpio_led0                       => led4
138
        );
139
 
140
 
141
rp : xilinx_pcie_rport_m2
142
generic map (
143
      REF_CLK_FREQ => 0,
144
      ALLOW_X8_GEN2 => FALSE,
145
      PL_FAST_TRAIN => TRUE,
146
      LINK_CAP_MAX_LINK_SPEED => X"1",
147
      DEVICE_ID => X"6011",
148
      LINK_CAP_MAX_LINK_WIDTH => X"01",
149
      LINK_CAP_MAX_LINK_WIDTH_int => 1,
150
      LINK_CTRL2_TARGET_LINK_SPEED => X"1",
151
      LTSSM_MAX_LINK_WIDTH => X"01",
152
      DEV_CAP_MAX_PAYLOAD_SUPPORTED => 2,
153
      VC0_TX_LASTPACKET => 29,
154
      VC0_RX_RAM_LIMIT => X"7FF",
155
      VC0_TOTAL_CREDITS_PD => (308),
156
      VC0_TOTAL_CREDITS_CD => (308),
157
      USER_CLK_FREQ => 1
158
)
159
port map (
160
 
161
                sys_clk => clk100,
162
                sys_reset_n => reset,
163
 
164
                pci_exp_txn => rp_txn,
165
                pci_exp_txp => rp_txp,
166
                pci_exp_rxn => rp_rxn,
167
                pci_exp_rxp => rp_rxp,
168
 
169
                cmd                     => cmd, -- команда
170
                ret                     => ret  -- ответ
171
 
172
);
173
 
174
 
175
clk125 <= not clk125 after 4 ns;
176
 
177
clk125p <= clk125;
178
clk125n <= not clk125;
179
 
180
clk100 <= not clk100 after 5 ns;
181
 
182
clk100p <= clk100;
183
clk100n <= not clk100;
184
 
185
rxp(0) <= rp_txp(0);
186
rxn(0) <= rp_txn(0);
187
 
188
rp_rxp(0) <= txp(0);
189
rp_rxn(0) <= txn(0);
190
 
191
reset <= '0', '1' after 5002 ns;
192
 
193
pr_main: process
194
 
195
variable        data    : std_logic_vector( 31 downto 0 );
196
variable        str     : LINE;         -- pointer to string
197
 
198
begin
199
 
200
    --test_init( "src\log\test.log" );
201
    test_init( "test.log" );
202
 
203
    wait for 180 us;
204
 
205
    --test_dsc_incorrect( cmd, ret );
206
    test_read_4kb( cmd, ret );      -- was original
207
    --test_adm_read_8kb( cmd, ret );
208
    --test_adm_read_16kb( cmd, ret );
209
    --test_adm_write_16kb( cmd, ret );
210
    --test_block_main( cmd, ret );
211
 
212
    --test_num_1(cmd, ret);
213
    --test_num_2(cmd, ret);
214
 
215
    --test_wb_1(cmd, ret);
216
    --test_wb_2(cmd, ret);
217
 
218
    test_close;
219
    --
220
    -- Print Final Banner
221
    report "Init END OF TEST" severity WARNING;
222
    assert false
223
    report "End of TEST; Ending simulation (not a Failure)"
224
    severity FAILURE;
225
    wait;
226
 
227
end process pr_main;
228
 
229
end stend_sp605_wishbone;

powered by: WebSVN 2.1.0

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