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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [test-code-or1k/] [cfg/] [cfg.S] - Blame information for rev 791

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 90 jeremybenn
/* cfg.s. CPU configuration test of Or1ksim
2
 
3
   Copyright (C) 1999-2006 OpenCores
4
   Copyright (C) 2010 Embecosm Limited
5
 
6
   Contributors various OpenCores participants
7
   Contributor Jeremy Bennett 
8
 
9
   This file is part of OpenRISC 1000 Architectural Simulator.
10
 
11
   This program is free software; you can redistribute it and/or modify it
12
   under the terms of the GNU General Public License as published by the Free
13
   Software Foundation; either version 3 of the License, or (at your option)
14
   any later version.
15
 
16
   This program is distributed in the hope that it will be useful, but WITHOUT
17
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
19
   more details.
20
 
21
   You should have received a copy of the GNU General Public License along
22
   with this program.  If not, see .  */
23
 
24
/* ----------------------------------------------------------------------------
25
   This code is commented throughout for use with Doxygen.
26
   --------------------------------------------------------------------------*/
27
 
28
#include "spr-defs.h"
29
 
30 458 julius
        .section .except,"ax"
31 90 jeremybenn
        .org 0x100
32
_reset:
33 787 jeremybenn
        // Clear R0 on start-up. There is no guarantee that R0 is hardwired to zero,
34
        // and indeed it is not when simulating the or1200 Verilog core.
35
        l.andi  r0,r0,0x0
36
 
37 90 jeremybenn
        l.addi  r1,r0,0x7f00
38
        l.movhi r2,hi(_main)
39
        l.ori   r2,r2,lo(_main)
40
        l.jr    r2
41
        l.nop
42
 
43 458 julius
        .section .text
44 90 jeremybenn
_main:
45
        l.addi  r2,r0,0
46
 
47
        l.mfspr r3,r0,SPR_VR            /* Version */
48
  l.nop NOP_REPORT
49
        l.add   r2,r2,r3
50
 
51
        l.mfspr r3,r0,SPR_UPR           /* Unit Present */
52
  l.nop NOP_REPORT
53
        l.add   r2,r2,r3
54
 
55
        l.mfspr r4,r0,SPR_PMR           /* Power Management */
56
        l.addi  r3,r0,0
57
        l.mtspr r0,r3,SPR_PMR
58
        l.mfspr r3,r0,SPR_PMR
59
        l.andi  r3,r3,0xff
60
        l.nop NOP_REPORT
61
        l.add   r2,r2,r3
62
 
63
        l.addi  r3,r0,5
64
        l.mtspr r0,r3,SPR_PMR
65
        l.mfspr r3,r0,SPR_PMR
66
        l.andi  r3,r3,0xff
67
        l.nop NOP_REPORT
68
        l.add   r2,r2,r3
69
 
70
        l.mtspr r0,r4,SPR_PMR
71
 
72
        l.mfspr r3,r0,SPR_CPUCFGR
73
        l.nop NOP_REPORT
74
        l.add   r2,r2,r3
75
 
76
        l.mfspr r3,r0,SPR_DMMUCFGR
77
        l.nop NOP_REPORT
78
        l.add   r2,r2,r3
79
 
80
        l.mfspr r3,r0,SPR_IMMUCFGR
81
        l.nop NOP_REPORT
82
        l.add   r2,r2,r3
83
 
84
        l.mfspr r3,r0,SPR_DCCFGR
85
        l.nop NOP_REPORT
86
        l.add   r2,r2,r3
87
 
88
        l.mfspr r3,r0,SPR_ICCFGR
89
        l.nop NOP_REPORT
90
        l.add   r2,r2,r3
91
 
92
        l.mfspr r3,r0,SPR_DCFGR
93
        l.nop NOP_REPORT
94
        l.add   r2,r2,r3
95
 
96
        l.mfspr r3,r0,SPR_PCCFGR
97
        l.nop NOP_REPORT
98
        l.add   r2,r2,r3
99
 
100
        /* Configurations may differ, so we will insert another report*/
101
        l.movhi r3,hi(0xdeacf5cc)
102
        l.ori   r3,r3,lo(0xdeacf5cc)
103
        l.add   r3,r2,r3
104
  l.nop NOP_REPORT
105
 
106
        l.movhi r3,hi(0xdeaddead)
107
        l.ori   r3,r3,lo(0xdeaddead)
108
  l.nop NOP_REPORT
109
        l.addi  r3,r0,0
110
        l.nop NOP_EXIT

powered by: WebSVN 2.1.0

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