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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [tests/] [inflate_bug.S] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 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
//  A load store sequence was found to not execute correctly.   //
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
        @ setup
48
        mov     r9, #4
49
        ldr     lr, =Data2
50
        add     lr, lr, #2
51
 
52
        @ -------------------------------------
53
        @ Replicated code from Linux Kernel
54
        @ -------------------------------------
55
        ldr     r2, Data1
56
        ldr     r3, [lr, #4]
57
        ldr     r1, [r2]
58
        strb    r3, [r1, r9]
59
 
60
        @ -------------------------------------
61
        @ Check correct value was saved
62
        @ -------------------------------------
63
        ldrb    r6, [r1, r9]
64
        cmp     r6, #0x22
65
        movne   r10, #10
66
        bne     testfail
67
        b       testpass
68
 
69
 
70
testfail:
71
        ldr     r11, AdrTestStatus
72
        str     r10, [r11]
73
        b       testfail
74
 
75
testpass:
76
        ldr     r11, AdrTestStatus
77
        mov     r10, #17
78
        str     r10, [r11]
79
        b       testpass
80
 
81
 
82
 
83
/* Write 17 to this address to generate a Test Passed message */
84
AdrTestStatus:        .word ADR_AMBER_TEST_STATUS
85
AdrFrame:             .word 0x400
86
AdrDataBase:          .word Data1
87
 
88
Data1:                .word Data4
89
Data2:                .word 0x7777aaaa
90
Data3:                .word 0x11225566
91
Data4:                .word Data5
92
Data5:                .word 0x33448899
93
 
94
Expected:             .word 0x71f8
95
 
96
 
97
/* ========================================================================= */
98
/* ========================================================================= */
99
 
100
 

powered by: WebSVN 2.1.0

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