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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [tests/] [ldm5.S] - Blame information for rev 87

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 82 csantifort
/*****************************************************************
2
//                                                              //
3
//  Amber 2 Core Instruction Test                               //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9
 
10
//                                                              //
11
//  Author(s):                                                  //
12
//      - Conor Santifort, csantifort.amber@gmail.com           //
13
//                                                              //
14
//////////////////////////////////////////////////////////////////
15
//                                                              //
16
// Copyright (C) 2010 Authors and OPENCORES.ORG                 //
17
//                                                              //
18
// This source file may be used and distributed without         //
19
// restriction provided that this copyright statement is not    //
20
// removed from the file and that any derivative work contains  //
21
// the original copyright notice and the associated disclaimer. //
22
//                                                              //
23
// This source file is free software; you can redistribute it   //
24
// and/or modify it under the terms of the GNU Lesser General   //
25
// Public License as published by the Free Software Foundation; //
26
// either version 2.1 of the License, or (at your option) any   //
27
// later version.                                               //
28
//                                                              //
29
// This source is distributed in the hope that it will be       //
30
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
31
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
32
// PURPOSE.  See the GNU Lesser General Public License for more //
33
// details.                                                     //
34
//                                                              //
35
// You should have received a copy of the GNU Lesser General    //
36
// Public License along with this source; if not, download it   //
37
// from http://www.opencores.org/lgpl.shtml                     //
38
//                                                              //
39
*****************************************************************/
40
 
41
#include "amber_registers.h"
42
 
43
        .section .text
44
        .globl  main
45
main:
46
        mov    r14, #100
47
        ldr    r13, Data1Base
48
        ldmia  r13!,{r1-r14}^  // load into user mode registers
49
 
50
        // supervisor r14 value should be unchanged
51
        mov    r0, r14
52
        cmp    r0, #100
53 87 csantifort
        bne    testfail
54
 
55
        // same test again, using r13 instead of r14
56
        mov    r13, #100
57
        ldr    r14, Data1Base
58
        ldmia  r14!,{r1-r13}^  // load into user mode registers
59
        mov    r0, r13
60
        cmp    r0, #100
61
        ldr    r1, Data14Base
62
        cmp    r1, r14
63
        bne    testfail
64
 
65 82 csantifort
        beq    testpass
66
 
67
testfail:
68
        ldr     r11, AdrTestStatus
69
        str     r10, [r11]
70
        b       testfail
71
 
72
testpass:
73
        ldr     r11, AdrTestStatus
74
        mov     r10, #17
75
        str     r10, [r11]
76
        b       testpass
77
 
78
 
79
/* Write 17 to  this address to generate a Test Passed message */
80
AdrTestStatus:  .word  ADR_AMBER_TEST_STATUS
81
Data1Base:      .word  Data1
82 87 csantifort
Data14Base:     .word  Data14
83 82 csantifort
Data1:          .word  0x00
84
                .word  0x01
85
                .word  0x02
86
                .word  0x03
87
                .word  0x04
88
                .word  0x05
89
                .word  0x06
90
                .word  0x07
91
                .word  0x08
92
                .word  0x09
93
                .word  0x0a
94
                .word  0x0b
95
                .word  0x0c
96 87 csantifort
Data14:         .word  0x0d
97 82 csantifort
                .word  0x0e
98
                .word  0x0f
99
                .word  0x10
100
 
101
/* ========================================================================= */
102
/* ========================================================================= */
103
 
104
 

powered by: WebSVN 2.1.0

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