Project used to simulate Manchester baby (Available on Windows and Linux)
This C++ project uses Qt5 for implementing GUI and is configured by QMake.
Before you begin, ensure you have met the following requirements:
- You have a Linux machine. This project has been tested on Ubuntu 18.04, but it should work on other distributions as well.
- You have installed Qt5. Check your Qt and QMake version using the command
qmake --version
. This project has been tested with Qt version 5.9.5 and QMake version 3.1. - You have installed Qt Creator. This will provide a user-friendly interface for managing and compiling the project.
Follow these steps to get this project ready for compiling and running:
-
Open the project
ManchesterBaby
in Qt Creator. TheManchesterBaby.pro
file in the project should be detected and selectable when navigating the project location. -
Qt Creator should prompt that the project has not been configured. Configure the project using the Desktop kit.
-
If necessary (for usually this is automatically done, but it is always a good idea to double-check), manually set to use the Qt5 version of QMake:
-
Go to
Tools > Options
. -
Navigate to the
Build & Run
section, and then theQt Versions
tab. -
Click
Add...
and navigate to the location of the Qt5 QMake binary (usually/YOUR_PATH_TO/Qt5.x.x/gcc_64/bin/qmake
). -
Click
Apply
andOK
.
-
-
You should see all the C++ code files (FOUR
.cpp
files includingmain.cpp
and THREE.h
files) inHeaders
andSources
sections in theProjects
view area on the left (Expand theManchesterBaby
folder first if you haven't). If not, check theManchesterBaby.pro
file and make sure the following part is correct:SOURCES += \ main.cpp \ widget.cpp \ baby.cpp \ assembler.cpp HEADERS += \ widget.h \ baby.h \ assembler.h
Save the file (Ctrl
+ S
) after every time you make a change to this file, or any other files.
- Build the project (
Ctrl
+B
). This will create abuild-ManchesterBaby-Desktop-debug
directory in your project root (The same level as theManchesterBaby
folder). Make sure you can find it. - If you haven't done so, rename your assembly language file to
assemble.txt
and put the file into thebuild-ManchesterBaby-Desktop-debug
directory. (There are three sample assembly program files are enclosed in the folderAssembler_Sample
and ready to be used, do remember to rename if you want to use them). - Compile and run the program (
Ctrl
+R
). Make sure the Qt Creator is working on the correct project and is currently inDebug
mode before running. These can be checked right above theRun
button.
After the program starts, the assembler in the program will read the assemble.txt
. A log file named log.txt
will be generated by the assembler to record every step of the process of translating assembly language (including whether each of them is successful or not), in build-ManchesterBaby-Desktop-debug
folder.
Then the GUI window for Manchester Baby simulator will automatically appear:
![3cadf57822f63a9ff5c36690e5ef918](https://private-user-images.githubusercontent.com/117800515/291877176-061baf1f-70f0-4f21-9d8a-2ba6494a45b9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2ODQzNDcsIm5iZiI6MTczOTY4NDA0NywicGF0aCI6Ii8xMTc4MDA1MTUvMjkxODc3MTc2LTA2MWJhZjFmLTcwZjAtNGYyMS05ZDhhLTJiYTY0OTRhNDViOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwNTM0MDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wNzU5OTdkZDA5ODljOGY4ZjE0OGEwZGY5YTQyZWZjOGJlYmQ3ODlmY2YyYjIzMGQ2M2M2YjQ3Zjc4OWZkMzQ2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.noe1OHmPuXMxOFENlBGytr8eCoFwbQ4YWrpcOPZHZp0)
The large text display area on the left in the window represents the machine code generated by the assembler. If the window does not appear, or the machine code seems to differ from what should be translated from your assembly language program, it's likely that something is wrong with the assembler language file provided. Check the log.txt
in these cases.
There are three buttons to interact with in the simulator window:
Reload MC
: Refreshes the machine code display area. It's unlikely that you need to press this manually at any stage, for this will be done automatically when starting the program, and when the Manchester Baby simulator is running.Run
: Starts (or restarts) running the simulator. The program will execute each step at 1-second intervals. If you are using it for restarting, note that the memory could have been updated during the baby's last execution and restarting may lead to inconsistent results with expectations.End
: Stops the simulator, like manually giving aHALT
instruction to the baby. This only works when the simulator is running.
The information panel on the right displays all the essential information during execution.
Please ensure that your system does not have any overly dependencies that might conflict with the project. This project has been tested with GCC 7.5.0 and GNU Make 4.1.
Thanks to the team members for their long hours of investment in this project.Our main contributions are listed below:
- Siyu Yan: Responsible for the construction of the basic main functions of simulator, project organization, and video recording.
- Jason Cai: Responsible for the improvement of additional functions of simulator, the construction of GUI, and partial debugging.
- Haoyang Lai: Responsible for the construction of assembler code and debugging of part code.
- Siqi Peng: Responsible for assembler code packaging and video editing.
- Zibang Nie: Responsible for environment configuration and report writing.
You can find our project video on bilibili at The Manchester Baby Demonstration-哔哩哔哩
MIT License