Core8051s HB
Core8051s HB
4 Handbook
Actel Corporation, Mountain View, CA 94043
© 2010 Actel Corporation. All rights reserved.
Printed in the United States of America
Part Number: 50200084-2
Release: September 2010
No part of this document may be copied or reproduced in any form or by any means without prior written consent of
Actel.
Actel makes no warranties with respect to this documentation and disclaims any implied warranties of merchantability
or fitness for a particular purpose. Information in this document is subject to change without notice. Actel assumes no
responsibility for any errors that may appear in this document.
This document contains confidential proprietary information that is not to be disclosed to any unauthorized person
without prior written consent of Actel Corporation.
Trademarks
Actel, Actel Fusion, IGLOO, Libero, Pigeon Point, ProASIC, SmartFusion and the associated logos are trademarks or
registered trademarks of Actel Corporation. All other trademarks and service marks are the property of their respective
owners.
Core8051s v2.4 Handbook
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Utilization and Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1 Core8051s Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2 Supported Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Interface Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3 Tool Flows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
SmartDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Example System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Synthesis in Libero IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Place-and-Route in Libero IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4 Core8051s Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Software Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
OCI Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Functional Ordered Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Hexadecimal Ordered Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Instruction Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
C Compiler Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
C Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6 Instruction Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Program Memory Bus Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
External Data Memory Bus Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
APB Bus Cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7 List of Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
List of Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
A Product Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Customer Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Actel Customer Technical Support Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Actel Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Contacting the Customer Technical Support Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Revision 2 3
Introduction
This document describes the architecture of a small, general-purpose processor, called the Core8051s.
This processor is compatible with the instruction set of the 8051 microcontroller, and preserves the three
distinct software memory spaces so that it may be targeted by existing 8051 C compilers. To make it
smaller and more flexible than the 8051, the following microcontroller-specific features of the original
8051 are not present:
• SFR-mapped peripherals
• Power management circuitry
• Serial channel
• I/O ports
• Timers
The following set of 8051 microcontroller features are available in Core8051s, but are either optional or
reduced in scope:
• Multiply and divide instructions (MUL, DIV, and DA) – present by default, but may optionally be
implemented as NOPs
• Second data pointer (data pointer 1) – not enabled by default
• Of the 64 kbytes allocated to external data memory, 4 kbytes are allocated to an APB-based
peripheral bus and 60 kbytes is allocated to an external data memory interface
• Interrupt control logic for 2 interrupts
Supported Actel FPGA Families for the Core8051s are as follows:
• IGLOO®/e/PLUS
• ProASIC3®/E/L
• Fusion
• ProASICPLUS®
• Axcelerator®
• RTAX-S
Revision 2 5
Introduction
Debug Column
• None: Debug logic is not included.
• I/Os: Debug logic is included and general purpose I/Os are used for the debug connection.
• UJTAG: Debug logic is included and the dedicated JTAG pins of the device and the UJTAG macro
are used for the debug connection.
Internal RAM
• Instantiated: Internal 256x8 RAM is implemented using an instantiated RAM block.
• Inferred: Internal 256x8 RAM is implemented by inferring RAM during synthesis.
6 R e vi s i o n 2
Core8051s v2.4 Handbook
Registers
Registers (FPGA tiles) are inferred for the 256x8 RAM during synthesis.
Table 1 • Core8051s Utilization and Performance for IGLOO 1.2 V Devices (STD speed grade)
Utilization and
Configuration Performance
and DA Instructions
Include Trace RAM
Hardware Triggers
Program Memory
Access Control
Access Control
Data Memory
Internal RAM
Data Pointer
RAM Blocks
Debug
Tiles
MHz
None – – No Yes ack ack 32 Instantiated 3,435 1 14.8
I/Os No 0 No Yes ack ack 32 Instantiated 3,833 1 14.9
ujtag No 0 No Yes ack ack 32 Instantiated 3,792 1 14.4
ujtag No 1 No Yes ack ack 32 Instantiated 4,080 1 14.7
ujtag No 4 No Yes ack ack 32 Instantiated 5,029 1 14.4
ujtag Yes 0 No Yes ack ack 32 Instantiated 3,974 3 15.4
ujtag Yes 1 No Yes ack ack 32 Instantiated 4,455 3 14.5
ujtag Yes 4 No Yes ack ack 32 Instantiated 5,538 3 14.6
None – – Yes Yes ack ack 32 Instantiated 3,686 1 14.9
None – – No Yes 2 2 32 Instantiated 3,376 1 14.8
None – – No Yes 5 5 32 Instantiated 3,308 1 15.3
None – – No Yes ack ack 16 Instantiated 3,311 1 15.1
None – – No Yes ack ack 8 Instantiated 3,318 1 15.2
None – – No Yes ack ack 32 Inferred 3,457 1 14.7
None – – No Yes ack ack 32 Registers 7,853 0 13.9
ujtag Yes 4 Yes Yes ack ack 32 Registers 10,098 2 12.1
None – – No No ack ack 8 Instantiated 2,849 1 14.7
Revision 2 7
Introduction
Table 2 • Core8051s Utilization and Performance for IGLOO 1.5 V Devices (STD speed grade)
Utilization and
Configuration Performance
and DA Instructions
Include Trace RAM
Hardware Triggers
Program Memory
Access Control
Access Control
Data Memory
Internal RAM
Data Pointer
RAM Blocks
Debug
Tiles
MHz
None – – No Yes ack ack 32 Instantiated 3,110 1 23.9
I/Os No 0 No Yes ack ack 32 Instantiated 3,548 1 22.7
ujtag No 0 No Yes ack ack 32 Instantiated 3,483 1 24.3
ujtag No 1 No Yes ack ack 32 Instantiated 3,772 1 23.6
ujtag No 4 No Yes ack ack 32 Instantiated 4,847 1 23.3
ujtag Yes 0 No Yes ack ack 32 Instantiated 3,742 3 22.9
ujtag Yes 1 No Yes ack ack 32 Instantiated 4,083 3 23.9
ujtag Yes 4 No Yes ack ack 32 Instantiated 5,125 3 23.8
None – – Yes Yes ack ack 32 Instantiated 3,318 1 24.2
None – – No Yes 2 2 32 Instantiated 3,386 1 24.2
None – – No Yes 5 5 32 Instantiated 3,357 1 22.9
None – – No Yes ack ack 16 Instantiated 2,995 1 24.5
None – – No Yes ack ack 8 Instantiated 2,915 1 23.9
None – – No Yes ack ack 32 Inferred 3,136 1 24.8
None – – No Yes ack ack 32 Registers 7,633 0 23.3
UJTAG Yes 4 Yes Yes ack ack 32 Registers 9,917 2 19.9
None – – No No ack ack 8 Instantiated 2,568 1 23.8
8 R e vi s i o n 2
Core8051s v2.4 Handbook
Table 3 • Core8051s Utilization and Performance for Fusion, ProASIC3, and ProASIC3E Devices (–2 speed
grade)
Utilization and
Configuration Performance
and DA Instructions
Include Trace RAM
Hardware Triggers
Program Memory
Access Control
Access Control
Data Memory
Internal RAM
Data Pointer
RAM Blocks
Debug
Tiles
MHz
None – – No Yes ack ack 32 Instantiated 3,324 1 37.1
I/Os No 0 No Yes ack ack 32 Instantiated 3,776 1 36.5
ujtag No 0 No Yes ack ack 32 Instantiated 3,758 1 35.9
ujtag No 1 No Yes ack ack 32 Instantiated 4,024 1 37.5
ujtag No 4 No Yes ack ack 32 Instantiated 4,941 1 35.4
ujtag Yes 0 No Yes ack ack 32 Instantiated 4,053 3 37.1
ujtag Yes 1 No Yes ack ack 32 Instantiated 4,262 3 36.7
ujtag Yes 4 No Yes ack ack 32 Instantiated 5,330 3 36.4
None – – Yes Yes ack ack 32 Instantiated 3,546 1 39.9
None – – No Yes 2 2 32 Instantiated 3,356 1 35.9
None – – No Yes 5 5 32 Instantiated 3,335 1 37.9
None – – No Yes ack ack 16 Instantiated 3,190 1 38.7
None – – No Yes ack ack 8 Instantiated 3,081 1 36.9
None – – No Yes ack ack 32 Inferred 3,384 1 37.5
None – – No Yes ack ack 32 Registers 7,739 0 35.9
ujtag Yes 4 Yes Yes ack ack 32 Registers 9,937 2 28.9
None – – No No ack ack 8 Instantiated 2,748 1 37.3
Revision 2 9
Introduction
Table 4 • Core8051s Utilization and Performance for ProASIC3L (–1 speed grade)
Utilization and
Configuration Performance
and DA Instructions
Include Trace RAM
Hardware Triggers
Program Memory
Access Control
Access Control
Data Memory
Internal RAM
Data Pointer
RAM Blocks
Debug
Tiles
MHz
None – – No Yes ack ack 32 Instantiated 2,936 1 25.7
I/Os No 0 No Yes ack ack 32 Instantiated 3,360 1 25.4
ujtag No 0 No Yes ack ack 32 Instantiated 3,261 1 25.1
ujtag No 1 No Yes ack ack 32 Instantiated 3,624 1 23.9
ujtag No 4 No Yes ack ack 32 Instantiated 4,637 1 24.5
ujtag Yes 0 No Yes ack ack 32 Instantiated 3,541 3 25.5
ujtag Yes 1 No Yes ack ack 32 Instantiated 3,844 3 24.4
ujtag Yes 4 No Yes ack ack 32 Instantiated 4,926 3 24.7
None – – Yes Yes ack ack 32 Instantiated 3,116 1 24.2
None – – No Yes 2 2 32 Instantiated 2,931 1 24.5
None – – No Yes 5 5 32 Instantiated 2,928 1 26.5
None – – No Yes ack ack 16 Instantiated 2,778 1 26.4
None – – No Yes ack ack 8 Instantiated 2,718 1 25.5
None – – No Yes ack ack 32 Instantiated 2,943 1 23.6
None – – No Yes ack ack 32 Instantiated 7,391 0 25.4
ujtag Yes 4 Yes Yes ack ack 32 Instantiated 9,755 2 23.1
None – – No Yes ack ack 8 Instantiated 2,444 1 24.9
10 R e visio n 2
Core8051s v2.4 Handbook
Table 5 • Core8051s Utilization and Performance for ProASICPLUS Devices (STD speed grade)
Utilization and
Configuration Performance
and DA Instructions
Include Trace RAM
Hardware Triggers
Program Memory
Access Control
Access Control
Data Memory
Internal RAM
Data Pointer
RAM Blocks
Debug
Tiles
MHz
None – – No Yes ack ack 32 Instantiated 4,000 1 26.2
I/Os No 0 No Yes ack ack 32 Instantiated 4,318 1 26.4
UJTAG No 0 No Yes ack ack 32 Instantiated 4,271 1 25.8
UJTAG No 1 No Yes ack ack 32 Instantiated 4,709 1 25.7
UJTAG No 4 No Yes ack ack 32 Instantiated 6,004 1 24.4
UJTAG Yes 0 No Yes ack ack 32 Instantiated 4,580 4 26.8
UJTAG Yes 1 No Yes ack ack 32 Instantiated 5,065 4 23.5
UJTAG Yes 4 No Yes ack ack 32 Instantiated 6,368 4 23.5
None - – Yes Yes ack ack 32 Instantiated 4,344 1 26.8
None - – No Yes 2 2 32 Instantiated 4,185 1 27.8
None - – No Yes 5 5 32 Instantiated 4,135 1 29.8
None - – No Yes ack ack 16 Instantiated 3,821 1 28.1
None - – No Yes ack ack 8 Instantiated 3,773 1 28.9
None - – No Yes ack ack 32 Inferred 4,056 1 26.2
None - – No Yes ack ack 32 Registers 10,888 0 25.2
UJTAG Yes 4 Yes Yes ack ack 32 Registers 13,652 3 19.9
None – – No No ack ack 8 Instantiated 3,146 1 28.8
Revision 2 11
Introduction
Table 6 • Core8051s Utilization and Performance for Axcelerator Devices (–2 speed grade)
Utilization and
Configuration Performance
and DA Instructions
Include Trace RAM
Hardware Triggers
Program Memory
Access Control
Access Control
Data Memory
Internal RAM
Data Pointer
RAM Blocks
Debug
Tiles
MHz
None – – No Yes ack ack 32 Instantiated 2,111 1 50.9
I/Os No 0 No Yes ack ack 32 Instantiated 2,343 1 44.9
I/Os No 1 No Yes ack ack 32 Instantiated 2,608 1 42.4
I/Os No 4 No Yes ack ack 32 Instantiated 3,197 1 44.1
I/Os Yes 0 No Yes ack ack 32 Instantiated 2,554 3 47.4
I/Os Yes 1 No Yes ack ack 32 Instantiated 2,797 3 44.1
I/Os Yes 4 No Yes ack ack 32 Instantiated 3,413 3 42.5
None – – Yes Yes ack ack 32 Instantiated 2,196 1 53.4
None – – No Yes 2 2 32 Instantiated 2,091 1 55.8
None – – No Yes 5 5 32 Instantiated 2,104 1 54.2
None – – No Yes ack ack 16 Instantiated 2,066 1 53.3
None – – No Yes ack ack 8 Instantiated 1,977 1 56.3
None – – No Yes ack ack 32 Inferred 2,104 1 50.1
None – – No Yes ack ack 32 Registers 5,245 0 42.9
I/Os Yes 4 Yes Yes ack ack 32 Registers 6,714 2 33.1
None – – No No ack ack 8 Instantiated 1,757 1 53.4
12 R e visio n 2
Core8051s v2.4 Handbook
Table 7 • Core8051s Utilization and Performance for RTAX-S Devices (–1 speed grade)
Utilization and
Configuration Performance
and DA Instructions
Include Trace RAM
Hardware Triggers
Program Memory
Access Control
Access Control
Data Memory
Internal RAM
Data Pointer
RAM Blocks
Debug
Tiles
MHz
None – – No Yes ack ack 32 Instantiated 2,123 1 39.9
I/Os No 0 No Yes ack ack 32 Instantiated 2,357 1 33.1
I/Os No 1 No Yes ack ack 32 Instantiated 2,607 1 30.1
I/Os No 4 No Yes ack ack 32 Instantiated 3,137 1 28.6
I/Os Yes 0 No Yes ack ack 32 Instantiated 2,547 3 29.9
I/Os Yes 1 No Yes ack ack 32 Instantiated 2,836 3 33.6
I/Os Yes 4 No Yes ack ack 32 Instantiated 3,351 3 26.5
None – – Yes Yes ack ack 32 Instantiated 2,192 1 39.7
None – – No Yes 2 2 32 Instantiated 2,057 1 37.8
None – – No Yes 5 5 32 Instantiated 2,118 1 38.4
None – – No Yes ack ack 16 Instantiated 2,042 1 39.6
None – – No Yes ack ack 8 Instantiated 1,987 1 39.4
None – – No Yes ack ack 32 Inferred 2,146 1 38.7
None – – No Yes ack ack 32 Registers 5,224 0 29.2
I/Os Yes 4 Yes Yes ack ack 32 Registers 6,694 2 22.8
None – – No No ack ack 8 Instantiated 1,778 1 39.8
Revision 2 13
1 – Core8051s Overview
The Core8051s is a high-performance, eight-bit microcontroller IP Core. It is a fully functional eight-bit
embedded controller that executes all ASM51 instructions and has the same instruction set as the
80C31. Core8051s provides software and hardware interrupts.
The Core8051s architecture eliminates redundant bus states and implements parallel execution of fetch
and execution phases. Since a cycle is aligned with memory fetch when possible, most of the one-byte
instructions are performed in a single cycle. Core8051s uses one clock per cycle. This leads to an
average performance improvement rate of 8.0 (in terms of MIPS) with respect to the Intel device working
with the same clock frequency.
The original Intel 8051 had a 12-clock architecture. A machine cycle needed 12 clocks, and most
instructions were either one or two machine cycles. Therefore, the 8051 used either 12 or 24 clocks for
each instruction, except for the MUL and DIV instructions. Furthermore, each cycle in the 8051 used two
memory fetches. In many cases, the second fetch was a “dummy” fetch and extra clocks were wasted.
Table 1-1 shows the speed advantage of Core8051s over the standard Intel 8051. A speed advantage of
12 in the first column means that Core8051s performs the same instruction 12 times faster than the
standard Intel 8051. The second column in Table 1-1 lists the number of types of instructions that have
the given speed advantage. The third column lists the total number of instructions that have the given
speed advantage. The third column can be thought of as a subcategory of the second column. For
example, there are two types of instructions that have a three-time speed advantage over the classic
8051, for which there are nine explicit instructions.
Revision 2 15
2 – Supported Interfaces
Ports
The port signals of Core8051s are illustrated in Figure 2-1.
Core8051s
CLK
PRESETN
NSYSRESET
WDOGRESN
WDOGRES
MOVX
TCK TDO
TMS BREAKOUT
TDI TRIGOUT
TRSTN AUXOUT
MEMBANK DBGMEMPSWR
BREAKIN
MEMDATAI MEMADDR
MEMPSACKI MEMDATAO
MEMACKI MEMPSRD
MEMWR
MEMRD
PREADY
PADDR
PRDATA
PSEL
PSLVERR
PENABLE
PWRITE
INT0 PWDATA
INT1
Revision 2 17
Supported Interfaces
The signals listed in Table 2-1 are present at the Core8051s boundary.
18 R e visio n 2
Core8051s v2.4 Handbook
Revision 2 19
Supported Interfaces
Interface Descriptions
Parameters/Generics
The Verilog parameters or VHDL generics shown in Table 2-2 are present in the Core8051s RTL code.
These may be modified by the user to configure Core8051s as required. When working with
SmartDesign, these parameters/generics are set to appropriate values using the Core8051s
configuration window.
20 R e visio n 2
3 – Tool Flows
SmartDesign
Core8051s is available for download to the SmartDesign IP Catalog via the Libero® Integrated Design
Environment (IDE) web repository. For information on using SmartDesign to instantiate, configure,
connect, and generate cores, refer to the Libero IDE online help.
The advanced peripheral bus (APB) version 3 interface of Core8051s will typically be connected to the
mirrored master interface of CoreAPB3, with various APB or APB3 slaves connected to the slave
interfaces of CoreAPB3. The external memory interface (ExternalMemIf) of Core8051s must be
connected to program and data memories, which can be implemented either on-chip or off-chip. If debug
functionality is enabled, the JTAG signals (TCK, TMS, TDI, TDO, and TRSTN) of the debug interface
(DebugIf) must be routed to the top level of your design. Either the dedicated JTAG pins of the device or
general purpose I/O pins can be used for the JTAG debug connection. The UJTAG macro is employed
when the dedicated JTAG pins are used for the debug connection.
Figure 3-1 shows the Core8051s configuration window, along with cross-references to the corresponding
top-level parameters. The parameters/generics of the core are fully described in the
"Parameters/Generics" section on page 20.
DEBUG
INCL_TRACE
TRIG_NUM
INCL_DPTR1
INCL_MUL_DIV_DA
VARIABLE_WAIT
WAIT_VAL
VARIABLE_STRETCH
STRETCH_VAL
APB_DWIDTH
INTRAM_IMPLEMENTATION
Revision 2 21
Tool Flows
The configuration options for Core8051s are described in the following paragraphs. The Core8051s
configuration window is used to adjust the values of the underlying parameters/generics in the RTL code
for the core. Each configuration option presented in the configuration window corresponds directly to an
actual parameter/generic in the RTL code for Core8051s.
Debug Configuration
• There are three debug-related configuration options. Set the Debug option to choose to enable or
disable on-chip instrumentation (OCI) debug functionality and to control how any debug
connection is implemented. When this functionality is enabled, you can connect a debugger to the
processor via a JTAG connection. You can disable the debug functionality if you do not intend to
use a debugger and want to minimize the number of tiles consumed by the processor. There are
two possibilities for implementing the JTAG connection. From the Debug drop-down menu,
choose one of these options:
• Disabled to exclude debug functionality
• Enabled using UJTAG to include debug functionality and to use the dedicated JTAG pins of the
device (via the UJTAG macro) for the debug connection. This setting is mostly used when only
one debug connection is required. With this setting you can make use of the FlashPro3 or low-
cost programming stick (LCPS) connection for the debug connection.
• Enabled using I/Os to include debug functionality and to use general purpose I/O pins for the
debug connection. Select this option if the UJTAG macro is either not present on your device or is
already in use and not available for the Core8051s debug connection.
• When Debug is set to Enabled using UJTAG or Enabled using I/Os, two additional debug
options are available for added control over the debug functionality to be included:
• Select Include trace RAM to include a 256-byte deep trace RAM within Core8051s. No trace
RAM is present if this option is not selected. Including the trace RAM increases the tile count for
the processor and consumes RAM blocks on the device.
• Set Number of hardware triggers/breakpoints to 0, 1, 2, or 4 to set the maximum number of
hardware triggers/breakpoints available when debugging a Core8051s system. Increasing the
number of hardware triggers/breakpoints increases the tile count of the processor.
22 R e visio n 2
Core8051s v2.4 Handbook
Other Options
Set APB data width to 8 bit, 16 bit, or 32 bit to select the appropriate data width for the APB interface of
the processor. When the APB data width is 16 bits or 32 bits, extra SFRs are used to store the upper
bytes of APB data when the (8-bit) processor core carries out an access to APB space. See the "External
Data Memory Space" section on page 30 for more information on the APB interface.
The Internal RAM (256x8) Implementation option is used to control how the internal 256x8 RAM is
implemented. Three choices are available:
• Instantiate RAM block: A RAM macro block is directly instantiated in the RTL code.
• Infer RAM block during synthesis: A synthesis directive (in the form of a structured comment)
is used in the RTL code to cause the synthesis tool to infer RAM during synthesis. A RAM macro
block will be used in this case, which means that this choice gives a very similar outcome to
Instantiate RAM block.
• Infer registers for RAM during synthesis: A synthesis directive (in the form of a structured
comment) is used in the RTL code to cause the synthesis tool to use registers (FPGA tiles) to
implement the 256x8 internal RAM. This considerably increases the tile count for the core but has
the benefit of enhancing the fault-tolerant capabilities of Core8051s.
Revision 2 23
Tool Flows
Example System
A typical system that includes Core8051s is shown in Figure 3-2. Connections can be made
automatically in SmartDesign using the Auto Connect menu option.
Simulation
Core8051s comes with a verification testbench and also supports bus functional model (BFM)-based
simulation of a system in which it is instantiated. The BFM only simulates transactions on the APB
interface of Core8051s and does implement a complete model of the processor. It is not possible to
simulate code running on the processor with a
BFM-based simulation.
Core8051s simulation can be invoked from the Libero IDE Project Manager. After the design has been
generated, click the Simulation button in the Libero IDE to run a simulation.
The Core8051s component must be set as the design root (right-click Core8051s and select Set As
Root), before running a Core8051s simulation. However, if intending to run a BFM-based simulation, you
must first compile the component which instantiates Core8051s. To do this, set the design root one level
of hierarchy above the Core8051s component and click the Simulation button to invoke ModelSim® and
compilation of the relevant components. When the (automatically generated) ModelSim script finishes,
exit ModelSim. Now set the design root to the Core8051s component and click the Simulation button
again. This enables you to run a BFM-based simulation of your Core8051s system. The Core8051s
verification testbench can be run directly, without the need to first compile the component that
instantiates Core8051s.
The following message will appear in the ModelSim transcript window when running (pre-synthesis)
Core8051s simulation:
The following (pre-synthesis) simulation options are available for
your Core8051s-based system:
bfm - APB Bus Functional Model (BFM-driven) simulation of your system
oci - Run Core8051s On Chip Instrumentation (OCI) tests
opcode - Run Core8051s opcode test suite, consisting of 256 opcode tests
<num> - Enter a number in the range 1 to 256 to run a specific opcode test
Enter "bfm", "oci", "opcode" or a number between 1 and 256 and hit return key to select
simulation type
24 R e visio n 2
Core8051s v2.4 Handbook
Follow the instructions in the ModelSim transcript window to choose the type of simulation to run. BFM-
based simulation is not supported after synthesis has been run and bfm does not appear as a simulation
option in the post-synthesis ModelSim message, which is shown below:
The following (post-synthesis) simulation options are available for
your Core8051s-based system:
oci - Run Core8051s On Chip Instrumentation (OCI) tests
opcode - Run Core8051s opcode test suite, consisting of 256 opcode tests
<num> - Enter a number in the range 1 to 256 to run a specific opcode test
(Note: BFM-driven simulation not available post-synthesis)
Enter "oci", "opcode" or a number between 1 and 256 and hit return key to select
simulation type
BFM-Based Simulation
When running a BFM-based simulation of a Core8051s system, a BFM command script is used to
control the simulation. This command script is dynamically generated by SmartDesign, based on the
components connected to the APB interface of Core8051s. The command script file is named
subsystem.bfm and is located in the simulation folder. You can modify the command script, refer to
"BFM-Script Language" for details on the syntax used in the file.
During simulation, the BFM generates a series of transfers on the APB bus. These write to and read from
registers within peripherals attached to the APB bus, of which Core8051s is master. This verifies that the
APB interface is fully operational. The BFM tests do not perform any verification on the Core8051s itself.
The advantage of BFM-driven simulation is that you can exercise the system using a simple scripting
language, before writing any C code or 8051 assembler code.
BFM-Script Language
The following script commands are defined for use by the BFM:
memmap
This command is used to associate a label, representing a system resource, with a memory map
location. The other BFM script commands may perform accesses to locations within this resource by
referencing this label and a register offset relative to this base address.
Syntax
memmap resource_name base_address;
• resource_name: This is a string containing the user-friendly instance name of the resource being
accessed. For BFM scripts generated automatically by SmartDesign, this name corresponds to
the instance name of the associated core in the generated subsystem Verilog or VHDL.
• base_address: This is the base address of the resource, in hexadecimal format.
write
This command causes the BFM to perform a write to a specified offset, within the memory map range of
a specified system resource.
Syntax
write width resource_name byte_offset data;
• width: This takes on the enumerated values of W, H, or B, for word, halfword, or byte.
• resource_name: This is a string containing the user-friendly instance name of the resource being
accessed.
• byte_offset: This is the offset from the base of the resource, in bytes. It is specified as a
hexadecimal value.
• data: This is the data to be written. It is specified as a hexadecimal value.
Example
write W videoCodec 20 11223344;
Revision 2 25
Tool Flows
read
This command causes the BFM to perform a read of a specified offset, within the memory map range of
a specified system resource.
Syntax
read width resource_name byte_offset;
• width: This takes on the enumerated values of W, H, or B, for word, halfword, or byte.
• resource_name: This is a string containing the user-friendly instance name of the resource being
accessed.
• byte_offset: This is the offset from the base of the resource, in bytes. It is specified as a
hexadecimal value.
Example
read W videoCodec 20;
readcheck
This command causes the BFM to perform a read of a specified offset, within the memory map range of
a specified system resource, and to compare the read value with the expected value provided.
Syntax
readcheck width resource_name byte_offset data;
• width: This takes on the enumerated values of W, H, or B, for word, halfword, or byte.
• resource_name: This is a string containing the user-friendly instance name of the resource being
accessed.
• byte_offset: This is the offset from the base of the resource, in bytes. It is specified as a
hexadecimal value.
• data: This is the expected read data. It is specified as a hexadecimal value.
Example
readcheck W videoCodec 20 11223344;
poll
This command continuously reads a specified location until a requested value is obtained. This
command allows one or more bits of the read data to be masked out. This allows, for example, poll
waiting for a ready bit to be set, while ignoring the values of the other bits in the location being read.
Syntax
poll width resource_name byte_offset data bitmask;
• width: This takes on the enumerated values of W, H, or B, for word, halfword, or byte.
• resource_name: This is a string containing the user-friendly instance name of the resource being
accessed.
• byte_offset: This is the offset from the base of the resource, in bytes. It is specified as a
hexadecimal value.
• bitmask: The bitmask is ANDed with the read data and the result is then compared to the bitmask
itself. If equal, then all the bits of interest are at their required value and the poll command is
complete. If not equal, then the polling continues.
wait
This command causes the BFM script to stall for a specified number of clock periods.
Syntax
wait num_clock_ticks;
• num_clock_ticks: This is the number of clock periods during which the BFM stalls (does not
initiate any bus transactions).
waitint0
This command causes the BFM to wait until an interrupt event (Low to High transition) is seen on the
INT0 pin before proceeding with the execution of the remainder of the script.
26 R e visio n 2
Core8051s v2.4 Handbook
Syntax
waitint0;
waitint1
This command causes the BFM to wait until an interrupt event (Low to High transition) is seen on the
INT1 pin before proceeding with the execution of the remainder of the script.
Syntax
waitint1;
Revision 2 27
4 – Core8051s Features
Word-Addressable Only
256 Locations Peripheral 1
256 Locations Peripheral 0
60 kbytes
128 Bytes SFR Subset
As far as the software programmer is concerned, there are three distinct memory spaces available, as
shown in Figure 4-1.
Program Memory
Core8051s can address up to 64 kbytes of program memory space, from 0000H to FFFFH. The external
memory bus interface (Table 4-1 on page 31) services program memory when the MEMPSRD signal is
active. Program memory is read when the CPU performs fetching instructions or MOVC. After reset, the
CPU starts program execution from location 0000H. The lower part of the program memory includes
interrupt and reset vectors. The interrupt vectors are spaced at eight-byte intervals, starting from 0003H.
Program memory can be implemented as internal RAM, external RAM, external ROM, or a combination
of all three. Writing to external program memory is only supported in debug mode, using the OCI logic
block and external debugger hardware and software.
The program memory can use variable length accesses (MEMPSACKI-controlled), or a fixed number of
wait cycles may be inserted on each read. Refer to "Program Memory Access" on page 22 for more
information about configuring access to program memory.
Revision 2 29
Core8051s Features
APB Interface
Core8051s based systems use an APB bus for connecting peripherals, where the Core8051s acts as the
bus master. The width of the APB bus on Core8051s can be selected to match the width of the widest
APB peripheral in the system (8, 16, or 32 bits). As the Core8051s is an 8-bit processor and it is not
possible to indicate transaction size on the APB, reads and writes from or to the APB bus in 16-bit or 32-
bit mode are accomplished by means of newly defined SFRs, hereafter referred to as X registers. For
example, to perform a write to a 32-bit APB peripheral, the program running on the Core8051s must first
perform three individual 8-bit writes to X registers (XWB1, XWB2, and XWB3). These registers hold the
value to be written out on PWDATA [31:8]. When the program subsequently does a write to the APB
address in question, the 8 bits of the write data associated with that write cycle are put out on the
PWDATA [7:0] and the three write “X registers” are put onto the APB bus as PWDATA [31:8].
16-bit and 32-bit reads from the APB are handled in a similar manner. To perform a 32-bit read from an
APB location, the program must perform a read of the APB location, from which it immediately obtains
bits [7:0] of the 16 or 32 bits on PRDATA[7:0]. Subsequently, the program must read the three read X
registers (XRB1, XRB2, and XRB3) to get bits [31:8], which were read from the APB peripheral and
latched in these SFRs at the time of the APB transaction.
For the 4 kbytes of memory space allocated to the APB interface, only word access is possible, where
word refers to an 8-bit, 16-bit, or 32-bit entity, for their respective APB bus implementations.
The APB interface of Core8051s will typically be connected to CoreAPB3, which can in turn connect to
up to 16 peripherals such as CoreTimer and CoreGPIO. Often the programmer accessible registers in
these peripherals will be located at 32-bit word boundaries in the address map. This means that
consecutive registers are located at address offsets 0x00, 0x04, 0x08, 0x0C, and so on. Core8051s must
take account of this when accessing such peripherals. For example, to access successive register
locations in a peripheral attached to slave slot 0 on CoreAPB3, Core8051s would issue addresses
0xF000, 0xF004, 0xF008, 0xF00C, and so on.
The net effect is that only every fourth location in the APB space is usable if the peripherals are designed
such that their registers are located at 32-bit word boundaries in the memory map. If all of the 4 kbytes of
APB space connects to peripherals of this type, then there are only 1,024 separately addressable
locations, which equates to 64 locations per peripheral, assuming CoreAPB3 is used.
Note that the APB data width is independent of the addressing scheme. Each location can hold a value
which is 8, 16, or 32 bits wide. The APB data width configurable option of Core8051s should be set to
match the largest data width to be accessed on the APB interface.
30 R e visio n 2
Core8051s v2.4 Handbook
SFR Registers
The SFRs occupy the upper 128 bytes of internal data memory space. This SFR area is available only by
direct addressing.
Table 4-1 lists the SFR registers present in Core8051s.
The above table contains the minimal subset of SFR registers (SP, DPL, DPH, PSW, ACC, and B) that
are required to support existing C compilers. There is an optional second data pointer (not available by
default). There are also six non-standard SFR registers shown, referred to hereafter as X registers. The
XWB1 and XRB1 registers are present only if APB_DWIDTH is 16 or greater. XWB2, XWB3, XRB2, and
XRB3 are present only if APB_DWIDTH is 32. They are used to provide write data and latch read data for
the upper 3 bytes of the APB bus, if present, during a MOVX instruction to APB memory space (within
external data memory space). The six X registers are not bit-addressable. Note also that the X registers
are read/write. This is necessary to handle the situation where an ISR needs to access the APB bus, but
has interrupted between the user setting up the X registers and performing the MOVX (on an APB write),
or between the MOVX and reading of the X registers (on an APB read). The recommended behavior for
an ISR is to read the X registers on entry into the ISR and to restore them to their original values on
exiting the ISR.
Revision 2 31
Core8051s Features
Accumulator (acc)
The acc register is the accumulator. Most instructions use the accumulator to hold the operand. The
mnemonics for accumulator-specific instructions refer to the accumulator as A, not ACC.
B Register (b)
The b register is used during multiply and divide instructions. It can also be used as a scratch-pad
register to hold temporary data.
The state of bits rs1 and rs0 from the psw register select the working registers bank as listed in Table 4-4.
Table 4-4 • rs1/rs0 Bit Selections
rs1/rs0 Bank selected Location
00 Bank 0 (00H – 07H)
01 Bank 1 (08H – 0FH)
10 Bank 2 (10H – 17H)
11 Bank 3 (18H – 1FH)
32 R e visio n 2
Core8051s v2.4 Handbook
Revision 2 33
Core8051s Features
Interrupts
Core8051s has two interrupt inputs, INT0 and INT1. INT0 is low priority (priority level 0), with a vector
address of 03H. INT1 is high priority (priority level 1), with a vector address of 13H.
Note: If using the Keil C51 C compiler, an interrupt function attribute of 0 must be used for INT0 and an
attribute of 2 for INT1.
The interrupt enable (IE) and interrupt control (ICON) special function registers are used to determine
interrupt behavior.
Interrupts can be individually or collectively enabled or disabled using the interrupt enable register.
The interrupt control register contains an event flag and a type control bit for the INT0 and INT1
interrupts. Each type control bit is used to control whether the corresponding interrupt is rising edge or
level High sensitive, with the default being level High sensitive. Each event flag is set to 1 when a rising
edge or High level is detected on the corresponding interrupt input.
When rising edge sensitive operation is selected (by setting the type control bit to 1), the relevant event
flag will be automatically cleared when the interrupt is serviced. This automatic clearing of the event flags
is made possible by logic in the processor that detects vectoring to address 03H (in the case of an INT0
interrupt) or 13H (in the case of an INT1 interrupt).
When level sensitive interrupt operation is selected, the relevant event flag is not cleared when the
interrupt is serviced and remains asserted until the source of the interrupt is cleared. The event flag
effectively follows the (INT0 or INT1) interrupt input when level sensitive operation is selected. The
interrupt service routine must clear the source of the interrupt when level sensitive interrupts are used.
OCI Block
The on-chip instrumentation (OCI) block communicates with external debugger hardware and software
as a debugging aid to the user. The OCI debug block can be optionally included, refer to "Debug
Configuration" on page 22 for more information on debug related configuration options. The following
debug features are present in Core8051s:
• Run/stop control
• Single-step mode
• Software breakpoint
• Execution of a debugger program
• Hardware breakpoint
• Program trace
• Access to ACC (accumulator) register
34 R e visio n 2
5 – Instruction Set
The Core8051s instructions are binary code compatible and perform the same functions as the industry-
standard 8051. This is the ASM51 instruction set. Some of these instructions, however, are not enabled
by default and so must be explicitly enabled if required.
Table 5-1 and Table 5-2 contain notes for mnemonics used in the various instruction set tables. In
Table 5-3 on page 36 through Table 5-7 on page 40, the instructions are ordered in functional groups. In
Table 5-8 on page 41, the instructions are ordered in the hexadecimal order of the operation code. For
more detailed information about the Core8051s instruction set, refer to the Core8051 Instruction Set
Details User’s Guide.
Revision 2 35
Instruction Set
36 R e visio n 2
Core8051s v2.4 Handbook
Revision 2 37
Instruction Set
38 R e visio n 2
Core8051s v2.4 Handbook
Revision 2 39
Instruction Set
40 R e visio n 2
Core8051s v2.4 Handbook
Revision 2 41
Instruction Set
42 R e visio n 2
Core8051s v2.4 Handbook
Revision 2 43
Instruction Set
44 R e visio n 2
Core8051s v2.4 Handbook
Instruction Definitions
All Core8051s core instructions can be condensed to 53 basic operations, alphabetically ordered
according to the operation mnemonic section, as shown in Table 5-9.
Revision 2 45
Instruction Set
C Compiler Support
Because the Core8051s is 100% compatible with the ASM51 instruction set and supports the three
traditional 8051 microcontroller memory spaces, it may be targeted by existing 8051 C compilers.
The following section describes in more detail the considerations involved in writing C code for the 8051,
when using the Keil Cx51 C compiler. Note that the considerations are similar to those required for other
8051 C compilers, such as the Small Device C Compiler (SDCC), which is bundled with Actel's
SoftConsole software development environment.
ANSI C Compliance
It is theoretically possible to write fully compliant ANSI C code and target it to the Core8051s. However,
there are a number of issues to be aware of, as listed below.
• Some of the types for the arguments of functions in the Keil C runtime library are modified from
those defined in the standard ANSI C. This is to use smaller sizes, where possible.
• Some of the functions in the Keil C runtime library use proprietary extensions to C (as described
in "Allocation of Variables in C"), such as bit and xdata types.
• Some of the functions defined by ANSI C are not present in the Keil C runtime library.
• The Keil C runtime library contains some extra functions not defined in ANSI C.
Therefore, pure standard ANSI C code is guaranteed to run only if it does not use any of the above
functions when using the Keil C runtime library. Alternatively, the user may provide a runtime library other
than the Keil C runtime library.
To get optimal usage of the 8051 architecture, however, many users would just modify their ANSI C
application, if necessary, to make optimal use of the 8051 architecture.
Allocation of Variables in C
One of the considerations in writing C software for an 8051-based system is allocation of variables.
Specifically, from which of the three memory spaces is a particular variable allocated? By default, if no C
extensions are used, all variables are allocated from a single memory space, therefore allowing no
confusion. The Keil C compiler allows the user to select a “memory model” from one of three possible
models. These are the small, compact, and large models. The small and large models are of particular
interest in targeting the Core8051s. These are described in the following sections.
Small Model
In this model, all variables, by default, reside in internal data memory. In this model, variable access is
very efficient. However, all objects (if not explicitly located in another memory area) and the stack must fit
into internal RAM. Stack size is critical because the stack size depends on the nesting depth of the
various functions.
Large Model
In the large model, all variables, by default, reside in external data memory (which may be up to 64
kbytes). In the case of Core8051s, this covers 60 kbytes of external RAM and 4 kbytes of memory-
mapped peripherals. The data pointer (DPTR) is used to address external memory, which results in
slower accesses to variables than in the small model. It is likely, however, that the large model is the
more appropriate of the two for targeting Core8051s without having to use language extensions, as this
allows the peripheral resources to be mapped as C variables.
46 R e visio n 2
Core8051s v2.4 Handbook
interest are the address/data path widths as well as the different memory spaces. C compilers for the
8051 provide some extensions to C, which allow more efficient use of the 8051 memory spaces.
Memory Types
Different memory types are specified. For example, Table 5-10 summarizes some of the memory type
specifiers, which may be used with the Keil Cx51 compiler.
Table 5-10 • Memory Type Specifiers for Keil Cx51 Compiler
Memory Type Description
code Program memory (64 kbytes); accessed by opcode MOVC @A + DPTR.
data Directly addressable internal data memory. This gives the fastest access to variables
(128 bytes).
idata Indirectly addressable internal data memory. Variables with this type may be accessed
across the full internal address space (256 bytes).
bdata Bit-addressable internal data memory. This supports mixed bit and byte access.
xdata External data memory (64 kbytes). This is accessed by opcode MOVX @DPTR.
As with signed and unsigned attributes, the memory type specifiers may be included in the variable
declaration. For example:
char data var1;
char code text[] = “ENTER PARAMETER:”;
unsigned long xdata array[100];
float idata x,y,z;
unsigned char xdata vector[10][4][4];
char bdata flags;
If no memory type is specified for a variable, the compiler implicitly locates the variable in the default
memory space determined by the memory model: SMALL or LARGE. Function arguments and
automatic variables that cannot be located in registers are also stored in the default memory area.
Data Types
As well as the standard data types, 8051 C compilers also define specific data types, which may be used
in the C code. For example, the Keil Cx51 compiler specifies the additional data types shown in
Table 5-11.
Note that data types relate to the sizes of the standard data types, as implemented by C compilers for the
8051. The following sizes are used:
Revision 2 47
Instruction Set
Pointers
Because of the unique nature of the 8051 architecture, management of variable pointers becomes an
issue. For example, the address of a variable in internal data memory is 8 bits and so a pointer to a
variable in this space is 8 bits. Similarly, a pointer to a variable in external data or program memory is 16
bits wide.
Memory-Specific Pointers
Memory-specific pointers always include a memory type specification in the pointer declaration and
always refer to a specific memory area. For example:
char data *str; /* ptr to string in data */
int xdata *numtab; /* ptr to int(s) in xdata */
long code *powtab; /* ptr to long(s) in code */
Memory-specific pointers can be stored using only one byte (idata, data, bdata pointers) or two bytes
(code and xdata pointers).
Generic Pointers
The Keil Cx51 compiler allows the use of generic pointers. Generic pointers are declared like standard C
pointers. For example:
char *s; /* string ptr */
int *numptr; /* int ptr */
Generic pointers are always stored using three bytes. The first byte is the memory type, the second is the
high-order byte of the offset, and the third is the low-order byte of the offset. Generic pointers may be
used to access any variable, regardless of its location in 8051 memory space. Code that uses generic
pointers runs more slowly and is larger due to the conversion required and the need to link in other library
routines. However, it is worthwhile if there is a need to mix different memory spaces. An example is the
case where a display function is required to accept pointers to code for fixed message prompts and
pointers to xdata for messages put together by software during execution. If a message stored in code
space is passed to a display function that uses xdata space, the result is garbage.
In summary, by selecting a specific memory model and by the use of generic pointers and a modified
runtime library, it is possible for a programmer to use ANSI C to target an 8051 derivative, such as
Core8051s. To achieve better system performance and smaller code size, however, the user may utilize
language extensions specified by the C compiler.
C Header Files
reg51.h
A customized version of the reg51.h file is required when compiling C code for Core8051s. This contains
the following:"
/*--------------------------------------------------------------------------
reg51.h
#ifndef __REG51_H__
#define __REG51_H__
48 R e visio n 2
Core8051s v2.4 Handbook
/* BYTE Registers */
sfr SP = 0x81;
sfr DPL = 0x82;
sfr DPH = 0x83;
sfr DPL1 = 0x84;
sfr DPH1 = 0x85;
sfr ICON = 0x88;
sfr DPS = 0x92;
sfr XWB1 = 0x9A;
sfr XWB2 = 0x9B;
sfr XWB3 = 0x9C;
sfr XRB1 = 0x9D;
sfr XRB2 = 0x9E;
sfr XRB3 = 0x9F;
sfr IE = 0xA8;
sfr PSW = 0xD0;
sfr ACC = 0xE0;
sfr B = 0xF0;
/* BIT Register */
/* PSW */
sbit CY = 0xD7;
sbit AC = 0xD6;
sbit F0 = 0xD5;
sbit RS1 = 0xD4;
sbit RS0 = 0xD3;
sbit OV = 0xD2;
sbit P = 0xD0;
#endif
"
stdio.h
Core8051s requires a custom-designed stdio library, as it doesn't contain the serial channel normally
found in 8051-based microcontrollers.
Revision 2 49
6 – Instruction Timing
clk
memaddr N N+1 N+2
memrd
memwr
mempsrd
mempswr
Sample Sample Sample
mempsack
memdatao
Read Read Read
Sample Sample Sample
memdatai (N) (N + 1) (N + 2)
Revision 2 51
Instruction Timing
clk
memaddr N N+1 N+2
memrd
memwr
mempsrd
mempswr
memdatao
memdatai (N) (N + 1)
clk
memaddr N N+1 Addr N+1
memrd
memwr
mempsrd
mempswr
Sample Sample Sample
mempsack
memdatao
memdatai (N) Data (N + 1)
52 R e visio n 2
Core8051s v2.4 Handbook
clk
memwr
mempsrd
mempswr
Sample Sample Sample Sample Sample Sample
mempsack
memdatao
Read Sample Read Sample Read Sample
clk
memrd
memwr
mempsrd
memdatao
Max. 1 × Tclk
Figure 6-5 • External Data Memory Read Cycle Without Stretch Cycles
Revision 2 53
Instruction Timing
clk
memwr
mempsrd
mempswr
memdatao
Figure 6-6 • External Data Memory Read Cycle With One Stretch Cycle
clk
memrd
memwr
mempsrd
memdatao
Max. 3 × Tclk
memdatai (N) Data (N + 1)
Read Read Read
Sample Sample Sample
Figure 6-7 • External Data Memory Read With Two Stretch Cycles
54 R e visio n 2
Core8051s v2.4 Handbook
clk
memwr
mempsrd
memdatao
Max. 8 × Tclk
Figure 6-8 • External Data Memory Read Cycle With Seven Stretch Cycles
clk
memrd
memwr
mempsrd
memdatao Data
Write Sample
memdatai (N) (N + 1)
Figure 6-9 • External Data Memory Write Cycle Without Stretch Cycles
Revision 2 55
Instruction Timing
clk
memwr
mempsrd
memdatao Data
Write Sample
memdatai (N) (N + 1)
Figure 6-10 • External Data Memory Write Cycle With One Stretch Cycle
clk
memrd
memwr
mempsrd
memdatao Data
Write Sample
memdatai (N) (N + 1)
Read Read
Sample Sample
Figure 6-11 • External Data Memory Write Cycle With Two Stretch Cycles
56 R e visio n 2
Core8051s v2.4 Handbook
clk
memrd
memwr
mempsrd
memdatao Data
Write Sample
memdatai (N) (N + 1)
Read Read
Sample Sample
Figure 6-12 • External Data Memory Write Cycle With Seven Stretch Cycles
CLK0
PADDR Addr 1
PWRITE
PSEL
PENABLE
PWDATA Data 1
PCLK
PADDR Addr 1
PWRITE
PSEL
PENABLE
PRDATA Data 1
Revision 2 57
7 – List of Changes
List of Changes
The following table lists critical changes that were made in each revision of the handbook
Revision 2 59
A – Product Support
Actel backs its products with various support services including Customer Service, a Customer Technical
Support Center, a web site, an FTP site, electronic mail, and worldwide sales offices. This appendix
contains information about contacting Actel and using these support services.
Customer Service
Contact Customer Service for non-technical product support, such as product pricing, product upgrades,
update information, order status, and authorization.
From Northeast and North Central U.S.A., call 650.318.4480
From Southeast and Southwest U.S.A., call 650. 318.4480
From South Central U.S.A., call 650.318.4434
From Northwest U.S.A., call 650.318.4434
From Canada, call 650.318.4480
From Europe, call 650.318.4252 or +44 (0) 1276 401 500
From Japan, call 650.318.4743
From the rest of the world, call 650.318.4743
Fax, from anywhere in the world 650.318.8044
Website
You can browse a variety of technical and non-technical information on Actel’s home page, at
www.actel.com.
Email
You can communicate your technical questions to our email address and receive answers back by email,
fax, or phone. Also, if you have design problems, you can email your design files to receive assistance.
We constantly monitor the email account throughout the day. When sending your request to us, please
be sure to include your full name, company name, and your contact information for efficient processing of
your request.
Revision 2 61
Product Support
Phone
Our Technical Support Center answers all calls. The center retrieves information, such as your name,
company name, phone number and your question, and then issues a case number. The Center then
forwards the information to a queue where the first available application engineer receives the data and
returns your call. The phone hours are from 7:00 a.m. to 6:00 p.m., Pacific Time, Monday through Friday.
The Technical Support numbers are:
650.318.4460
800.262.1060
Customers needing assistance outside the US time zones can either contact technical support via email
([email protected]) or contact a local sales office. Sales office listings can be found on the website at
www.actel.com/company/contact/default.aspx.
62 R e visio n 2
Index
E
external data memory space 30
G
generics 20
I
instruction definitions 45
instruction set 35
instruction timing 51
internal data memory space 31
M
microcontroller features 5
O
overview 15
P
parameters 20
port signals 17
ports 17
product support 62
customer service 61
electronic mail 61
technical support 61
telephone 62
website 61
program memory 29
S
SFR registers 31
software memory map 29
Revision 2 63
Actel is the leader in low power FPGAs and mixed signal FPGAs and offers the most comprehensive portfolio of
system and power management solutions. Power Matters. Learn more at www.actel.com.
Actel Corporation Actel Europe Ltd. Actel Japan Actel Hong Kong
2061 Stierlin Court River Court,Meadows Business Park EXOS Ebisu Buillding 4F Room 2107, China Resources Building
Mountain View, CA Station Approach, Blackwater 1-24-14 Ebisu Shibuya-ku 26 Harbour Road
94043-4655 USA Camberley Surrey GU17 9AB Tokyo 150 Japan Wanchai, Hong Kong
Phone 650.318.4200 United Kingdom Phone +81.03.3445.7671 Phone +852 2185 6460
Fax 650.318.4600 Phone +44 (0) 1276 609 300 Fax +81.03.3445.7668 Fax +852 2185 6488
Fax +44 (0) 1276 607 540 http://jp.actel.com www.actel.com.cn
© 2010 Actel Corporation. All rights reserved. Actel, Actel Fusion, IGLOO, Libero, Pigeon Point, ProASIC, SmartFusion and the associated logos are
trademarks or registered trademarks of Actel Corporation. All other trademarks and service marks are the property of their respective owners.
50200084-2/9.10