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

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [projects/] [ambpex5_sx50t_wishbone/] [src/] [testbench/] [test_pkg.vhd] - Diff between revs 21 and 29

Show entire file | Details | Blame | View Log

Rev 21 Rev 29
Line 442... Line 442...
variable        str                             : line;
variable        str                             : line;
 
 
variable        error                   : integer:=0;
variable        error                   : integer:=0;
variable        dma_complete    : integer;
variable        dma_complete    : integer;
 
 
 
variable        status                  : std_logic_vector( 31 downto 0 );
 
variable        reg_block_wr    : std_logic_vector( 31 downto 0 );
 
 
begin
begin
 
 
        write( str, string'("TEST_ADM_READ_8KB" ));
        write( str, string'("TEST_ADM_READ_8KB" ));
        writeline( log, str );
        writeline( log, str );
 
 
Line 471... Line 474...
        int_mem_write( cmd, ret, x"001001F8",  x"00000000" );
        int_mem_write( cmd, ret, x"001001F8",  x"00000000" );
        int_mem_write( cmd, ret, x"001001FC",  x"D6644953" );
        int_mem_write( cmd, ret, x"001001FC",  x"D6644953" );
 
 
 
 
        ---- Программирование канала DMA ----
        ---- Программирование канала DMA ----
        block_write( cmd, ret, 4, 8, x"00000027" );             -- DMA_MODE 
        block_write( cmd, ret, 5, 8, x"00000027" );             -- DMA_MODE 
        block_write( cmd, ret, 4, 9, x"00000010" );             -- DMA_CTRL - RESET FIFO 
        block_write( cmd, ret, 5, 9, x"00000010" );             -- DMA_CTRL - RESET FIFO 
 
 
        block_write( cmd, ret, 4, 20, x"00100000" );    -- PCI_ADRL 
        block_write( cmd, ret, 5, 20, x"00100000" );    -- PCI_ADRL 
        block_write( cmd, ret, 4, 21, x"00100000" );    -- PCI_ADRH  
        block_write( cmd, ret, 5, 21, x"00100000" );    -- PCI_ADRH  
        block_write( cmd, ret, 4, 23, TEST_GEN_WB_BURST_SLAVE );        -- LOCAL_ADR 
        block_write( cmd, ret, 5, 23, TEST_GEN_WB_BURST_SLAVE );        -- LOCAL_ADR 
 
 
 
 
        wb_block_gen_write( cmd, ret, REG_TEST_GEN_CTRL, x"00000001" ); -- reset
        wb_block_gen_write( cmd, ret, REG_TEST_GEN_CTRL, x"00000001" ); -- reset
        wb_block_gen_write( cmd, ret, REG_TEST_GEN_CTRL, x"00000000" );
        wb_block_gen_write( cmd, ret, REG_TEST_GEN_CTRL, x"00000000" );
        wb_block_gen_read( cmd, ret, REG_BLOCK_ID, data ); -- read block id
        wb_block_gen_read( cmd, ret, REG_BLOCK_ID, data ); -- read block id
Line 488... Line 491...
        hwrite( str, data );
        hwrite( str, data );
        writeline( log, str );
        writeline( log, str );
 
 
        wb_block_gen_write( cmd, ret, REG_TEST_GEN_SIZE, x"00000001" ); -- size of block = 4 kByte
        wb_block_gen_write( cmd, ret, REG_TEST_GEN_SIZE, x"00000001" ); -- size of block = 4 kByte
 
 
        block_write( cmd, ret, 4, 9, x"00000001" );             -- DMA_CTRL - START 
        block_write( cmd, ret, 5, 9, x"00000001" );             -- DMA_CTRL - START 
 
 
 
        wb_block_gen_read( cmd, ret, REG_TEST_GEN_STATUS, status );             -- read status
 
        write( str, string'("WB_GEN_STATUS: " )); hwrite( str, status( 31 downto 0 ) ); writeline( log, str );
 
        wb_block_gen_read( cmd, ret, REG_TEST_GEN_BL_WR,  reg_block_wr );       -- read block_wr
 
        write( str, string'("WB_GEN_BL_WR:  " )); hwrite( str, reg_block_wr( 31 downto 0 ) ); writeline( log, str );
 
 
 
 
        wb_block_gen_write( cmd, ret, REG_TEST_GEN_CTRL, x"000006A0" ); -- start test sequence  
        wb_block_gen_write( cmd, ret, REG_TEST_GEN_CTRL, x"000006A0" ); -- start test sequence  
 
 
        wait for 20 us;
        wait for 20 us;
 
 
        block_read( cmd, ret, 4, 16, data );                    -- STATUS 
        block_read( cmd, ret, 5, 16, data );                    -- STATUS 
 
 
        write( str, string'("STATUS: " )); hwrite( str, data( 15 downto 0 ) );
        write( str, string'("STATUS: " )); hwrite( str, data( 15 downto 0 ) );
        if( data( 8 )='1' ) then
        if( data( 8 )='1' ) then
                write( str, string'(" - descriptor is correct" ));
                write( str, string'(" - descriptor is correct" ));
        else
        else
Line 512... Line 521...
 
 
                ---- Ожидание завершения DMA ----
                ---- Ожидание завершения DMA ----
                dma_complete := 0;
                dma_complete := 0;
                for ii in 0 to 100 loop
                for ii in 0 to 100 loop
 
 
                block_read( cmd, ret, 4, 16, data );                    -- STATUS 
                block_read( cmd, ret, 5, 16, data );                    -- STATUS 
                write( str, string'("STATUS: " )); hwrite( str, data( 15 downto 0 ) );
                write( str, string'("STATUS: " )); hwrite( str, data( 15 downto 0 ) );
                        if( data(5)='1' ) then
                        if( data(5)='1' ) then
                                write( str, string'(" - DMA finished " ));
                                write( str, string'(" - DMA finished " ));
                                dma_complete := 1;
                                dma_complete := 1;
 
 
                                block_write( cmd, ret, 4, 16#11#, x"00000010" );                -- FLAG_CLR - reset EOT 
                                block_write( cmd, ret, 5, 16#11#, x"00000010" );                -- FLAG_CLR - reset EOT 
 
 
                        end if;
                        end if;
                        writeline( log, str );
                        writeline( log, str );
 
 
                        if( dma_complete=1 ) then
                        if( dma_complete=1 ) then
Line 541... Line 550...
                        error:=error+1;
                        error:=error+1;
                end if;
                end if;
 
 
        end if;
        end if;
 
 
 
        wb_block_gen_read( cmd, ret, REG_TEST_GEN_STATUS, status );             -- read status
 
        write( str, string'("WB_GEN_STATUS: " )); hwrite( str, status( 31 downto 0 ) ); writeline( log, str );
 
        wb_block_gen_read( cmd, ret, REG_TEST_GEN_BL_WR,  reg_block_wr );       -- read block_wr
 
        write( str, string'("WB_GEN_BL_WR:  " )); hwrite( str, reg_block_wr( 31 downto 0 ) ); writeline( log, str );
 
 
 
 
        for ii in 0 to 3 loop
        for ii in 0 to 3 loop
 
 
                block_read( cmd, ret, 4, 16, data );                    -- STATUS 
                block_read( cmd, ret, 5, 16, data );                    -- STATUS 
                write( str, string'("STATUS: " )); hwrite( str, data( 15 downto 0 ) );
                write( str, string'("STATUS: " )); hwrite( str, data( 15 downto 0 ) );
                writeline( log, str );
                writeline( log, str );
                wait for 500 ns;
                wait for 500 ns;
 
 
        end loop;
        end loop;
 
 
 
 
        block_write( cmd, ret, 4, 9, x"00000000" );             -- DMA_CTRL - STOP      
        block_write( cmd, ret, 5, 9, x"00000000" );             -- DMA_CTRL - STOP      
 
 
        write( str, string'(" Block 0 - read: " ));
        write( str, string'(" Block 0 - read: " ));
        writeline( log, str );
        writeline( log, str );
 
 
        for ii in 0 to 15 loop
        for ii in 0 to 15 loop

powered by: WebSVN 2.1.0

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