A SYSTEM FOR MODELLING AND VISUALIZING PROCESSOR STATE DURING CODE EXECUTION
Authors: Yermakov Alexander , Stroganov Iurii 
Published: February 2023

The main purpose of application is to simulate processor's behavior during execution of some code. The user has a database of processors which he can modify by adding new processors or changing properties of existing ones. It means that the user can fill a database with either real-world units and examine their behavior or try experimenting with properties in order to achieve different results not presented in any existing instances. Processors are defined as elements they are built from and elements' properties such as their count, bit depth, capacity and etc. Such definition can be quite accurate and mostly depends on how accurately processor's elements are described. However, not all aspects can be covered with such approach. For instance, there exists an algorithm which sole purpose is to balance requests between processor elements but the algorithm itself is quite tricky and is difficult to find, so it is not emulated in this app. The user chooses one of processors from database and inputs machine command sequence. The application runs each command one after another and simulates processor's behavior according to current command: sets or clears bits, writes to or reads from registers, uses certain elements for computations and etc. All the activity is visualized at runtime which can be used for educational purposes in order to deeply understand what is going on when a curtain command or piece of code is executed. It may be crucial for those who are into assembler both getting started and having some experience as seeing how exactly commands effect current state of machine and what values they change not only helps to understand more thoroughly how assembler works but also makes it easier to debug code as it can be dreadful to do without visual assistance and scare beginners away. This also might be helpful for those who study system-level programming to visualize and have better understanding of how things like memory and processes management and inter-process communication work. Main elements of processor are displayed during visualization, as well as all data flow, values stored in registers and changes caused by current command execution. Moreover, statistics can be gathered and accessed at any time during or after execution. Statistics can be used either for profiling (understanding which elements are frequently used and which are not, balancing load between them) or for registering frequent command sequence patterns (can be useful in production of new processors as these sequences can be replaced with one command). Both visualization and statistics might help to understand why some algorithms are not very efficient and why some others are (e.g. recurrent and iterative ones) as it could be more intuitively obvious. The application is not designed to be used as a part of virtual machine but as a showcase of processors, their basic structure and operation. Above all else, application can be used by those who are experienced at coding for some specific platform and have to move to another one. Such situations can happen to those who code for microcontrollers. In these cases, education curve might become smoother as differences between platforms become vivid.