The Intel-8051 architecture was one of the first targets for the Bound-T execution-time and stack-usage analyser. This page shows:
The Intel-8051, also known as MCS-51®, is a large family of 8-bit microcontrollers. The same architecture, with extensions, is used by device families with similar names, such as the 8052, the 80C32, and so on. The company Keil, a well-known vendor of compilers for the 8051 processors, provides a good overview of the instruction set. Other rich sources of 8051 information are the 8051 compendium and 8052.com.
Several different companies produce different devices (chips) which execute the basic "8051" instruction set. New devices often have some extensions to the instruction set, and perhaps also to the set of registers. The execution time of each instruction differs from device to device.
Each type of device has its own set of on-chip peripherals, typically controlled by Special Function Registers (SFRs) mapped in the directly addressable "SFR area" of the 8051 "internal" memory space.
Different devices have different amounts of on-chip memory, some of which can be mapped to the "external" memory space of the 8051 architecture. Some devices may have access to off-chip, truly external memory, too.
Bound-T/8051 models all standard 8051 instructions. Analysis of data flow and computation is limited to 8-bit data, except for the PC (Program Counter) and the DPTR (Data Pointer Register) which are modelled as 16-bit numbers.
Dynamic changes in the selection of the register bank are not modelled, but an assertion can specify which register bank is used in a particular subprogram. Dynamic changes in the page base address (upper 8 address bits) for "paged" addressing mode (indirect access to external data memory with an 8-bit register value giving the low 8 address bits) is not modelled. The page-base address must be given as a constant in a command-line option.
Only a single DPTR is modelled, as in the original 8051. New 8051 devices often have two or more DPTRs, with the active DPTR chosen by a bit in a dedicated SFR. In some devices the DPTRs can be switched automatically at every use. Support for multiple DPTRs is likely in future versions of Bound-T/8051.
For stack usage analysis Bound-T models only the standard 8051 stack in the internal data memory, with the 8-bit SP SFR as the stack pointer. Compiler-defined stacks ("software" stacks) are not yet modelled.
The execution time of 8051 instructions often differs from device to device. Bound-T/8051 knows about some 8051 devices and their execution times; these are listed in the table below. The -device column shows the device-name to be used in the Bound-T/8051 command-line option -device. The name is not case-sensitive.
If your device is not listed in this table, please contact Tidorum to ask if this device is supported, or can be supported.
Producer | Device | -device | Notes |
---|---|---|---|
various | Standard 8051 | 8051 | |
Silicon Labs/Cygnal | CIP-51 | cip-51 | |
Nordic Semiconductor | nRF24E1 | nrf24e1 | |
nRF24LE1 | nrf24le1 | ||
Texas Instruments | CC2510 | cc2510 | Instruction cache (flash cache) assumed to always hit. |
Many cross-compilers for the 8051 exist, both "free" ones and commercially licensed ones. In principle Bound-T is able to analyse machine code from any compiler. However, different compilers create executable files in different formats, and Bound-T is not able to read all possible formats. Moreover, different compilers may generate different kinds of symbolic debugging information, which Bound-T uses to communicate with the user in source-level terms. Finally, each compiler may generate its own idiomatic instruction sequences, some of which need special analysis methods, and has its own set of library subprograms, some of which may not follow the ordinary parameter-passing and stack-handling rules and therefore need special attention in Bound-T. For these reasons, Bound-T often needs to adapt its analysis to the compiler that generated the code to be analysed.
The table below lists the 8051 cross-compilers that Bound-T currently knows about, in the sense that some aspects of the code are analysed in compiler-specific ways. However, this does not mean that Bound-T will correctly analyse all code from these compilers, for all source programs. The -compiler column shows the compiler name to be used in the Bound-T/8051 command-line option -compiler. The name is not case-sensitive.
If your compiler is not listed in this table, please contact Tidorum to ask if this compiler is supported, or can be supported.
Producer | Compiler | -compiler | Notes |
---|---|---|---|
IAR Systems | IAR 8051 C compiler | iar | |
Keil™ | C51 | keil | |
Sandeep Dutta et al. | Small Device C compiler | sdcc |
Document (PDF) | Description |
---|---|
MCS®-51 (8051) Application Note | Describes the capabilities of Bound-T for the Intel-8051 and how to use it. See also the general Bound-T manuals. |
AOMF with Keil Extensions | Describes how Bound-T reads and analyses executable programs in the AOMF file format. |
Intel® Hex as input to Bound-T | Describes how Bound-T reads and analyses executable programs in the Intel Hex file format. |
CDB from SDCC | Describes how Bound-T reads and analyses symbolic debugging information from the "CDB" files generated by the SDCC compiler. |
Here is a small 8051 program with some examples of its WCET and stack-usage analysis with Bound-T.