source: rtems/doc/cpu_supplement/lm32.t @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 5.8 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-2002.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c  Jukka Pietarinen <jukka.pietarinen@mrf.fi>, 2008,
6@c  Micro-Research Finland Oy
7@c
8
9@ifinfo
10@end ifinfo
11@chapter Lattice Mico32 Specific Information
12
13This chaper discusses the Lattice Mico32 architecture dependencies in
14this port of RTEMS. The Lattice Mico32 is a 32-bit Harvard, RISC
15architecture "soft" microprocessor, available for free with an open IP
16core licensing agreement. Although mainly targeted for Lattice FPGA
17devices the microprocessor can be implemented on other vendors' FPGAs,
18too.
19
20@subheading Architecture Documents
21
22For information on the Lattice Mico32 architecture, refer to the
23following documents available from Lattice Semiconductor
24@file{http://www.latticesemi.com/}.
25
26@itemize @bullet
27@item @cite{"LatticeMico32 Processor Reference Manual"}
28@file{http://www.latticesemi.com/dynamic/view_document.cfm?document_id=20890}
29@end itemize
30
31@c
32@c
33@c
34@section CPU Model Dependent Features
35
36The Lattice Mico32 architecture allows for different configurations of
37the processor. This port is based on the assumption that the following options are implemented:
38
39@itemize @bullet
40@item hardware multiplier
41@item hardware divider
42@item hardware barrel shifter
43@item sign extension instructions
44@item instruction cache
45@item data cache
46@item debug
47@end itemize
48
49@c
50@c
51@c
52@section Register Architecture
53
54This section gives a brief introduction to the register architecture
55of the Lattice Mico32 processor.
56
57The Lattice Mico32 is a RISC archictecture processor with a
5832-register file of 32-bit registers.
59
60@multitable {Register Name} {general pupose / global pointer}
61@headitem Register Name @tab Function
62@item r0     @tab holds value zero
63@item r1-r25 @tab general purpose
64@item r26/gp @tab general pupose / global pointer
65@item r27/fp @tab general pupose / frame pointer
66@item r28/sp @tab stack pointer
67@item r29/ra @tab return address
68@item r30/ea @tab exception address
69@item r31/ba @tab breakpoint address
70@end multitable
71
72Note that on processor startup all register values are undefined
73including r0, thus r0 has to be initialized to zero.
74
75@c
76@c
77@c
78@section Calling Conventions
79
80@subsection Calling Mechanism
81
82A call instruction places the return address to register r29 and a
83return from subroutine (ret) is actually a branch to r29/ra.
84
85@subsection Register Usage
86
87A subroutine may freely use registers r1 to r10 which are @b{not}
88preserved across subroutine invocations.
89
90@subsection Parameter Passing
91
92When calling a C function the first eight arguments are stored in
93registers r1 to r8. Registers r1 and r2 hold the return value.
94
95@c
96@c
97@c
98@section Memory Model
99
100The Lattice Mico32 processor supports a flat memory model with a 4
101Gbyte address space with 32-bit addresses.
102
103The following data types are supported:
104
105@multitable {unsigned half-word} {Bits} {unsigned int / unsigned long}
106@headitem Type           @tab Bits @tab C Compiler Type
107@item unsigned byte      @tab 8    @tab unsigned char
108@item signed byte        @tab 8    @tab char
109@item unsigned half-word @tab 16   @tab unsigned short
110@item signed half-word   @tab 16   @tab short
111@item unsigned word      @tab 32   @tab unsigned int / unsigned long
112@item signed word        @tab 32   @tab int / long
113@end multitable
114
115Data accesses need to be aligned, with unaligned accesses result are
116undefined.
117
118@c
119@c
120@c
121@section Interrupt Processing
122
123The Lattice Mico32 has 32 interrupt lines which are however served by
124only one exception vector. When an interrupt occurs following happens:
125
126@itemize @bullet
127@item address of next instruction placed in r30/ea
128@item IE field of IE CSR saved to EIE field and IE field cleared preventing further exceptions from occuring.
129@item branch to interrupt exception address EBA CSR + 0xC0
130@end itemize
131
132The interrupt exception handler determines from the state of the
133interrupt pending registers (IP CSR) and interrupt enable register (IE
134CSR) which interrupt to serve and jumps to the interrupt routine
135pointed to by the corresponding interrupt vector.
136
137For now there is no dedicated interrupt stack so every task in
138the system MUST have enough stack space to accommodate the worst
139case stack usage of that particular task and the interrupt
140service routines COMBINED.
141
142Nested interrupts are not supported.
143
144@c
145@c
146@c
147@section Default Fatal Error Processing
148
149Upon detection of a fatal error by either the application or RTEMS during
150initialization the @code{rtems_fatal_error_occurred} directive supplied
151by the Fatal Error Manager is invoked.  The Fatal Error Manager will
152invoke the user-supplied fatal error handlers.  If no user-supplied
153handlers are configured or all of them return without taking action to
154shutdown the processor or reset, a default fatal error handler is invoked.
155
156Most of the action performed as part of processing the fatal error are
157described in detail in the Fatal Error Manager chapter in the User's
158Guide.  However, the if no user provided extension or BSP specific fatal
159error handler takes action, the final default action is to invoke a
160CPU architecture specific function.  Typically this function disables
161interrupts and halts the processor.
162
163In each of the architecture specific chapters, this describes the precise
164operations of the default CPU specific fatal error handler.
165
166@c
167@c
168@c
169
170@section Board Support Packages
171
172An RTEMS Board Support Package (BSP) must be designed to support a
173particular processor model and target board combination.
174
175In each of the architecture specific chapters, this section will present
176a discussion of architecture specific BSP issues.   For more information
177on developing a BSP, refer to BSP and Device Driver Development Guide
178and the chapter titled Board Support Packages in the RTEMS
179Applications User's Guide.
180
181@subsection System Reset
182
183An RTEMS based application is initiated or re-initiated when the processor
184is reset.
Note: See TracBrowser for help on using the repository browser.