Finished implentation of devices and added Opcode class
This commit is contained in:
parent
9cc0c10e35
commit
3f39c6cb71
78 changed files with 262 additions and 90 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 18.0.0, 2025-11-23T16:35:49. -->
|
||||
<!-- Written by QtCreator 18.0.0, 2025-11-25T13:50:30. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
|
@ -105,16 +105,16 @@
|
|||
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
|
||||
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
|
||||
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_BUILD_TYPE:STRING=Debug
|
||||
-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON
|
||||
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
|
||||
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
|
||||
-DCMAKE_GENERATOR:STRING=Ninja
|
||||
-DQT_MAINTENANCE_TOOL:FILEPATH=/home/aljaz/Qt/MaintenanceTool
|
||||
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_BUILD_TYPE:STRING=Debug</value>
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
|
||||
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
|
||||
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}</value>
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
|
|
|
|||
|
|
@ -11,8 +11,11 @@ qt_add_executable(simulator
|
|||
mainwindow.cpp
|
||||
mainwindow.h
|
||||
mainwindow.ui
|
||||
machine.h machine.cpp
|
||||
device.h device.cpp
|
||||
machine.h
|
||||
machine.cpp
|
||||
device.h
|
||||
device.cpp
|
||||
opcode.h opcode.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(simulator
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
{
|
||||
"build" : ".",
|
||||
"hasInstallRule" : true,
|
||||
"jsonFile" : "directory-.-Debug-5eb11126559593f0fa7b.json",
|
||||
"jsonFile" : "directory-.-Debug-b6d99062396e1794a7ce.json",
|
||||
"minimumCMakeVersion" :
|
||||
{
|
||||
"string" : "3.16"
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
{
|
||||
"directoryIndex" : 0,
|
||||
"id" : "simulator::@6890427a1f51a3e7e1df",
|
||||
"jsonFile" : "target-simulator-Debug-88a02640b7072cb7034a.json",
|
||||
"jsonFile" : "target-simulator-Debug-0cbdc686daa89d68b1d7.json",
|
||||
"name" : "simulator",
|
||||
"projectIndex" : 0
|
||||
},
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
{
|
||||
"command" : 0,
|
||||
"file" : 0,
|
||||
"line" : 26,
|
||||
"line" : 28,
|
||||
"parent" : 0
|
||||
},
|
||||
{
|
||||
"command" : 0,
|
||||
"file" : 0,
|
||||
"line" : 37,
|
||||
"line" : 39,
|
||||
"parent" : 0
|
||||
}
|
||||
]
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
"objects" :
|
||||
[
|
||||
{
|
||||
"jsonFile" : "codemodel-v2-d3128a8c376adbd699de.json",
|
||||
"jsonFile" : "codemodel-v2-fc5483802601394ec595.json",
|
||||
"kind" : "codemodel",
|
||||
"version" :
|
||||
{
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
},
|
||||
"codemodel-v2" :
|
||||
{
|
||||
"jsonFile" : "codemodel-v2-d3128a8c376adbd699de.json",
|
||||
"jsonFile" : "codemodel-v2-fc5483802601394ec595.json",
|
||||
"kind" : "codemodel",
|
||||
"version" :
|
||||
{
|
||||
|
|
@ -71,13 +71,13 @@
|
|||
{
|
||||
"command" : 4,
|
||||
"file" : 1,
|
||||
"line" : 26,
|
||||
"line" : 28,
|
||||
"parent" : 0
|
||||
},
|
||||
{
|
||||
"command" : 5,
|
||||
"file" : 1,
|
||||
"line" : 18,
|
||||
"line" : 20,
|
||||
"parent" : 0
|
||||
},
|
||||
{
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
{
|
||||
"build" : ".",
|
||||
"hasInstallRule" : true,
|
||||
"jsonFile" : "directory-.-Debug-f4edc75a4a0d79ff8fc6.json",
|
||||
"jsonFile" : "directory-.-Debug-9e88f268bb4c5fb675f4.json",
|
||||
"minimumCMakeVersion" :
|
||||
{
|
||||
"string" : "3.16"
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
{
|
||||
"directoryIndex" : 0,
|
||||
"id" : "simulator::@6890427a1f51a3e7e1df",
|
||||
"jsonFile" : "target-simulator-Debug-4cc1cefd9b05bb84f59c.json",
|
||||
"jsonFile" : "target-simulator-Debug-44f8bd757c2b053c3c98.json",
|
||||
"name" : "simulator",
|
||||
"projectIndex" : 0
|
||||
},
|
||||
|
|
@ -17,13 +17,13 @@
|
|||
{
|
||||
"command" : 0,
|
||||
"file" : 0,
|
||||
"line" : 25,
|
||||
"line" : 29,
|
||||
"parent" : 0
|
||||
},
|
||||
{
|
||||
"command" : 0,
|
||||
"file" : 0,
|
||||
"line" : 36,
|
||||
"line" : 40,
|
||||
"parent" : 0
|
||||
}
|
||||
]
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
"objects" :
|
||||
[
|
||||
{
|
||||
"jsonFile" : "codemodel-v2-f6f2576068631c5a0258.json",
|
||||
"jsonFile" : "codemodel-v2-8462ebb8de7ac0ba3995.json",
|
||||
"kind" : "codemodel",
|
||||
"version" :
|
||||
{
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
},
|
||||
"codemodel-v2" :
|
||||
{
|
||||
"jsonFile" : "codemodel-v2-f6f2576068631c5a0258.json",
|
||||
"jsonFile" : "codemodel-v2-8462ebb8de7ac0ba3995.json",
|
||||
"kind" : "codemodel",
|
||||
"version" :
|
||||
{
|
||||
|
|
@ -71,13 +71,13 @@
|
|||
{
|
||||
"command" : 4,
|
||||
"file" : 1,
|
||||
"line" : 25,
|
||||
"line" : 29,
|
||||
"parent" : 0
|
||||
},
|
||||
{
|
||||
"command" : 5,
|
||||
"file" : 1,
|
||||
"line" : 17,
|
||||
"line" : 21,
|
||||
"parent" : 0
|
||||
},
|
||||
{
|
||||
|
|
@ -290,7 +290,9 @@
|
|||
0,
|
||||
1,
|
||||
2,
|
||||
6
|
||||
6,
|
||||
8,
|
||||
10
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
@ -381,8 +383,8 @@
|
|||
"sourceIndexes" :
|
||||
[
|
||||
0,
|
||||
7,
|
||||
8
|
||||
11,
|
||||
12
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -391,7 +393,9 @@
|
|||
[
|
||||
1,
|
||||
2,
|
||||
6
|
||||
6,
|
||||
8,
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -399,7 +403,9 @@
|
|||
"sourceIndexes" :
|
||||
[
|
||||
3,
|
||||
5
|
||||
5,
|
||||
7,
|
||||
9
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -413,7 +419,7 @@
|
|||
"name" : "CMake Rules",
|
||||
"sourceIndexes" :
|
||||
[
|
||||
9
|
||||
13
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
@ -459,6 +465,28 @@
|
|||
"path" : "machine.cpp",
|
||||
"sourceGroupIndex" : 1
|
||||
},
|
||||
{
|
||||
"backtrace" : 4,
|
||||
"path" : "device.h",
|
||||
"sourceGroupIndex" : 2
|
||||
},
|
||||
{
|
||||
"backtrace" : 4,
|
||||
"compileGroupIndex" : 0,
|
||||
"path" : "device.cpp",
|
||||
"sourceGroupIndex" : 1
|
||||
},
|
||||
{
|
||||
"backtrace" : 4,
|
||||
"path" : "opcode.h",
|
||||
"sourceGroupIndex" : 2
|
||||
},
|
||||
{
|
||||
"backtrace" : 4,
|
||||
"compileGroupIndex" : 0,
|
||||
"path" : "opcode.cpp",
|
||||
"sourceGroupIndex" : 1
|
||||
},
|
||||
{
|
||||
"backtrace" : 0,
|
||||
"isGenerated" : true,
|
||||
Binary file not shown.
|
|
@ -1,47 +1,11 @@
|
|||
# ninja log v6
|
||||
12 24 1763912138075891465 CMakeFiles/simulator.dir/device.cpp.o 36fc5c8cf014f45b
|
||||
21 1251 1763913845853384077 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
|
||||
16 224 1764073111478991803 CMakeFiles/simulator.dir/device.cpp.o 36fc5c8cf014f45b
|
||||
15 1296 1764073111477991803 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
|
||||
197 1160 1763912062733203284 CMakeFiles/simulator.dir/simulator_autogen/mocs_compilation.cpp.o 5301f473905a545f
|
||||
3 21 1763913845835384437 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
3 15 1764073111465991803 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
197 384 1763912062733203284 CMakeFiles/simulator.dir/machine.cpp.o 7030a03f8cbf1ad0
|
||||
197 1417 1763912062733203284 CMakeFiles/simulator.dir/main.cpp.o 9ebba9b7abc4cbf1
|
||||
3 21 1763913845835384437 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
|
||||
1251 1453 1763913847083359480 simulator fb8524dc610350ca
|
||||
3 21 1763913845835384437 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
3 21 1763913845835384437 simulator_autogen/timestamp c193a23cfe79571d
|
||||
3 23 1763913896006424529 simulator_autogen/timestamp c193a23cfe79571d
|
||||
3 23 1763913896006424529 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
3 23 1763913896006424529 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
|
||||
3 23 1763913896006424529 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
24 1316 1763913896027424144 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
|
||||
1316 1523 1763913897319400459 simulator fb8524dc610350ca
|
||||
2 20 1763913909470179822 simulator_autogen/timestamp c193a23cfe79571d
|
||||
2 20 1763913909470179822 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
2 20 1763913909470179822 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
|
||||
2 20 1763913909470179822 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
21 1255 1763913909489179479 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
|
||||
1255 1450 1763913910723157280 simulator fb8524dc610350ca
|
||||
1 16 1763913934167742133 simulator_autogen/timestamp c193a23cfe79571d
|
||||
1 16 1763913934167742133 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
1 16 1763913934167742133 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
|
||||
1 16 1763913934167742133 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
16 1244 1763913934182741872 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
|
||||
1244 1445 1763913935410720453 simulator fb8524dc610350ca
|
||||
3 16 1763914457574556945 simulator_autogen/timestamp c193a23cfe79571d
|
||||
3 16 1763914457574556945 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
3 16 1763914457574556945 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
|
||||
3 16 1763914457574556945 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
17 1200 1763914457588557831 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
|
||||
1200 1394 1763914458771632626 simulator fb8524dc610350ca
|
||||
3 22 1763914599452072365 simulator_autogen/timestamp c193a23cfe79571d
|
||||
3 22 1763914599452072365 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
3 22 1763914599452072365 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
|
||||
3 22 1763914599452072365 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
22 1300 1763914599471070486 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
|
||||
1300 1495 1763914600748944460 simulator fb8524dc610350ca
|
||||
3 20 1763914835502033512 simulator_autogen/timestamp c193a23cfe79571d
|
||||
3 20 1763914835502033512 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
3 20 1763914835502033512 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
|
||||
3 20 1763914835502033512 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
20 1216 1763914835519033119 CMakeFiles/simulator.dir/mainwindow.cpp.o e3901bb2e4f9b516
|
||||
1216 1445 1763914836715005676 simulator fb8524dc610350ca
|
||||
3 15 1764073111465991803 /home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/timestamp c193a23cfe79571d
|
||||
1296 1566 1764073112758991795 simulator fb8524dc610350ca
|
||||
3 15 1764073111465991803 simulator_autogen/mocs_compilation.cpp c193a23cfe79571d
|
||||
3 15 1764073111465991803 simulator_autogen/timestamp c193a23cfe79571d
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -431,6 +431,12 @@
|
|||
"MU",
|
||||
"EWIEGA46WW/moc_mainwindow.cpp",
|
||||
null
|
||||
],
|
||||
[
|
||||
"/home/aljaz/Desktop/spo/ass2/simulator/opcode.h",
|
||||
"MU",
|
||||
"EWIEGA46WW/moc_opcode.cpp",
|
||||
null
|
||||
]
|
||||
],
|
||||
"HEADER_EXTENSIONS" : [ "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" ],
|
||||
|
|
@ -494,7 +500,8 @@
|
|||
[ "/home/aljaz/Desktop/spo/ass2/simulator/device.cpp", "MU", null ],
|
||||
[ "/home/aljaz/Desktop/spo/ass2/simulator/machine.cpp", "MU", null ],
|
||||
[ "/home/aljaz/Desktop/spo/ass2/simulator/main.cpp", "MU", null ],
|
||||
[ "/home/aljaz/Desktop/spo/ass2/simulator/mainwindow.cpp", "MU", null ]
|
||||
[ "/home/aljaz/Desktop/spo/ass2/simulator/mainwindow.cpp", "MU", null ],
|
||||
[ "/home/aljaz/Desktop/spo/ass2/simulator/opcode.cpp", "MU", null ]
|
||||
],
|
||||
"UIC_OPTIONS" : [],
|
||||
"UIC_SEARCH_PATHS" : [],
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
# Generated by CMake. Changes will be overwritten.
|
||||
/home/aljaz/Desktop/spo/ass2/simulator/machine.cpp
|
||||
/home/aljaz/Desktop/spo/ass2/simulator/mainwindow.h
|
||||
mmc:Q_OBJECT
|
||||
mdp:/home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/moc_predefs.h
|
||||
|
|
@ -435,8 +434,9 @@
|
|||
mdp:/usr/lib/gcc/x86_64-linux-gnu/13/include/stdbool.h
|
||||
mdp:/usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.h
|
||||
/home/aljaz/Desktop/spo/ass2/simulator/machine.h
|
||||
/home/aljaz/Desktop/spo/ass2/simulator/machine.cpp
|
||||
/home/aljaz/Desktop/spo/ass2/simulator/device.h
|
||||
/home/aljaz/Desktop/spo/ass2/simulator/main.cpp
|
||||
/home/aljaz/Desktop/spo/ass2/simulator/device.cpp
|
||||
/home/aljaz/Desktop/spo/ass2/simulator/mainwindow.cpp
|
||||
uic:ui_mainwindow.h
|
||||
/home/aljaz/Desktop/spo/ass2/simulator/device.cpp
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
Start testing: Nov 23 16:29 CET
|
||||
Start testing: Nov 27 14:24 CET
|
||||
----------------------------------------------------------
|
||||
End testing: Nov 23 16:29 CET
|
||||
End testing: Nov 27 14:24 CET
|
||||
|
|
|
|||
|
|
@ -89,6 +89,14 @@ build CMakeFiles/simulator.dir/device.cpp.o: CXX_COMPILER__simulator_unscanned_D
|
|||
OBJECT_DIR = CMakeFiles/simulator.dir
|
||||
OBJECT_FILE_DIR = CMakeFiles/simulator.dir
|
||||
|
||||
build CMakeFiles/simulator.dir/opcode.cpp.o: CXX_COMPILER__simulator_unscanned_Debug /home/aljaz/Desktop/spo/ass2/simulator/opcode.cpp || cmake_object_order_depends_target_simulator
|
||||
DEFINES = -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB
|
||||
DEP_FILE = CMakeFiles/simulator.dir/opcode.cpp.o.d
|
||||
FLAGS = -DQT_QML_DEBUG -g -fdiagnostics-color=always -fPIC
|
||||
INCLUDES = -I/home/aljaz/Desktop/spo/ass2/simulator/build/Desktop_Qt_6_10_1-Debug/simulator_autogen/include -isystem /home/aljaz/Qt/6.10.1/gcc_64/include/QtCore -isystem /home/aljaz/Qt/6.10.1/gcc_64/include -isystem /home/aljaz/Qt/6.10.1/gcc_64/mkspecs/linux-g++ -isystem /home/aljaz/Qt/6.10.1/gcc_64/include/QtWidgets -isystem /home/aljaz/Qt/6.10.1/gcc_64/include/QtGui
|
||||
OBJECT_DIR = CMakeFiles/simulator.dir
|
||||
OBJECT_FILE_DIR = CMakeFiles/simulator.dir
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Link build statements for EXECUTABLE target simulator
|
||||
|
|
@ -97,7 +105,7 @@ build CMakeFiles/simulator.dir/device.cpp.o: CXX_COMPILER__simulator_unscanned_D
|
|||
#############################################
|
||||
# Link the executable simulator
|
||||
|
||||
build simulator: CXX_EXECUTABLE_LINKER__simulator_Debug CMakeFiles/simulator.dir/simulator_autogen/mocs_compilation.cpp.o CMakeFiles/simulator.dir/main.cpp.o CMakeFiles/simulator.dir/mainwindow.cpp.o CMakeFiles/simulator.dir/machine.cpp.o CMakeFiles/simulator.dir/device.cpp.o | /home/aljaz/Qt/6.10.1/gcc_64/lib/libQt6Widgets.so.6.10.1 /home/aljaz/Qt/6.10.1/gcc_64/lib/libQt6Gui.so.6.10.1 /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /home/aljaz/Qt/6.10.1/gcc_64/lib/libQt6Core.so.6.10.1 || simulator_autogen simulator_autogen_timestamp_deps
|
||||
build simulator: CXX_EXECUTABLE_LINKER__simulator_Debug CMakeFiles/simulator.dir/simulator_autogen/mocs_compilation.cpp.o CMakeFiles/simulator.dir/main.cpp.o CMakeFiles/simulator.dir/mainwindow.cpp.o CMakeFiles/simulator.dir/machine.cpp.o CMakeFiles/simulator.dir/device.cpp.o CMakeFiles/simulator.dir/opcode.cpp.o | /home/aljaz/Qt/6.10.1/gcc_64/lib/libQt6Widgets.so.6.10.1 /home/aljaz/Qt/6.10.1/gcc_64/lib/libQt6Gui.so.6.10.1 /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /home/aljaz/Qt/6.10.1/gcc_64/lib/libQt6Core.so.6.10.1 || simulator_autogen simulator_autogen_timestamp_deps
|
||||
FLAGS = -DQT_QML_DEBUG -g
|
||||
LINK_LIBRARIES = -Wl,-rpath,/home/aljaz/Qt/6.10.1/gcc_64/lib: /home/aljaz/Qt/6.10.1/gcc_64/lib/libQt6Widgets.so.6.10.1 /home/aljaz/Qt/6.10.1/gcc_64/lib/libQt6Gui.so.6.10.1 /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /home/aljaz/Qt/6.10.1/gcc_64/lib/libQt6Core.so.6.10.1 -Wl,-rpath-link,/home/aljaz/Qt/6.10.1/gcc_64/lib
|
||||
OBJECT_DIR = CMakeFiles/simulator.dir
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,58 @@
|
|||
#include "device.h"
|
||||
using namespace std;
|
||||
|
||||
Device::Device() {
|
||||
bool Device::test() { return true; }
|
||||
|
||||
unsigned char Device::read() { return 0; }
|
||||
|
||||
void Device::write(unsigned char) {}
|
||||
|
||||
|
||||
InputDevice::InputDevice(istream& in) {
|
||||
input = ∈
|
||||
}
|
||||
|
||||
unsigned char InputDevice::read() {
|
||||
char c;
|
||||
if (input->get(c)) {
|
||||
return static_cast<unsigned char>(c);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
OutputDevice::OutputDevice(ostream& out) {
|
||||
output = &out;
|
||||
}
|
||||
|
||||
void OutputDevice::write(unsigned char c) {
|
||||
output->put(static_cast<char>(c));
|
||||
output->flush();
|
||||
}
|
||||
|
||||
FileDevice::FileDevice(string& filename) {
|
||||
file.open(filename, ios::in | ios::out | ios::binary);
|
||||
if (!file.is_open()) {
|
||||
// ustvari datoteko
|
||||
file.clear();
|
||||
file.open(filename, ios::out | ios::binary);
|
||||
file.close();
|
||||
file.open(filename, ios::in | ios::out | ios::binary);
|
||||
}
|
||||
}
|
||||
|
||||
bool FileDevice::test() {
|
||||
return file.is_open();
|
||||
}
|
||||
|
||||
unsigned char FileDevice::read() {
|
||||
char c;
|
||||
if (file.get(c)) {
|
||||
return static_cast<unsigned char>(c);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FileDevice::write(unsigned char c) {
|
||||
file.put(static_cast<char>(c));
|
||||
file.flush();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@ public:
|
|||
};
|
||||
|
||||
class InputDevice : public Device {
|
||||
istream& input;
|
||||
istream* input;
|
||||
public:
|
||||
InputDevice(istream& in);
|
||||
unsigned char read() override;
|
||||
};
|
||||
|
||||
class OutputDevice : public Device {
|
||||
ostream& output;
|
||||
ostream* output;
|
||||
public:
|
||||
OutputDevice(ostream& out);
|
||||
void write(unsigned char value) override;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,22 @@
|
|||
#include "machine.h"
|
||||
#include "device.h"
|
||||
#include <stdexcept>
|
||||
|
||||
using namespace std;
|
||||
|
||||
Machine::Machine() {
|
||||
//nastavi registre
|
||||
A = B = L = T = S = X = PC = SW = 0;
|
||||
F = 0.0;
|
||||
//nastavi naprave
|
||||
devices[0] = new InputDevice(cin);
|
||||
devices[1] = new OutputDevice(cout);
|
||||
devices[2] = new OutputDevice(cerr);
|
||||
|
||||
for (int i = 3; i < 256; i++) {
|
||||
string filename = to_string(i) + ".dev";
|
||||
devices[i] = new FileDevice(filename);
|
||||
}
|
||||
}
|
||||
|
||||
int Machine::getReg(int reg)
|
||||
|
|
@ -32,13 +45,10 @@ void Machine::setReg(int reg, int val)
|
|||
case 4: S = val; break;
|
||||
case 5: T = val; break;
|
||||
case 8: PC = val; break;
|
||||
case 9: PC = val; break;
|
||||
case 9: SW = val; break;
|
||||
}
|
||||
}
|
||||
|
||||
int getWord(int addr);
|
||||
void setWord(int addr, int val);
|
||||
|
||||
unsigned char Machine::readByte(unsigned int address) {
|
||||
if (address > MAX_ADDRESS) {
|
||||
throw std::out_of_range("Memory read out of range");
|
||||
|
|
@ -55,7 +65,7 @@ void Machine::writeByte(unsigned int address, unsigned char val) {
|
|||
|
||||
unsigned int Machine::getWord(unsigned int address) {
|
||||
if (address + 2 > MAX_ADDRESS) {
|
||||
throw std::out_of_range("Memory write out of range");
|
||||
throw std::out_of_range("Memory read out of range");
|
||||
}
|
||||
unsigned int B1 = memory[address + 2];
|
||||
unsigned int B2 = memory[address + 1];
|
||||
|
|
@ -71,3 +81,24 @@ void Machine::setWord(unsigned int address, unsigned int val) {
|
|||
memory[address + 1] = (val >> 8) & 0xFF;
|
||||
memory[address] = (val >> 16) & 0xFF;
|
||||
}
|
||||
|
||||
Device* Machine::getDevice(int num) {
|
||||
if (num < 0 || num > 255) { return nullptr; }
|
||||
return devices[num];
|
||||
}
|
||||
|
||||
void Machine::setDevice(int num, Device* device) {
|
||||
if (num < 0 || num > 255 ) { return; }
|
||||
delete devices[num];
|
||||
devices[num] = device;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#ifndef MACHINE_H
|
||||
#define MACHINE_H
|
||||
#include "device.h"
|
||||
|
||||
class Machine {
|
||||
private:
|
||||
|
|
@ -15,6 +16,7 @@ private:
|
|||
static const int MEMORY_SIZE = 1000000;
|
||||
static const int MAX_ADDRESS = MEMORY_SIZE - 1;
|
||||
unsigned char memory[MEMORY_SIZE];
|
||||
Device* devices[256];
|
||||
|
||||
public:
|
||||
Machine();
|
||||
|
|
@ -46,6 +48,8 @@ public:
|
|||
unsigned int getWord(unsigned int address);
|
||||
void setWord(unsigned int address, unsigned int val);
|
||||
|
||||
Device * getDevice(int num);
|
||||
void setDevice(int num, Device * device);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
64
ass2/simulator/opcode.cpp
Normal file
64
ass2/simulator/opcode.cpp
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
#include "opcode.h"
|
||||
|
||||
Opcode::Opcode() {
|
||||
public:
|
||||
static constexpr int ADD = 0x18;
|
||||
static constexpr int ADDF = 0x58;
|
||||
static constexpr int ADDR = 0x90;
|
||||
static constexpr int AND = 0x40;
|
||||
static constexpr int CLEAR = 0xB4;
|
||||
static constexpr int COMP = 0x28;
|
||||
static constexpr int COMPF = 0x88;
|
||||
static constexpr int COMPR = 0xA0;
|
||||
static constexpr int DIV = 0x24;
|
||||
static constexpr int DIVF = 0x64;
|
||||
static constexpr int DIVR = 0x9C;
|
||||
static constexpr int FIX = 0xC4;
|
||||
static constexpr int FLOAT = 0xC0;
|
||||
static constexpr int HIO = 0xF4;
|
||||
static constexpr int J = 0x3C;
|
||||
static constexpr int JEQ = 0x30;
|
||||
static constexpr int JGT = 0x34;
|
||||
static constexpr int JLT = 0x38;
|
||||
static constexpr int JSUB = 0x48;
|
||||
static constexpr int LDA = 0x00;
|
||||
static constexpr int LDB = 0x68;
|
||||
static constexpr int LDCH = 0x50;
|
||||
static constexpr int LDF = 0x70;
|
||||
static constexpr int LDL = 0x08;
|
||||
static constexpr int LDS = 0x6C;
|
||||
static constexpr int LDT = 0x74;
|
||||
static constexpr int LDX = 0x04;
|
||||
static constexpr int LPS = 0xD0;
|
||||
static constexpr int MUL = 0x20;
|
||||
static constexpr int MULF = 0x60;
|
||||
static constexpr int MULR = 0x98;
|
||||
static constexpr int NORM = 0xC8;
|
||||
static constexpr int OR = 0x44;
|
||||
static constexpr int RD = 0xD8;
|
||||
static constexpr int RMO = 0xAC;
|
||||
static constexpr int RSUB = 0x4C;
|
||||
static constexpr int SHIFTL = 0xA4;
|
||||
static constexpr int SHIFTR = 0xA8;
|
||||
static constexpr int SIO = 0xF0;
|
||||
static constexpr int SSK = 0xEC;
|
||||
static constexpr int STA = 0x0C;
|
||||
static constexpr int STB = 0x78;
|
||||
static constexpr int STCH = 0x54;
|
||||
static constexpr int STF = 0x80;
|
||||
static constexpr int STI = 0xD4;
|
||||
static constexpr int STL = 0x14;
|
||||
static constexpr int STS = 0x7C;
|
||||
static constexpr int STSW = 0xE8;
|
||||
static constexpr int STT = 0x84;
|
||||
static constexpr int STX = 0x10;
|
||||
static constexpr int SUB = 0x1C;
|
||||
static constexpr int SUBF = 0x5C;
|
||||
static constexpr int SUBR = 0x94;
|
||||
static constexpr int SVC = 0xB0;
|
||||
static constexpr int TD = 0xE0;
|
||||
static constexpr int TIO = 0xF8;
|
||||
static constexpr int TIX = 0x2C;
|
||||
static constexpr int TIXR = 0xB8;
|
||||
static constexpr int WD = 0xDC;
|
||||
}
|
||||
10
ass2/simulator/opcode.h
Normal file
10
ass2/simulator/opcode.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef OPCODE_H
|
||||
#define OPCODE_H
|
||||
|
||||
class Opcode
|
||||
{
|
||||
public:
|
||||
Opcode();
|
||||
};
|
||||
|
||||
#endif // OPCODE_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue