Intel 8051 Simulator

The following is a high level simulator for the Intel 8051 written in C++. The simulator allows a user to simulate simple programs written for the 8051. The simulator provides statistics on instructions executed, instructions executed per second, execution cycles required by the 8051, and average instructions per second for an 8051 executing the same program.

Not Supported

Download

Version 1.4 Source File Listing

i8051.h
i8051.cc
main.cc
Makefile
8051sim.tar.gz (Contains all files)

Changes in Version 1.4

Test Files

Test files can be found on the Synopsys Synthesizable Intel 8051 Model page. All test files except testall have been verified to function properly with this simulator.

Instructions

The simulator will continue executing the provided program until either the user hit Ctrl-C or the program completion condition is met. The program completion condition can be set by defining a macro PROGRAM_COMPLETION located in i8051.h to indicate the program completion condition, e.g., RAM[P0] == 0x01.

The program's output can be controlled through the macros PORTS, DEBUG, DEBUG_PC and DETAIL located in i8051.h. If PORTS is defined, anytime one of the output ports of the 8051 changes all ports will be printed out. If DEBUG is defined, a trace of all instructions executed by the simulator will be outputted to the output file specified by the user. If DEBUG is defined and DEBUG_PC is defined the PC for each instruction executed will be outputted to the output file. Finally, if DETAIL is defined, more information regarding each instruction will outputted to the output file.

NOTE: DEBUG_PC and DETAIL are not available in version 1.0.

To use the simulator, edit i8051.h and uncomment the PORTS, DEBUG, DEBUG_PC, and/or DETAIL macros to enable the respective output. Modify the macro PROGRAM_COMPLETION to the appropriate completion condition. If there is no program completion condition do not define PROGRAM_COMPLETION. Make the executable using the supplied Makefile. The program can be invoked by the following command

Previous Versions of Simulator

An archive of previous versions of the simulator can be found here.

Problems And Comments

Please direct any problems and comments to dalton@cs.ucr.edu. We will respond to all inquiries as quick as possible.

Return to Dalton home page



Last Updated 1/5/2001