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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gdb/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [mips/] [basic.exp] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 jlechner
# MIPS simulator instruction tests
2
 
3
# As gross as it is, we unset the linker script specified by the target
4
# board.  The MIPS libgloss linker scripts include libgcc (and possibly
5
# other libraries), which the linker (used to link these tests rather
6
# than the compiler) can't necessarily find.
7
unset_currtarget_info ldscript
8
 
9
# Do "run_sim_test TESTFILE MODELS" for each combination of the
10
# mf{lo,hi} -> mult/div/mt{lo,hi} hazard described in mips.igen.
11
# Insert NOPS nops after the mflo or mfhi.
12
proc run_hilo_test {testfile models nops} {
13
    foreach reg {lo hi} {
14
        foreach insn "{mult\t\$4,\$4} {div\t\$0,\$4,\$4} {mt$reg\t\$4}" {
15
            set contents ""
16
            append contents "\t.macro hilo\n"
17
            append contents "\tmf$reg\t\$4\n"
18
            append contents "\t.rept\t$nops\n"
19
            append contents "\tnop\n"
20
            append contents "\t.endr\n"
21
            append contents "\t$insn\n"
22
            append contents "\t.endm"
23
 
24
            verbose -log "HILO test:\n$contents"
25
            set file [open hilo-hazard.inc w]
26
            puts $file $contents
27
            close $file
28
 
29
            run_sim_test $testfile $models
30
        }
31
    }
32
}
33
 
34
 
35
# Only test mips*-*-elf (e.g., no mips*-*-linux), and only test if the target
36
# board really is a simulator (sim tests don't work on real HW).
37
if {[istarget mips*-*-elf] && [board_info target exists is_simulator]} {
38
 
39
    set dspmodels ""
40
    set mdmxmodels ""
41
 
42
    if {[istarget mipsisa64sb1*-*-elf]} {
43
        set models "sb1"
44
        set submodels "mips1 mips2 mips3 mips4 mips32 mips64"
45
        append mdmxmodels " mips64"
46
    } elseif {[istarget mipsisa64*-*-elf]} {
47
        set models "mips32 mips64 mips32r2 mips64r2"
48
        set submodels "mips1 mips2 mips3 mips4"
49
        append dspmodels " mips32r2 mips64r2"
50
        append mdmxmodels " mips64 mips32r2 mips64r2"
51
    } elseif {[istarget mips*-sde-elf*]} {
52
        set models "mips32 mips64 mips32r2 mips64r2"
53
        set submodels ""
54
        append dspmodels " mips32r2 mips64r2"
55
        append mdmxmodels " mips64 mips32r2 mips64r2"
56
    } elseif {[istarget mipsisa32*-*-elf]} {
57
        set models "mips32 mips32r2"
58
        set submodels "mips1 mips2"
59
        append dspmodels " mips32r2"
60
        append mdmxmodels " mips32r2"
61
    } elseif {[istarget mips64vr*-*-elf]} {
62
        set models "vr4100 vr4111 vr4120 vr5000 vr5400 vr5500"
63
        set submodels "mips1 mips2 mips3 mips4"
64
    } elseif {[istarget mips64*-*-elf]} {
65
        set models "mips3"
66
        set submodels "mips1 mips2"
67
    } else {
68
        # fall back to just testing mips1 code.
69
        set models "mips1"
70
        set submodels ""
71
    }
72
    append submodels " " $models
73
    set cpu_option -march
74
 
75
    run_sim_test sanity.s $submodels
76
    foreach nops {0 1} {
77
        run_hilo_test hilo-hazard-1.s $models $nops
78
        run_hilo_test hilo-hazard-2.s $models $nops
79
    }
80
    run_hilo_test hilo-hazard-3.s $models 2
81
 
82
    run_sim_test fpu64-ps.s $submodels
83
    run_sim_test fpu64-ps-sb1.s $submodels
84
 
85
    run_sim_test mdmx-ob.s $mdmxmodels
86
    run_sim_test mdmx-ob-sb1.s $mdmxmodels
87
 
88
    run_sim_test mips32-dsp.s $dspmodels
89
    run_sim_test mips32-dsp2.s $dspmodels
90
}

powered by: WebSVN 2.1.0

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