A C implementation of the COMP 40 Universal Machine (UM) with benchmarks, profiling artifacts, and unit-test generators.
This repository is for portfolio and learning reference only. Do not copy, submit, or adapt this code for coursework or academic evaluation.
- UM emulator implementation in C (
driver.c,instructions.c,memory.c,bitpack.c) - Official UM benchmark/program binaries in
umbin/ - Profiling workflow and historical outputs in
profiling/ - UM test inventory and guidance in
tests/
driver.c,instructions.c,memory.c,bitpack.c: Core emulatorinstructions.h,memory.h,bitpack.h: Public interfacesumbin/: UM binaries (.um/.umz) and benchmark assetsprofiling/: Callgrind outputs, charts, and profiling notestests/: UM test inventory and test-generation notesdocs/: Performance analysis notes and UM file catalog
Prerequisites:
gcc- COMP 40 support libraries (
cii40,bitpack,40locality) in the paths used byMakefile
Build emulator:
makeOptional test generator:
make writetests./um umbin/hello.um
./um umbin/midmark.um
./um umbin/sandmark.umz
./um umbin/advent.umz < adventMeasured on course lab environment:
- OS: RHEL 8.10
- Compiler: GCC 11.2.0
- CPU: Intel i7-10700T @ 2.00GHz
| Test Case | Execution Time |
|---|---|
midmark.um |
0.34s |
advent benchmark |
2.3s |
sandmark.umz |
8.43s |
Historical stress-test result from the archived HW06 report:
50,000,000instructions in about17s- Throughput about
2.94 million instructions/second
Detailed reports:
docs/performance-analysis.mdUniversialMachineEmulator/um/docs/performance-analysis.md
make profile-midmark
make profile-sandmark
make profile-adventOr:
./profiling/run_callgrind.sh umbin/midmark.um midmark
./profiling/run_callgrind.sh umbin/advent.umz advent adventMore details: profiling/README.md
- Test name inventory:
tests/UMTESTS.txt - Generated test artifact directory:
tests/generated/ - Test generator sources:
umlab.c,umlabwrite.c - Full file catalog:
docs/UM_FILES.md
docs/performance-analysis.md
No open-source license is granted for reuse in coursework submissions. All rights reserved unless explicit permission is provided by the author.