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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [template_periph_16b.s43] - Blame information for rev 219

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

Line No. Rev Author Line
1 2 olivier.gi
/*===========================================================================*/
2
/* Copyright (C) 2001 Authors                                                */
3
/*                                                                           */
4
/* This source file may be used and distributed without restriction provided */
5
/* that this copyright statement is not removed from the file and that any   */
6
/* derivative work contains the original copyright notice and the associated */
7
/* disclaimer.                                                               */
8
/*                                                                           */
9
/* This source file is free software; you can redistribute it and/or modify  */
10
/* it under the terms of the GNU Lesser General Public License as published  */
11
/* by the Free Software Foundation; either version 2.1 of the License, or    */
12
/* (at your option) any later version.                                       */
13
/*                                                                           */
14
/* This source is distributed in the hope that it will be useful, but WITHOUT*/
15
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     */
16
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public       */
17
/* License for more details.                                                 */
18
/*                                                                           */
19
/* You should have received a copy of the GNU Lesser General Public License  */
20
/* along with this source; if not, write to the Free Software Foundation,    */
21
/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA        */
22
/*                                                                           */
23
/*===========================================================================*/
24
/*                    16 BIT PERIPHERAL TEMPLATE                             */
25
/*---------------------------------------------------------------------------*/
26
/* Test the 16 bit peripheral template:                                      */
27
/*                                     - Read/Write register access.         */
28 18 olivier.gi
/*                                                                           */
29
/* Author(s):                                                                */
30
/*             - Olivier Girard,    olgirard@gmail.com                       */
31
/*                                                                           */
32
/*---------------------------------------------------------------------------*/
33 19 olivier.gi
/* $Rev: 200 $                                                                */
34
/* $LastChangedBy: olivier.girard $                                          */
35
/* $LastChangedDate: 2015-01-21 23:01:31 +0100 (Wed, 21 Jan 2015) $          */
36 2 olivier.gi
/*===========================================================================*/
37
 
38 141 olivier.gi
.include "pmem_defs.asm"
39
 
40 2 olivier.gi
.global main
41
 
42 200 olivier.gi
.set   UNUSED_0,  (((PER_LENGTH-0x0070) & 0x7ff8)-0x0002)
43
.set   CNTRL1,    (((PER_LENGTH-0x0070) & 0x7ff8)+0x0000)
44
.set   CNTRL2,    (((PER_LENGTH-0x0070) & 0x7ff8)+0x0002)
45
.set   CNTRL3,    (((PER_LENGTH-0x0070) & 0x7ff8)+0x0004)
46
.set   CNTRL4,    (((PER_LENGTH-0x0070) & 0x7ff8)+0x0006)
47
.set   UNUSED_1,  (((PER_LENGTH-0x0070) & 0x7ff8)-0x0008)
48 111 olivier.gi
 
49 2 olivier.gi
main:
50
        /* --------------     TEST RD/WR REGISTER ACCESS     --------------- */
51
 
52 111 olivier.gi
        mov   #0x1234,  &UNUSED_0       ; UNUSED 0
53
        mov &UNUSED_0,  &DMEM_200
54
        mov   #0x5678,  &UNUSED_0
55
        mov &UNUSED_0,  &DMEM_202
56
 
57 2 olivier.gi
        mov   #0x5555,  &CNTRL1         ; CNTRL1
58 111 olivier.gi
        mov   &CNTRL1,  &DMEM_204
59 2 olivier.gi
        mov   #0xaaaa,  &CNTRL1
60 111 olivier.gi
        mov   &CNTRL1,  &DMEM_206
61 2 olivier.gi
 
62
        mov   #0xaaaa,  &CNTRL2         ; CNTRL2
63 111 olivier.gi
        mov   &CNTRL2,  &DMEM_208
64 2 olivier.gi
        mov   #0x5555,  &CNTRL2
65 111 olivier.gi
        mov   &CNTRL2,  &DMEM_20A
66 2 olivier.gi
 
67
        mov   #0x55aa,  &CNTRL3         ; CNTRL3
68 111 olivier.gi
        mov   &CNTRL3,  &DMEM_20C
69 2 olivier.gi
        mov   #0xaa55,  &CNTRL3
70 111 olivier.gi
        mov   &CNTRL3,  &DMEM_20E
71 2 olivier.gi
 
72
        mov   #0xaa55,  &CNTRL4         ; CNTRL4
73 111 olivier.gi
        mov   &CNTRL4,  &DMEM_210
74 2 olivier.gi
        mov   #0x55aa,  &CNTRL4
75 111 olivier.gi
        mov   &CNTRL4,  &DMEM_212
76 2 olivier.gi
 
77 111 olivier.gi
        mov   #0x8765,  &UNUSED_1       ; UNUSED 1
78
        mov &UNUSED_1,  &DMEM_214
79
        mov   #0x4321,  &UNUSED_1
80
        mov &UNUSED_1,  &DMEM_216
81 200 olivier.gi
 
82 2 olivier.gi
        mov   #0x0001, r15
83
 
84
 
85
 
86
        /* ----------------------         END OF TEST        --------------- */
87
end_of_test:
88
        nop
89
        br #0xffff
90
 
91
 
92
        /* ----------------------         INTERRUPT VECTORS  --------------- */
93
 
94
.section .vectors, "a"
95
.word end_of_test  ; Interrupt  0 (lowest priority)    
96
.word end_of_test  ; Interrupt  1                      
97
.word end_of_test  ; Interrupt  2                      
98
.word end_of_test  ; Interrupt  3                      
99
.word end_of_test  ; Interrupt  4                      
100
.word end_of_test  ; Interrupt  5                      
101
.word end_of_test  ; Interrupt  6                      
102
.word end_of_test  ; Interrupt  7                      
103
.word end_of_test  ; Interrupt  8                      
104
.word end_of_test  ; Interrupt  9                      
105
.word end_of_test  ; Interrupt 10                      Watchdog timer
106
.word end_of_test  ; Interrupt 11                      
107
.word end_of_test  ; Interrupt 12                      
108
.word end_of_test  ; Interrupt 13                      
109
.word end_of_test  ; Interrupt 14                      NMI
110
.word main         ; Interrupt 15 (highest priority)   RESET

powered by: WebSVN 2.1.0

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