source: rtems-docs/cpu_supplement/lattice_micro32.rst @ 489740f

4.115
Last change on this file since 489740f was 489740f, checked in by Chris Johns <chrisj@…>, on 05/20/16 at 02:47:09

Set SPDX License Identifier in each source file.

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