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

Subversion Repositories ion

[/] [ion/] [trunk/] [src/] [memtest/] [memtest.s] - Diff between revs 50 and 66

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 50 Rev 66
Line 20... Line 20...
 
 
    #---- Set to >0 to enable a few debug messages
    #---- Set to >0 to enable a few debug messages
    .set DEBUG,         0
    .set DEBUG,         0
 
 
    #----
    #----
    .set XRAM_BASE,     0x80000000          # 1st XRAM address
    #.set XRAM_BASE,     0x80000000          # 1st XRAM address
    .set XRAM_MAX,      1024                # max. no. of KB to test for
    .set XRAM_MAX,      1024                # max. no. of KB to test for
 
 
    .set UART_BASE,     0x20000000          # UART base address
    .set UART_BASE,     0x20000000          # UART base address
    .set UART_TX,       0x0000              # TX reg offset
    .set UART_TX,       0x0000              # TX reg offset
    .set UART_STATUS,   0x0020              # status reg offset
    .set UART_STATUS,   0x0020              # status reg offset
Line 39... Line 39...
    .set    noreorder
    .set    noreorder
 
 
    b       start_test
    b       start_test
    nop
    nop
 
 
 
    .ifgt   0
    #--- Trap handler address: we don't expect any traps -----------------------
    #--- Trap handler address: we don't expect any traps -----------------------
    .org    0x3c
    #.org    0x3c
 
    .org    0x0180
interrupt_vector:
interrupt_vector:
    b       interrupt_vector
    b       interrupt_vector
    nop
    nop
 
    .endif
 
 
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
 
 
start_test:
start_test:
    mtc0    $0,$12              # disable interrupts
    mtc0    $0,$12              # disable interrupts
Line 61... Line 64...
    nop
    nop
    la      $a0,crlf
    la      $a0,crlf
    jal     puts
    jal     puts
    nop
    nop
 
 
    la      $t0,XRAM_BASE       # address of memory word being tested
    la      $t0,XRAM_BASE+4     # address of memory word being tested
    li      $t2,XRAM_MAX        # max amount of KBs to test for
    li      $t2,XRAM_MAX        # max amount of KBs to test for
    li      $t3,1               # (used to decrement $t2)
    li      $t3,1               # (used to decrement $t2)
    li      $t4,0               # no. of KBs found
    li      $t4,0               # no. of KBs found
    move    $t5,$t0             # keep the start addr at hand for comparison
    move    $t5,$t0             # keep the start addr at hand for comparison
 
 
Line 106... Line 109...
 
 
end_test:                       # test done, ramtop+1 in $t0, #KB in $t4
end_test:                       # test done, ramtop+1 in $t0, #KB in $t4
    la      $a0,msg1            # Print ramtop message...
    la      $a0,msg1            # Print ramtop message...
    jal     puts
    jal     puts
    nop
    nop
    move    $a0,$t0
    addi    $a0,$t0,-4          # substract the +4 offset we added before
    li      $a1,8
    li      $a1,8
    jal     put_hex
    jal     put_hex
    nop
    nop
    la      $a0,crlf
    la      $a0,crlf
    jal     puts
    jal     puts

powered by: WebSVN 2.1.0

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