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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [tests/] [ldrt.S] - Blame information for rev 82

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
//  Tests lrd and ldrb                                          //
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
 
47
/* Load Byte 0 */
48
        ldr     r0, AdrData1
49
        ldrb    r1, [r0]
50
        ldr     r2, Data2
51
        cmp     r1, r2
52
        movne   r10, #10
53
        bne     testfail
54
 
55
        b       testpass
56
 
57
testfail:
58
        ldr     r11, AdrTestStatus
59
        str     r10, [r11]
60
        b       testfail
61
 
62
testpass:
63
        ldr     r11, AdrTestStatus
64
        mov     r10, #17
65
        str     r10, [r11]
66
        b       testpass
67
 
68
 
69
/* Write 17 to this address to generate a Test Passed message */
70
AdrTestStatus:  .word  ADR_AMBER_TEST_STATUS
71
AdrData1:       .word  Data1
72
AdrData8:       .word  Data8
73
Data1:          .word  0x12345678
74
Data2:          .word  0x00000078
75
Data3:          .word  0x00000056
76
Data4:          .word  0x00000034
77
Data5:          .word  0x00000012
78
Data6:          .word  0xfecba987
79
Data7:          .word  0x78123456
80
Data8:          .word  0x34567812
81
Data9:          .word  0x33221100
82
 
83
/* ========================================================================= */
84
/* ========================================================================= */
85
 
86
 

powered by: WebSVN 2.1.0

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