diff options
| author | manuel <manuel@nc8430.lan> | 2009-05-26 14:49:37 +0200 |
|---|---|---|
| committer | manuel <manuel@nc8430.lan> | 2009-05-26 14:49:37 +0200 |
| commit | 1a60d0c2a8eeef3b39ef276f0f3552552a1519b1 (patch) | |
| tree | 038e7ea34e7093f959372885869234b90734331e | |
| parent | 1b2db0dfe36f134850965276ba62700dba02da4d (diff) | |
| download | ooprog-1a60d0c2a8eeef3b39ef276f0f3552552a1519b1.tar.gz ooprog-1a60d0c2a8eeef3b39ef276f0f3552552a1519b1.tar.bz2 ooprog-1a60d0c2a8eeef3b39ef276f0f3552552a1519b1.zip | |
adding ue4 (copy from ue3)
| -rw-r--r-- | ue4/Makefile | 29 | ||||
| -rw-r--r-- | ue4/angabe.pdf | bin | 0 -> 80151 bytes | |||
| -rw-r--r-- | ue4/doxygen.conf | 1299 | ||||
| -rw-r--r-- | ue4/mycpu/Makefile | 40 | ||||
| -rw-r--r-- | ue4/mycpu/ccpu.cpp | 89 | ||||
| -rw-r--r-- | ue4/mycpu/ccpu.h | 241 | ||||
| -rw-r--r-- | ue4/mycpu/cdat.h | 326 | ||||
| -rw-r--r-- | ue4/mycpu/cdisplay.h | 85 | ||||
| -rw-r--r-- | ue4/mycpu/cinstruction.cpp | 48 | ||||
| -rw-r--r-- | ue4/mycpu/cinstruction.h | 189 | ||||
| -rw-r--r-- | ue4/mycpu/cmem.h | 109 | ||||
| -rw-r--r-- | ue4/mycpu/cprogram.cpp | 161 | ||||
| -rw-r--r-- | ue4/mycpu/cprogram.h | 106 | ||||
| -rw-r--r-- | ue4/mycpu/displays.h | 76 | ||||
| -rw-r--r-- | ue4/mycpu/instructions.cpp | 341 | ||||
| -rw-r--r-- | ue4/mycpu/instructions.h | 454 | ||||
| -rw-r--r-- | ue4/mycpu/mycpu.cpp | 155 | ||||
| -rwxr-xr-x | ue4/mycpu/test/test.sh | 42 | ||||
| -rw-r--r-- | ue4/mycpu/test/test1_memory | 1 | ||||
| -rw-r--r-- | ue4/mycpu/test/test1_output | 19 | ||||
| -rw-r--r-- | ue4/mycpu/test/test1_program | 13 | ||||
| -rw-r--r-- | ue4/protokoll.pdf | bin | 0 -> 406583 bytes | |||
| -rw-r--r-- | ue4/protokoll/Makefile | 20 | ||||
| -rw-r--r-- | ue4/protokoll/fancyheadings.sty | 166 | ||||
| -rw-r--r-- | ue4/protokoll/oop_prot.sty | 222 | ||||
| -rw-r--r-- | ue4/protokoll/protokoll.tex | 92 |
26 files changed, 4323 insertions, 0 deletions
diff --git a/ue4/Makefile b/ue4/Makefile new file mode 100644 index 0000000..821c986 --- /dev/null +++ b/ue4/Makefile | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | # Makefile for ue4 | ||
| 2 | # Author: Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 3 | # Created: 26.05.2009 | ||
| 4 | |||
| 5 | SUBDIRS= mycpu | ||
| 6 | RECURSIVE_TARGETS= all-recursive debug test clean | ||
| 7 | |||
| 8 | all: all-recursive | ||
| 9 | |||
| 10 | $(RECURSIVE_TARGETS): | ||
| 11 | @failcom='exit 1'; \ | ||
| 12 | target=`echo $@ | sed s/-recursive//`; \ | ||
| 13 | list='$(SUBDIRS)'; for subdir in $$list; do \ | ||
| 14 | echo "Making $$target in $$subdir"; \ | ||
| 15 | (cd $$subdir && $(MAKE) $$target) \ | ||
| 16 | || eval $$failcom; \ | ||
| 17 | done; \ | ||
| 18 | test -z "$$fail" | ||
| 19 | |||
| 20 | doxygen: | ||
| 21 | @doxygen doxygen.conf | ||
| 22 | |||
| 23 | protokoll: | ||
| 24 | @echo "Making protokoll"; \ | ||
| 25 | (cd protokoll && $(MAKE)) | ||
| 26 | |||
| 27 | .PHONY: protokoll doxygen clean | ||
| 28 | |||
| 29 | # vim600: noet sw=8 ts=8 | ||
diff --git a/ue4/angabe.pdf b/ue4/angabe.pdf new file mode 100644 index 0000000..d323346 --- /dev/null +++ b/ue4/angabe.pdf | |||
| Binary files differ | |||
diff --git a/ue4/doxygen.conf b/ue4/doxygen.conf new file mode 100644 index 0000000..d8b9773 --- /dev/null +++ b/ue4/doxygen.conf | |||
| @@ -0,0 +1,1299 @@ | |||
| 1 | # Doxyfile 1.5.3 | ||
| 2 | |||
| 3 | # This file describes the settings to be used by the documentation system | ||
| 4 | # doxygen (www.doxygen.org) for a project | ||
| 5 | # | ||
| 6 | # All text after a hash (#) is considered a comment and will be ignored | ||
| 7 | # The format is: | ||
| 8 | # TAG = value [value, ...] | ||
| 9 | # For lists items can also be appended using: | ||
| 10 | # TAG += value [value, ...] | ||
| 11 | # Values that contain spaces should be placed between quotes (" ") | ||
| 12 | |||
| 13 | #--------------------------------------------------------------------------- | ||
| 14 | # Project related configuration options | ||
| 15 | #--------------------------------------------------------------------------- | ||
| 16 | |||
| 17 | # This tag specifies the encoding used for all characters in the config file that | ||
| 18 | # follow. The default is UTF-8 which is also the encoding used for all text before | ||
| 19 | # the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into | ||
| 20 | # libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of | ||
| 21 | # possible encodings. | ||
| 22 | |||
| 23 | DOXYFILE_ENCODING = UTF-8 | ||
| 24 | |||
| 25 | # The PROJECT_NAME tag is a single word (or a sequence of words surrounded | ||
| 26 | # by quotes) that should identify the project. | ||
| 27 | |||
| 28 | PROJECT_NAME = mycpu | ||
| 29 | |||
| 30 | # The PROJECT_NUMBER tag can be used to enter a project or revision number. | ||
| 31 | # This could be handy for archiving the generated documentation or | ||
| 32 | # if some version control system is used. | ||
| 33 | |||
| 34 | PROJECT_NUMBER = | ||
| 35 | |||
| 36 | # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) | ||
| 37 | # base path where the generated documentation will be put. | ||
| 38 | # If a relative path is entered, it will be relative to the location | ||
| 39 | # where doxygen was started. If left blank the current directory will be used. | ||
| 40 | |||
| 41 | OUTPUT_DIRECTORY = doxygen/ | ||
| 42 | |||
| 43 | # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create | ||
| 44 | # 4096 sub-directories (in 2 levels) under the output directory of each output | ||
| 45 | # format and will distribute the generated files over these directories. | ||
| 46 | # Enabling this option can be useful when feeding doxygen a huge amount of | ||
| 47 | # source files, where putting all generated files in the same directory would | ||
| 48 | # otherwise cause performance problems for the file system. | ||
| 49 | |||
| 50 | CREATE_SUBDIRS = NO | ||
| 51 | |||
| 52 | # The OUTPUT_LANGUAGE tag is used to specify the language in which all | ||
| 53 | # documentation generated by doxygen is written. Doxygen will use this | ||
| 54 | # information to generate all constant output in the proper language. | ||
| 55 | # The default language is English, other supported languages are: | ||
| 56 | # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, | ||
| 57 | # Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, | ||
| 58 | # Italian, Japanese, Japanese-en (Japanese with English messages), Korean, | ||
| 59 | # Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, | ||
| 60 | # Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. | ||
| 61 | |||
| 62 | OUTPUT_LANGUAGE = English | ||
| 63 | |||
| 64 | # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will | ||
| 65 | # include brief member descriptions after the members that are listed in | ||
| 66 | # the file and class documentation (similar to JavaDoc). | ||
| 67 | # Set to NO to disable this. | ||
| 68 | |||
| 69 | BRIEF_MEMBER_DESC = YES | ||
| 70 | |||
| 71 | # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend | ||
| 72 | # the brief description of a member or function before the detailed description. | ||
| 73 | # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the | ||
| 74 | # brief descriptions will be completely suppressed. | ||
| 75 | |||
| 76 | REPEAT_BRIEF = YES | ||
| 77 | |||
| 78 | # This tag implements a quasi-intelligent brief description abbreviator | ||
| 79 | # that is used to form the text in various listings. Each string | ||
| 80 | # in this list, if found as the leading text of the brief description, will be | ||
| 81 | # stripped from the text and the result after processing the whole list, is | ||
| 82 | # used as the annotated text. Otherwise, the brief description is used as-is. | ||
| 83 | # If left blank, the following values are used ("$name" is automatically | ||
| 84 | # replaced with the name of the entity): "The $name class" "The $name widget" | ||
| 85 | # "The $name file" "is" "provides" "specifies" "contains" | ||
| 86 | # "represents" "a" "an" "the" | ||
| 87 | |||
| 88 | ABBREVIATE_BRIEF = | ||
| 89 | |||
| 90 | # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then | ||
| 91 | # Doxygen will generate a detailed section even if there is only a brief | ||
| 92 | # description. | ||
| 93 | |||
| 94 | ALWAYS_DETAILED_SEC = NO | ||
| 95 | |||
| 96 | # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all | ||
| 97 | # inherited members of a class in the documentation of that class as if those | ||
| 98 | # members were ordinary class members. Constructors, destructors and assignment | ||
| 99 | # operators of the base classes will not be shown. | ||
| 100 | |||
| 101 | INLINE_INHERITED_MEMB = NO | ||
| 102 | |||
| 103 | # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full | ||
| 104 | # path before files name in the file list and in the header files. If set | ||
| 105 | # to NO the shortest path that makes the file name unique will be used. | ||
| 106 | |||
| 107 | FULL_PATH_NAMES = YES | ||
| 108 | |||
| 109 | # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag | ||
| 110 | # can be used to strip a user-defined part of the path. Stripping is | ||
| 111 | # only done if one of the specified strings matches the left-hand part of | ||
| 112 | # the path. The tag can be used to show relative paths in the file list. | ||
| 113 | # If left blank the directory from which doxygen is run is used as the | ||
| 114 | # path to strip. | ||
| 115 | |||
| 116 | STRIP_FROM_PATH = | ||
| 117 | |||
| 118 | # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of | ||
| 119 | # the path mentioned in the documentation of a class, which tells | ||
| 120 | # the reader which header file to include in order to use a class. | ||
| 121 | # If left blank only the name of the header file containing the class | ||
| 122 | # definition is used. Otherwise one should specify the include paths that | ||
| 123 | # are normally passed to the compiler using the -I flag. | ||
| 124 | |||
| 125 | STRIP_FROM_INC_PATH = | ||
| 126 | |||
| 127 | # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter | ||
| 128 | # (but less readable) file names. This can be useful is your file systems | ||
| 129 | # doesn't support long names like on DOS, Mac, or CD-ROM. | ||
| 130 | |||
| 131 | SHORT_NAMES = NO | ||
| 132 | |||
| 133 | # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen | ||
| 134 | # will interpret the first line (until the first dot) of a JavaDoc-style | ||
| 135 | # comment as the brief description. If set to NO, the JavaDoc | ||
| 136 | # comments will behave just like regular Qt-style comments | ||
| 137 | # (thus requiring an explicit @brief command for a brief description.) | ||
| 138 | |||
| 139 | JAVADOC_AUTOBRIEF = NO | ||
| 140 | |||
| 141 | # If the QT_AUTOBRIEF tag is set to YES then Doxygen will | ||
| 142 | # interpret the first line (until the first dot) of a Qt-style | ||
| 143 | # comment as the brief description. If set to NO, the comments | ||
| 144 | # will behave just like regular Qt-style comments (thus requiring | ||
| 145 | # an explicit \brief command for a brief description.) | ||
| 146 | |||
| 147 | QT_AUTOBRIEF = NO | ||
| 148 | |||
| 149 | # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen | ||
| 150 | # treat a multi-line C++ special comment block (i.e. a block of //! or /// | ||
| 151 | # comments) as a brief description. This used to be the default behaviour. | ||
| 152 | # The new default is to treat a multi-line C++ comment block as a detailed | ||
| 153 | # description. Set this tag to YES if you prefer the old behaviour instead. | ||
| 154 | |||
| 155 | MULTILINE_CPP_IS_BRIEF = NO | ||
| 156 | |||
| 157 | # If the DETAILS_AT_TOP tag is set to YES then Doxygen | ||
| 158 | # will output the detailed description near the top, like JavaDoc. | ||
| 159 | # If set to NO, the detailed description appears after the member | ||
| 160 | # documentation. | ||
| 161 | |||
| 162 | DETAILS_AT_TOP = NO | ||
| 163 | |||
| 164 | # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented | ||
| 165 | # member inherits the documentation from any documented member that it | ||
| 166 | # re-implements. | ||
| 167 | |||
| 168 | INHERIT_DOCS = YES | ||
| 169 | |||
| 170 | # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce | ||
| 171 | # a new page for each member. If set to NO, the documentation of a member will | ||
| 172 | # be part of the file/class/namespace that contains it. | ||
| 173 | |||
| 174 | SEPARATE_MEMBER_PAGES = NO | ||
| 175 | |||
| 176 | # The TAB_SIZE tag can be used to set the number of spaces in a tab. | ||
| 177 | # Doxygen uses this value to replace tabs by spaces in code fragments. | ||
| 178 | |||
| 179 | TAB_SIZE = 8 | ||
| 180 | |||
| 181 | # This tag can be used to specify a number of aliases that acts | ||
| 182 | # as commands in the documentation. An alias has the form "name=value". | ||
| 183 | # For example adding "sideeffect=\par Side Effects:\n" will allow you to | ||
| 184 | # put the command \sideeffect (or @sideeffect) in the documentation, which | ||
| 185 | # will result in a user-defined paragraph with heading "Side Effects:". | ||
| 186 | # You can put \n's in the value part of an alias to insert newlines. | ||
| 187 | |||
| 188 | ALIASES = "module=\par Modulname:\n" | ||
| 189 | ALIASES += "func=\par Functionname:\n" | ||
| 190 | ALIASES += "method=\par Methodname:\n" | ||
| 191 | ALIASES += "globalvars=\par Global variables used:\n" | ||
| 192 | #ALIASES += "exceptions=\par Exceptions thrown:\n" | ||
| 193 | ALIASES += "conditions=\par Conditions:\n" | ||
| 194 | |||
| 195 | # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C | ||
| 196 | # sources only. Doxygen will then generate output that is more tailored for C. | ||
| 197 | # For instance, some of the names that are used will be different. The list | ||
| 198 | # of all members will be omitted, etc. | ||
| 199 | |||
| 200 | OPTIMIZE_OUTPUT_FOR_C = NO | ||
| 201 | |||
| 202 | # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java | ||
| 203 | # sources only. Doxygen will then generate output that is more tailored for Java. | ||
| 204 | # For instance, namespaces will be presented as packages, qualified scopes | ||
| 205 | # will look different, etc. | ||
| 206 | |||
| 207 | OPTIMIZE_OUTPUT_JAVA = NO | ||
| 208 | |||
| 209 | # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to | ||
| 210 | # include (a tag file for) the STL sources as input, then you should | ||
| 211 | # set this tag to YES in order to let doxygen match functions declarations and | ||
| 212 | # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. | ||
| 213 | # func(std::string) {}). This also make the inheritance and collaboration | ||
| 214 | # diagrams that involve STL classes more complete and accurate. | ||
| 215 | |||
| 216 | BUILTIN_STL_SUPPORT = NO | ||
| 217 | |||
| 218 | # If you use Microsoft's C++/CLI language, you should set this option to YES to | ||
| 219 | # enable parsing support. | ||
| 220 | |||
| 221 | CPP_CLI_SUPPORT = NO | ||
| 222 | |||
| 223 | # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC | ||
| 224 | # tag is set to YES, then doxygen will reuse the documentation of the first | ||
| 225 | # member in the group (if any) for the other members of the group. By default | ||
| 226 | # all members of a group must be documented explicitly. | ||
| 227 | |||
| 228 | DISTRIBUTE_GROUP_DOC = NO | ||
| 229 | |||
| 230 | # Set the SUBGROUPING tag to YES (the default) to allow class member groups of | ||
| 231 | # the same type (for instance a group of public functions) to be put as a | ||
| 232 | # subgroup of that type (e.g. under the Public Functions section). Set it to | ||
| 233 | # NO to prevent subgrouping. Alternatively, this can be done per class using | ||
| 234 | # the \nosubgrouping command. | ||
| 235 | |||
| 236 | SUBGROUPING = YES | ||
| 237 | |||
| 238 | #--------------------------------------------------------------------------- | ||
| 239 | # Build related configuration options | ||
| 240 | #--------------------------------------------------------------------------- | ||
| 241 | |||
| 242 | # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in | ||
| 243 | # documentation are documented, even if no documentation was available. | ||
| 244 | # Private class members and static file members will be hidden unless | ||
| 245 | # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES | ||
| 246 | |||
| 247 | EXTRACT_ALL = NO | ||
| 248 | |||
| 249 | # If the EXTRACT_PRIVATE tag is set to YES all private members of a class | ||
| 250 | # will be included in the documentation. | ||
| 251 | |||
| 252 | EXTRACT_PRIVATE = NO | ||
| 253 | |||
| 254 | # If the EXTRACT_STATIC tag is set to YES all static members of a file | ||
| 255 | # will be included in the documentation. | ||
| 256 | |||
| 257 | EXTRACT_STATIC = NO | ||
| 258 | |||
| 259 | # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) | ||
| 260 | # defined locally in source files will be included in the documentation. | ||
| 261 | # If set to NO only classes defined in header files are included. | ||
| 262 | |||
| 263 | EXTRACT_LOCAL_CLASSES = YES | ||
| 264 | |||
| 265 | # This flag is only useful for Objective-C code. When set to YES local | ||
| 266 | # methods, which are defined in the implementation section but not in | ||
| 267 | # the interface are included in the documentation. | ||
| 268 | # If set to NO (the default) only methods in the interface are included. | ||
| 269 | |||
| 270 | EXTRACT_LOCAL_METHODS = NO | ||
| 271 | |||
| 272 | # If this flag is set to YES, the members of anonymous namespaces will be extracted | ||
| 273 | # and appear in the documentation as a namespace called 'anonymous_namespace{file}', | ||
| 274 | # where file will be replaced with the base name of the file that contains the anonymous | ||
| 275 | # namespace. By default anonymous namespace are hidden. | ||
| 276 | |||
| 277 | EXTRACT_ANON_NSPACES = NO | ||
| 278 | |||
| 279 | # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all | ||
| 280 | # undocumented members of documented classes, files or namespaces. | ||
| 281 | # If set to NO (the default) these members will be included in the | ||
| 282 | # various overviews, but no documentation section is generated. | ||
| 283 | # This option has no effect if EXTRACT_ALL is enabled. | ||
| 284 | |||
| 285 | HIDE_UNDOC_MEMBERS = NO | ||
| 286 | |||
| 287 | # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all | ||
| 288 | # undocumented classes that are normally visible in the class hierarchy. | ||
| 289 | # If set to NO (the default) these classes will be included in the various | ||
| 290 | # overviews. This option has no effect if EXTRACT_ALL is enabled. | ||
| 291 | |||
| 292 | HIDE_UNDOC_CLASSES = NO | ||
| 293 | |||
| 294 | # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all | ||
| 295 | # friend (class|struct|union) declarations. | ||
| 296 | # If set to NO (the default) these declarations will be included in the | ||
| 297 | # documentation. | ||
| 298 | |||
| 299 | HIDE_FRIEND_COMPOUNDS = NO | ||
| 300 | |||
| 301 | # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any | ||
| 302 | # documentation blocks found inside the body of a function. | ||
| 303 | # If set to NO (the default) these blocks will be appended to the | ||
| 304 | # function's detailed documentation block. | ||
| 305 | |||
| 306 | HIDE_IN_BODY_DOCS = NO | ||
| 307 | |||
| 308 | # The INTERNAL_DOCS tag determines if documentation | ||
| 309 | # that is typed after a \internal command is included. If the tag is set | ||
| 310 | # to NO (the default) then the documentation will be excluded. | ||
| 311 | # Set it to YES to include the internal documentation. | ||
| 312 | |||
| 313 | INTERNAL_DOCS = NO | ||
| 314 | |||
| 315 | # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate | ||
| 316 | # file names in lower-case letters. If set to YES upper-case letters are also | ||
| 317 | # allowed. This is useful if you have classes or files whose names only differ | ||
| 318 | # in case and if your file system supports case sensitive file names. Windows | ||
| 319 | # and Mac users are advised to set this option to NO. | ||
| 320 | |||
| 321 | CASE_SENSE_NAMES = YES | ||
| 322 | |||
| 323 | # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen | ||
| 324 | # will show members with their full class and namespace scopes in the | ||
| 325 | # documentation. If set to YES the scope will be hidden. | ||
| 326 | |||
| 327 | HIDE_SCOPE_NAMES = NO | ||
| 328 | |||
| 329 | # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen | ||
| 330 | # will put a list of the files that are included by a file in the documentation | ||
| 331 | # of that file. | ||
| 332 | |||
| 333 | SHOW_INCLUDE_FILES = YES | ||
| 334 | |||
| 335 | # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] | ||
| 336 | # is inserted in the documentation for inline members. | ||
| 337 | |||
| 338 | INLINE_INFO = YES | ||
| 339 | |||
| 340 | # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen | ||
| 341 | # will sort the (detailed) documentation of file and class members | ||
| 342 | # alphabetically by member name. If set to NO the members will appear in | ||
| 343 | # declaration order. | ||
| 344 | |||
| 345 | SORT_MEMBER_DOCS = YES | ||
| 346 | |||
| 347 | # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the | ||
| 348 | # brief documentation of file, namespace and class members alphabetically | ||
| 349 | # by member name. If set to NO (the default) the members will appear in | ||
| 350 | # declaration order. | ||
| 351 | |||
| 352 | SORT_BRIEF_DOCS = NO | ||
| 353 | |||
| 354 | # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be | ||
| 355 | # sorted by fully-qualified names, including namespaces. If set to | ||
| 356 | # NO (the default), the class list will be sorted only by class name, | ||
| 357 | # not including the namespace part. | ||
| 358 | # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. | ||
| 359 | # Note: This option applies only to the class list, not to the | ||
| 360 | # alphabetical list. | ||
| 361 | |||
| 362 | SORT_BY_SCOPE_NAME = NO | ||
| 363 | |||
| 364 | # The GENERATE_TODOLIST tag can be used to enable (YES) or | ||
| 365 | # disable (NO) the todo list. This list is created by putting \todo | ||
| 366 | # commands in the documentation. | ||
| 367 | |||
| 368 | GENERATE_TODOLIST = YES | ||
| 369 | |||
| 370 | # The GENERATE_TESTLIST tag can be used to enable (YES) or | ||
| 371 | # disable (NO) the test list. This list is created by putting \test | ||
| 372 | # commands in the documentation. | ||
| 373 | |||
| 374 | GENERATE_TESTLIST = YES | ||
| 375 | |||
| 376 | # The GENERATE_BUGLIST tag can be used to enable (YES) or | ||
| 377 | # disable (NO) the bug list. This list is created by putting \bug | ||
| 378 | # commands in the documentation. | ||
| 379 | |||
| 380 | GENERATE_BUGLIST = YES | ||
| 381 | |||
| 382 | # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or | ||
| 383 | # disable (NO) the deprecated list. This list is created by putting | ||
| 384 | # \deprecated commands in the documentation. | ||
| 385 | |||
| 386 | GENERATE_DEPRECATEDLIST= YES | ||
| 387 | |||
| 388 | # The ENABLED_SECTIONS tag can be used to enable conditional | ||
| 389 | # documentation sections, marked by \if sectionname ... \endif. | ||
| 390 | |||
| 391 | ENABLED_SECTIONS = | ||
| 392 | |||
| 393 | # The MAX_INITIALIZER_LINES tag determines the maximum number of lines | ||
| 394 | # the initial value of a variable or define consists of for it to appear in | ||
| 395 | # the documentation. If the initializer consists of more lines than specified | ||
| 396 | # here it will be hidden. Use a value of 0 to hide initializers completely. | ||
| 397 | # The appearance of the initializer of individual variables and defines in the | ||
| 398 | # documentation can be controlled using \showinitializer or \hideinitializer | ||
| 399 | # command in the documentation regardless of this setting. | ||
| 400 | |||
| 401 | MAX_INITIALIZER_LINES = 30 | ||
| 402 | |||
| 403 | # Set the SHOW_USED_FILES tag to NO to disable the list of files generated | ||
| 404 | # at the bottom of the documentation of classes and structs. If set to YES the | ||
| 405 | # list will mention the files that were used to generate the documentation. | ||
| 406 | |||
| 407 | SHOW_USED_FILES = YES | ||
| 408 | |||
| 409 | # If the sources in your project are distributed over multiple directories | ||
| 410 | # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy | ||
| 411 | # in the documentation. The default is NO. | ||
| 412 | |||
| 413 | SHOW_DIRECTORIES = NO | ||
| 414 | |||
| 415 | # The FILE_VERSION_FILTER tag can be used to specify a program or script that | ||
| 416 | # doxygen should invoke to get the current version for each file (typically from the | ||
| 417 | # version control system). Doxygen will invoke the program by executing (via | ||
| 418 | # popen()) the command <command> <input-file>, where <command> is the value of | ||
| 419 | # the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file | ||
| 420 | # provided by doxygen. Whatever the program writes to standard output | ||
| 421 | # is used as the file version. See the manual for examples. | ||
| 422 | |||
| 423 | FILE_VERSION_FILTER = | ||
| 424 | |||
| 425 | #--------------------------------------------------------------------------- | ||
| 426 | # configuration options related to warning and progress messages | ||
| 427 | #--------------------------------------------------------------------------- | ||
| 428 | |||
| 429 | # The QUIET tag can be used to turn on/off the messages that are generated | ||
| 430 | # by doxygen. Possible values are YES and NO. If left blank NO is used. | ||
| 431 | |||
| 432 | QUIET = NO | ||
| 433 | |||
| 434 | # The WARNINGS tag can be used to turn on/off the warning messages that are | ||
| 435 | # generated by doxygen. Possible values are YES and NO. If left blank | ||
| 436 | # NO is used. | ||
| 437 | |||
| 438 | WARNINGS = YES | ||
| 439 | |||
| 440 | # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings | ||
| 441 | # for undocumented members. If EXTRACT_ALL is set to YES then this flag will | ||
| 442 | # automatically be disabled. | ||
| 443 | |||
| 444 | WARN_IF_UNDOCUMENTED = YES | ||
| 445 | |||
| 446 | # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for | ||
| 447 | # potential errors in the documentation, such as not documenting some | ||
| 448 | # parameters in a documented function, or documenting parameters that | ||
| 449 | # don't exist or using markup commands wrongly. | ||
| 450 | |||
| 451 | WARN_IF_DOC_ERROR = YES | ||
| 452 | |||
| 453 | # This WARN_NO_PARAMDOC option can be abled to get warnings for | ||
| 454 | # functions that are documented, but have no documentation for their parameters | ||
| 455 | # or return value. If set to NO (the default) doxygen will only warn about | ||
| 456 | # wrong or incomplete parameter documentation, but not about the absence of | ||
| 457 | # documentation. | ||
| 458 | |||
| 459 | WARN_NO_PARAMDOC = NO | ||
| 460 | |||
| 461 | # The WARN_FORMAT tag determines the format of the warning messages that | ||
| 462 | # doxygen can produce. The string should contain the $file, $line, and $text | ||
| 463 | # tags, which will be replaced by the file and line number from which the | ||
| 464 | # warning originated and the warning text. Optionally the format may contain | ||
| 465 | # $version, which will be replaced by the version of the file (if it could | ||
| 466 | # be obtained via FILE_VERSION_FILTER) | ||
| 467 | |||
| 468 | WARN_FORMAT = "$file:$line: $text" | ||
| 469 | |||
| 470 | # The WARN_LOGFILE tag can be used to specify a file to which warning | ||
| 471 | # and error messages should be written. If left blank the output is written | ||
| 472 | # to stderr. | ||
| 473 | |||
| 474 | WARN_LOGFILE = | ||
| 475 | |||
| 476 | #--------------------------------------------------------------------------- | ||
| 477 | # configuration options related to the input files | ||
| 478 | #--------------------------------------------------------------------------- | ||
| 479 | |||
| 480 | # The INPUT tag can be used to specify the files and/or directories that contain | ||
| 481 | # documented source files. You may enter file names like "myfile.cpp" or | ||
| 482 | # directories like "/usr/src/myproject". Separate the files or directories | ||
| 483 | # with spaces. | ||
| 484 | |||
| 485 | INPUT = mycpu | ||
| 486 | |||
| 487 | # This tag can be used to specify the character encoding of the source files that | ||
| 488 | # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default | ||
| 489 | # input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. | ||
| 490 | # See http://www.gnu.org/software/libiconv for the list of possible encodings. | ||
| 491 | |||
| 492 | INPUT_ENCODING = UTF-8 | ||
| 493 | |||
| 494 | # If the value of the INPUT tag contains directories, you can use the | ||
| 495 | # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp | ||
| 496 | # and *.h) to filter out the source-files in the directories. If left | ||
| 497 | # blank the following patterns are tested: | ||
| 498 | # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx | ||
| 499 | # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py | ||
| 500 | |||
| 501 | FILE_PATTERNS = | ||
| 502 | |||
| 503 | # The RECURSIVE tag can be used to turn specify whether or not subdirectories | ||
| 504 | # should be searched for input files as well. Possible values are YES and NO. | ||
| 505 | # If left blank NO is used. | ||
| 506 | |||
| 507 | RECURSIVE = NO | ||
| 508 | |||
| 509 | # The EXCLUDE tag can be used to specify files and/or directories that should | ||
| 510 | # excluded from the INPUT source files. This way you can easily exclude a | ||
| 511 | # subdirectory from a directory tree whose root is specified with the INPUT tag. | ||
| 512 | |||
| 513 | EXCLUDE = | ||
| 514 | |||
| 515 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or | ||
| 516 | # directories that are symbolic links (a Unix filesystem feature) are excluded | ||
| 517 | # from the input. | ||
| 518 | |||
| 519 | EXCLUDE_SYMLINKS = NO | ||
| 520 | |||
| 521 | # If the value of the INPUT tag contains directories, you can use the | ||
| 522 | # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude | ||
| 523 | # certain files from those directories. Note that the wildcards are matched | ||
| 524 | # against the file with absolute path, so to exclude all test directories | ||
| 525 | # for example use the pattern */test/* | ||
| 526 | |||
| 527 | EXCLUDE_PATTERNS = | ||
| 528 | |||
| 529 | # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names | ||
| 530 | # (namespaces, classes, functions, etc.) that should be excluded from the output. | ||
| 531 | # The symbol name can be a fully qualified name, a word, or if the wildcard * is used, | ||
| 532 | # a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test | ||
| 533 | |||
| 534 | EXCLUDE_SYMBOLS = | ||
| 535 | |||
| 536 | # The EXAMPLE_PATH tag can be used to specify one or more files or | ||
| 537 | # directories that contain example code fragments that are included (see | ||
| 538 | # the \include command). | ||
| 539 | |||
| 540 | EXAMPLE_PATH = | ||
| 541 | |||
| 542 | # If the value of the EXAMPLE_PATH tag contains directories, you can use the | ||
| 543 | # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp | ||
| 544 | # and *.h) to filter out the source-files in the directories. If left | ||
| 545 | # blank all files are included. | ||
| 546 | |||
| 547 | EXAMPLE_PATTERNS = | ||
| 548 | |||
| 549 | # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be | ||
| 550 | # searched for input files to be used with the \include or \dontinclude | ||
| 551 | # commands irrespective of the value of the RECURSIVE tag. | ||
| 552 | # Possible values are YES and NO. If left blank NO is used. | ||
| 553 | |||
| 554 | EXAMPLE_RECURSIVE = NO | ||
| 555 | |||
| 556 | # The IMAGE_PATH tag can be used to specify one or more files or | ||
| 557 | # directories that contain image that are included in the documentation (see | ||
| 558 | # the \image command). | ||
| 559 | |||
| 560 | IMAGE_PATH = | ||
| 561 | |||
| 562 | # The INPUT_FILTER tag can be used to specify a program that doxygen should | ||
| 563 | # invoke to filter for each input file. Doxygen will invoke the filter program | ||
| 564 | # by executing (via popen()) the command <filter> <input-file>, where <filter> | ||
| 565 | # is the value of the INPUT_FILTER tag, and <input-file> is the name of an | ||
| 566 | # input file. Doxygen will then use the output that the filter program writes | ||
| 567 | # to standard output. If FILTER_PATTERNS is specified, this tag will be | ||
| 568 | # ignored. | ||
| 569 | |||
| 570 | INPUT_FILTER = | ||
| 571 | |||
| 572 | # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern | ||
| 573 | # basis. Doxygen will compare the file name with each pattern and apply the | ||
| 574 | # filter if there is a match. The filters are a list of the form: | ||
| 575 | # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further | ||
| 576 | # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER | ||
| 577 | # is applied to all files. | ||
| 578 | |||
| 579 | FILTER_PATTERNS = | ||
| 580 | |||
| 581 | # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using | ||
| 582 | # INPUT_FILTER) will be used to filter the input files when producing source | ||
| 583 | # files to browse (i.e. when SOURCE_BROWSER is set to YES). | ||
| 584 | |||
| 585 | FILTER_SOURCE_FILES = NO | ||
| 586 | |||
| 587 | #--------------------------------------------------------------------------- | ||
| 588 | # configuration options related to source browsing | ||
| 589 | #--------------------------------------------------------------------------- | ||
| 590 | |||
| 591 | # If the SOURCE_BROWSER tag is set to YES then a list of source files will | ||
| 592 | # be generated. Documented entities will be cross-referenced with these sources. | ||
| 593 | # Note: To get rid of all source code in the generated output, make sure also | ||
| 594 | # VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH | ||
| 595 | # then you must also enable this option. If you don't then doxygen will produce | ||
| 596 | # a warning and turn it on anyway | ||
| 597 | |||
| 598 | SOURCE_BROWSER = NO | ||
| 599 | |||
| 600 | # Setting the INLINE_SOURCES tag to YES will include the body | ||
| 601 | # of functions and classes directly in the documentation. | ||
| 602 | |||
| 603 | INLINE_SOURCES = NO | ||
| 604 | |||
| 605 | # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct | ||
| 606 | # doxygen to hide any special comment blocks from generated source code | ||
| 607 | # fragments. Normal C and C++ comments will always remain visible. | ||
| 608 | |||
| 609 | STRIP_CODE_COMMENTS = YES | ||
| 610 | |||
| 611 | # If the REFERENCED_BY_RELATION tag is set to YES (the default) | ||
| 612 | # then for each documented function all documented | ||
| 613 | # functions referencing it will be listed. | ||
| 614 | |||
| 615 | REFERENCED_BY_RELATION = YES | ||
| 616 | |||
| 617 | # If the REFERENCES_RELATION tag is set to YES (the default) | ||
| 618 | # then for each documented function all documented entities | ||
| 619 | # called/used by that function will be listed. | ||
| 620 | |||
| 621 | REFERENCES_RELATION = YES | ||
| 622 | |||
| 623 | # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) | ||
| 624 | # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from | ||
| 625 | # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will | ||
| 626 | # link to the source code. Otherwise they will link to the documentstion. | ||
| 627 | |||
| 628 | REFERENCES_LINK_SOURCE = YES | ||
| 629 | |||
| 630 | # If the USE_HTAGS tag is set to YES then the references to source code | ||
| 631 | # will point to the HTML generated by the htags(1) tool instead of doxygen | ||
| 632 | # built-in source browser. The htags tool is part of GNU's global source | ||
| 633 | # tagging system (see http://www.gnu.org/software/global/global.html). You | ||
| 634 | # will need version 4.8.6 or higher. | ||
| 635 | |||
| 636 | USE_HTAGS = NO | ||
| 637 | |||
| 638 | # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen | ||
| 639 | # will generate a verbatim copy of the header file for each class for | ||
| 640 | # which an include is specified. Set to NO to disable this. | ||
| 641 | |||
| 642 | VERBATIM_HEADERS = YES | ||
| 643 | |||
| 644 | #--------------------------------------------------------------------------- | ||
| 645 | # configuration options related to the alphabetical class index | ||
| 646 | #--------------------------------------------------------------------------- | ||
| 647 | |||
| 648 | # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index | ||
| 649 | # of all compounds will be generated. Enable this if the project | ||
| 650 | # contains a lot of classes, structs, unions or interfaces. | ||
| 651 | |||
| 652 | ALPHABETICAL_INDEX = NO | ||
| 653 | |||
| 654 | # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then | ||
| 655 | # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns | ||
| 656 | # in which this list will be split (can be a number in the range [1..20]) | ||
| 657 | |||
| 658 | COLS_IN_ALPHA_INDEX = 5 | ||
| 659 | |||
| 660 | # In case all classes in a project start with a common prefix, all | ||
| 661 | # classes will be put under the same header in the alphabetical index. | ||
| 662 | # The IGNORE_PREFIX tag can be used to specify one or more prefixes that | ||
| 663 | # should be ignored while generating the index headers. | ||
| 664 | |||
| 665 | IGNORE_PREFIX = | ||
| 666 | |||
| 667 | #--------------------------------------------------------------------------- | ||
| 668 | # configuration options related to the HTML output | ||
| 669 | #--------------------------------------------------------------------------- | ||
| 670 | |||
| 671 | # If the GENERATE_HTML tag is set to YES (the default) Doxygen will | ||
| 672 | # generate HTML output. | ||
| 673 | |||
| 674 | GENERATE_HTML = YES | ||
| 675 | |||
| 676 | # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. | ||
| 677 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be | ||
| 678 | # put in front of it. If left blank `html' will be used as the default path. | ||
| 679 | |||
| 680 | HTML_OUTPUT = . | ||
| 681 | |||
| 682 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for | ||
| 683 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank | ||
| 684 | # doxygen will generate files with .html extension. | ||
| 685 | |||
| 686 | HTML_FILE_EXTENSION = .html | ||
| 687 | |||
| 688 | # The HTML_HEADER tag can be used to specify a personal HTML header for | ||
| 689 | # each generated HTML page. If it is left blank doxygen will generate a | ||
| 690 | # standard header. | ||
| 691 | |||
| 692 | HTML_HEADER = | ||
| 693 | |||
| 694 | # The HTML_FOOTER tag can be used to specify a personal HTML footer for | ||
| 695 | # each generated HTML page. If it is left blank doxygen will generate a | ||
| 696 | # standard footer. | ||
| 697 | |||
| 698 | HTML_FOOTER = | ||
| 699 | |||
| 700 | # The HTML_STYLESHEET tag can be used to specify a user-defined cascading | ||
| 701 | # style sheet that is used by each HTML page. It can be used to | ||
| 702 | # fine-tune the look of the HTML output. If the tag is left blank doxygen | ||
| 703 | # will generate a default style sheet. Note that doxygen will try to copy | ||
| 704 | # the style sheet file to the HTML output directory, so don't put your own | ||
| 705 | # stylesheet in the HTML output directory as well, or it will be erased! | ||
| 706 | |||
| 707 | HTML_STYLESHEET = | ||
| 708 | |||
| 709 | # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, | ||
| 710 | # files or namespaces will be aligned in HTML using tables. If set to | ||
| 711 | # NO a bullet list will be used. | ||
| 712 | |||
| 713 | HTML_ALIGN_MEMBERS = YES | ||
| 714 | |||
| 715 | # If the GENERATE_HTMLHELP tag is set to YES, additional index files | ||
| 716 | # will be generated that can be used as input for tools like the | ||
| 717 | # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) | ||
| 718 | # of the generated HTML documentation. | ||
| 719 | |||
| 720 | GENERATE_HTMLHELP = NO | ||
| 721 | |||
| 722 | # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML | ||
| 723 | # documentation will contain sections that can be hidden and shown after the | ||
| 724 | # page has loaded. For this to work a browser that supports | ||
| 725 | # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox | ||
| 726 | # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). | ||
| 727 | |||
| 728 | HTML_DYNAMIC_SECTIONS = NO | ||
| 729 | |||
| 730 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can | ||
| 731 | # be used to specify the file name of the resulting .chm file. You | ||
| 732 | # can add a path in front of the file if the result should not be | ||
| 733 | # written to the html output directory. | ||
| 734 | |||
| 735 | CHM_FILE = | ||
| 736 | |||
| 737 | # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can | ||
| 738 | # be used to specify the location (absolute path including file name) of | ||
| 739 | # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run | ||
| 740 | # the HTML help compiler on the generated index.hhp. | ||
| 741 | |||
| 742 | HHC_LOCATION = | ||
| 743 | |||
| 744 | # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag | ||
| 745 | # controls if a separate .chi index file is generated (YES) or that | ||
| 746 | # it should be included in the master .chm file (NO). | ||
| 747 | |||
| 748 | GENERATE_CHI = NO | ||
| 749 | |||
| 750 | # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag | ||
| 751 | # controls whether a binary table of contents is generated (YES) or a | ||
| 752 | # normal table of contents (NO) in the .chm file. | ||
| 753 | |||
| 754 | BINARY_TOC = NO | ||
| 755 | |||
| 756 | # The TOC_EXPAND flag can be set to YES to add extra items for group members | ||
| 757 | # to the contents of the HTML help documentation and to the tree view. | ||
| 758 | |||
| 759 | TOC_EXPAND = NO | ||
| 760 | |||
| 761 | # The DISABLE_INDEX tag can be used to turn on/off the condensed index at | ||
| 762 | # top of each HTML page. The value NO (the default) enables the index and | ||
| 763 | # the value YES disables it. | ||
| 764 | |||
| 765 | DISABLE_INDEX = NO | ||
| 766 | |||
| 767 | # This tag can be used to set the number of enum values (range [1..20]) | ||
| 768 | # that doxygen will group on one line in the generated HTML documentation. | ||
| 769 | |||
| 770 | ENUM_VALUES_PER_LINE = 4 | ||
| 771 | |||
| 772 | # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be | ||
| 773 | # generated containing a tree-like index structure (just like the one that | ||
| 774 | # is generated for HTML Help). For this to work a browser that supports | ||
| 775 | # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, | ||
| 776 | # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are | ||
| 777 | # probably better off using the HTML help feature. | ||
| 778 | |||
| 779 | GENERATE_TREEVIEW = NO | ||
| 780 | |||
| 781 | # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be | ||
| 782 | # used to set the initial width (in pixels) of the frame in which the tree | ||
| 783 | # is shown. | ||
| 784 | |||
| 785 | TREEVIEW_WIDTH = 250 | ||
| 786 | |||
| 787 | #--------------------------------------------------------------------------- | ||
| 788 | # configuration options related to the LaTeX output | ||
| 789 | #--------------------------------------------------------------------------- | ||
| 790 | |||
| 791 | # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will | ||
| 792 | # generate Latex output. | ||
| 793 | |||
| 794 | GENERATE_LATEX = NO | ||
| 795 | |||
| 796 | # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. | ||
| 797 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be | ||
| 798 | # put in front of it. If left blank `latex' will be used as the default path. | ||
| 799 | |||
| 800 | LATEX_OUTPUT = latex | ||
| 801 | |||
| 802 | # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be | ||
| 803 | # invoked. If left blank `latex' will be used as the default command name. | ||
| 804 | |||
| 805 | LATEX_CMD_NAME = latex | ||
| 806 | |||
| 807 | # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to | ||
| 808 | # generate index for LaTeX. If left blank `makeindex' will be used as the | ||
| 809 | # default command name. | ||
| 810 | |||
| 811 | MAKEINDEX_CMD_NAME = makeindex | ||
| 812 | |||
| 813 | # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact | ||
| 814 | # LaTeX documents. This may be useful for small projects and may help to | ||
| 815 | # save some trees in general. | ||
| 816 | |||
| 817 | COMPACT_LATEX = NO | ||
| 818 | |||
| 819 | # The PAPER_TYPE tag can be used to set the paper type that is used | ||
| 820 | # by the printer. Possible values are: a4, a4wide, letter, legal and | ||
| 821 | # executive. If left blank a4wide will be used. | ||
| 822 | |||
| 823 | PAPER_TYPE = a4wide | ||
| 824 | |||
| 825 | # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX | ||
| 826 | # packages that should be included in the LaTeX output. | ||
| 827 | |||
| 828 | EXTRA_PACKAGES = | ||
| 829 | |||
| 830 | # The LATEX_HEADER tag can be used to specify a personal LaTeX header for | ||
| 831 | # the generated latex document. The header should contain everything until | ||
| 832 | # the first chapter. If it is left blank doxygen will generate a | ||
| 833 | # standard header. Notice: only use this tag if you know what you are doing! | ||
| 834 | |||
| 835 | LATEX_HEADER = | ||
| 836 | |||
| 837 | # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated | ||
| 838 | # is prepared for conversion to pdf (using ps2pdf). The pdf file will | ||
| 839 | # contain links (just like the HTML output) instead of page references | ||
| 840 | # This makes the output suitable for online browsing using a pdf viewer. | ||
| 841 | |||
| 842 | PDF_HYPERLINKS = NO | ||
| 843 | |||
| 844 | # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of | ||
| 845 | # plain latex in the generated Makefile. Set this option to YES to get a | ||
| 846 | # higher quality PDF documentation. | ||
| 847 | |||
| 848 | USE_PDFLATEX = NO | ||
| 849 | |||
| 850 | # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. | ||
| 851 | # command to the generated LaTeX files. This will instruct LaTeX to keep | ||
| 852 | # running if errors occur, instead of asking the user for help. | ||
| 853 | # This option is also used when generating formulas in HTML. | ||
| 854 | |||
| 855 | LATEX_BATCHMODE = NO | ||
| 856 | |||
| 857 | # If LATEX_HIDE_INDICES is set to YES then doxygen will not | ||
| 858 | # include the index chapters (such as File Index, Compound Index, etc.) | ||
| 859 | # in the output. | ||
| 860 | |||
| 861 | LATEX_HIDE_INDICES = NO | ||
| 862 | |||
| 863 | #--------------------------------------------------------------------------- | ||
| 864 | # configuration options related to the RTF output | ||
| 865 | #--------------------------------------------------------------------------- | ||
| 866 | |||
| 867 | # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output | ||
| 868 | # The RTF output is optimized for Word 97 and may not look very pretty with | ||
| 869 | # other RTF readers or editors. | ||
| 870 | |||
| 871 | GENERATE_RTF = NO | ||
| 872 | |||
| 873 | # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. | ||
| 874 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be | ||
| 875 | # put in front of it. If left blank `rtf' will be used as the default path. | ||
| 876 | |||
| 877 | RTF_OUTPUT = rtf | ||
| 878 | |||
| 879 | # If the COMPACT_RTF tag is set to YES Doxygen generates more compact | ||
| 880 | # RTF documents. This may be useful for small projects and may help to | ||
| 881 | # save some trees in general. | ||
| 882 | |||
| 883 | COMPACT_RTF = NO | ||
| 884 | |||
| 885 | # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated | ||
| 886 | # will contain hyperlink fields. The RTF file will | ||
| 887 | # contain links (just like the HTML output) instead of page references. | ||
| 888 | # This makes the output suitable for online browsing using WORD or other | ||
| 889 | # programs which support those fields. | ||
| 890 | # Note: wordpad (write) and others do not support links. | ||
| 891 | |||
| 892 | RTF_HYPERLINKS = NO | ||
| 893 | |||
| 894 | # Load stylesheet definitions from file. Syntax is similar to doxygen's | ||
| 895 | # config file, i.e. a series of assignments. You only have to provide | ||
| 896 | # replacements, missing definitions are set to their default value. | ||
| 897 | |||
| 898 | RTF_STYLESHEET_FILE = | ||
| 899 | |||
| 900 | # Set optional variables used in the generation of an rtf document. | ||
| 901 | # Syntax is similar to doxygen's config file. | ||
| 902 | |||
| 903 | RTF_EXTENSIONS_FILE = | ||
| 904 | |||
| 905 | #--------------------------------------------------------------------------- | ||
| 906 | # configuration options related to the man page output | ||
| 907 | #--------------------------------------------------------------------------- | ||
| 908 | |||
| 909 | # If the GENERATE_MAN tag is set to YES (the default) Doxygen will | ||
| 910 | # generate man pages | ||
| 911 | |||
| 912 | GENERATE_MAN = NO | ||
| 913 | |||
| 914 | # The MAN_OUTPUT tag is used to specify where the man pages will be put. | ||
| 915 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be | ||
| 916 | # put in front of it. If left blank `man' will be used as the default path. | ||
| 917 | |||
| 918 | MAN_OUTPUT = man | ||
| 919 | |||
| 920 | # The MAN_EXTENSION tag determines the extension that is added to | ||
| 921 | # the generated man pages (default is the subroutine's section .3) | ||
| 922 | |||
| 923 | MAN_EXTENSION = .3 | ||
| 924 | |||
| 925 | # If the MAN_LINKS tag is set to YES and Doxygen generates man output, | ||
| 926 | # then it will generate one additional man file for each entity | ||
| 927 | # documented in the real man page(s). These additional files | ||
| 928 | # only source the real man page, but without them the man command | ||
| 929 | # would be unable to find the correct page. The default is NO. | ||
| 930 | |||
| 931 | MAN_LINKS = NO | ||
| 932 | |||
| 933 | #--------------------------------------------------------------------------- | ||
| 934 | # configuration options related to the XML output | ||
| 935 | #--------------------------------------------------------------------------- | ||
| 936 | |||
| 937 | # If the GENERATE_XML tag is set to YES Doxygen will | ||
| 938 | # generate an XML file that captures the structure of | ||
| 939 | # the code including all documentation. | ||
| 940 | |||
| 941 | GENERATE_XML = NO | ||
| 942 | |||
| 943 | # The XML_OUTPUT tag is used to specify where the XML pages will be put. | ||
| 944 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be | ||
| 945 | # put in front of it. If left blank `xml' will be used as the default path. | ||
| 946 | |||
| 947 | XML_OUTPUT = xml | ||
| 948 | |||
| 949 | # The XML_SCHEMA tag can be used to specify an XML schema, | ||
| 950 | # which can be used by a validating XML parser to check the | ||
| 951 | # syntax of the XML files. | ||
| 952 | |||
| 953 | XML_SCHEMA = | ||
| 954 | |||
| 955 | # The XML_DTD tag can be used to specify an XML DTD, | ||
| 956 | # which can be used by a validating XML parser to check the | ||
| 957 | # syntax of the XML files. | ||
| 958 | |||
| 959 | XML_DTD = | ||
| 960 | |||
| 961 | # If the XML_PROGRAMLISTING tag is set to YES Doxygen will | ||
| 962 | # dump the program listings (including syntax highlighting | ||
| 963 | # and cross-referencing information) to the XML output. Note that | ||
| 964 | # enabling this will significantly increase the size of the XML output. | ||
| 965 | |||
| 966 | XML_PROGRAMLISTING = YES | ||
| 967 | |||
| 968 | #--------------------------------------------------------------------------- | ||
| 969 | # configuration options for the AutoGen Definitions output | ||
| 970 | #--------------------------------------------------------------------------- | ||
| 971 | |||
| 972 | # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will | ||
| 973 | # generate an AutoGen Definitions (see autogen.sf.net) file | ||
| 974 | # that captures the structure of the code including all | ||
| 975 | # documentation. Note that this feature is still experimental | ||
| 976 | # and incomplete at the moment. | ||
| 977 | |||
| 978 | GENERATE_AUTOGEN_DEF = NO | ||
| 979 | |||
| 980 | #--------------------------------------------------------------------------- | ||
| 981 | # configuration options related to the Perl module output | ||
| 982 | #--------------------------------------------------------------------------- | ||
| 983 | |||
| 984 | # If the GENERATE_PERLMOD tag is set to YES Doxygen will | ||
| 985 | # generate a Perl module file that captures the structure of | ||
| 986 | # the code including all documentation. Note that this | ||
| 987 | # feature is still experimental and incomplete at the | ||
| 988 | # moment. | ||
| 989 | |||
| 990 | GENERATE_PERLMOD = NO | ||
| 991 | |||
| 992 | # If the PERLMOD_LATEX tag is set to YES Doxygen will generate | ||
| 993 | # the necessary Makefile rules, Perl scripts and LaTeX code to be able | ||
| 994 | # to generate PDF and DVI output from the Perl module output. | ||
| 995 | |||
| 996 | PERLMOD_LATEX = NO | ||
| 997 | |||
| 998 | # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be | ||
| 999 | # nicely formatted so it can be parsed by a human reader. This is useful | ||
| 1000 | # if you want to understand what is going on. On the other hand, if this | ||
| 1001 | # tag is set to NO the size of the Perl module output will be much smaller | ||
| 1002 | # and Perl will parse it just the same. | ||
| 1003 | |||
| 1004 | PERLMOD_PRETTY = YES | ||
| 1005 | |||
| 1006 | # The names of the make variables in the generated doxyrules.make file | ||
| 1007 | # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. | ||
| 1008 | # This is useful so different doxyrules.make files included by the same | ||
| 1009 | # Makefile don't overwrite each other's variables. | ||
| 1010 | |||
| 1011 | PERLMOD_MAKEVAR_PREFIX = | ||
| 1012 | |||
| 1013 | #--------------------------------------------------------------------------- | ||
| 1014 | # Configuration options related to the preprocessor | ||
| 1015 | #--------------------------------------------------------------------------- | ||
| 1016 | |||
| 1017 | # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will | ||
| 1018 | # evaluate all C-preprocessor directives found in the sources and include | ||
| 1019 | # files. | ||
| 1020 | |||
| 1021 | ENABLE_PREPROCESSING = YES | ||
| 1022 | |||
| 1023 | # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro | ||
| 1024 | # names in the source code. If set to NO (the default) only conditional | ||
| 1025 | # compilation will be performed. Macro expansion can be done in a controlled | ||
| 1026 | # way by setting EXPAND_ONLY_PREDEF to YES. | ||
| 1027 | |||
| 1028 | MACRO_EXPANSION = NO | ||
| 1029 | |||
| 1030 | # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES | ||
| 1031 | # then the macro expansion is limited to the macros specified with the | ||
| 1032 | # PREDEFINED and EXPAND_AS_DEFINED tags. | ||
| 1033 | |||
| 1034 | EXPAND_ONLY_PREDEF = NO | ||
| 1035 | |||
| 1036 | # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files | ||
| 1037 | # in the INCLUDE_PATH (see below) will be search if a #include is found. | ||
| 1038 | |||
| 1039 | SEARCH_INCLUDES = YES | ||
| 1040 | |||
| 1041 | # The INCLUDE_PATH tag can be used to specify one or more directories that | ||
| 1042 | # contain include files that are not input files but should be processed by | ||
| 1043 | # the preprocessor. | ||
| 1044 | |||
| 1045 | INCLUDE_PATH = | ||
| 1046 | |||
| 1047 | # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard | ||
| 1048 | # patterns (like *.h and *.hpp) to filter out the header-files in the | ||
| 1049 | # directories. If left blank, the patterns specified with FILE_PATTERNS will | ||
| 1050 | # be used. | ||
| 1051 | |||
| 1052 | INCLUDE_FILE_PATTERNS = | ||
| 1053 | |||
| 1054 | # The PREDEFINED tag can be used to specify one or more macro names that | ||
| 1055 | # are defined before the preprocessor is started (similar to the -D option of | ||
| 1056 | # gcc). The argument of the tag is a list of macros of the form: name | ||
| 1057 | # or name=definition (no spaces). If the definition and the = are | ||
| 1058 | # omitted =1 is assumed. To prevent a macro definition from being | ||
| 1059 | # undefined via #undef or recursively expanded use the := operator | ||
| 1060 | # instead of the = operator. | ||
| 1061 | |||
| 1062 | PREDEFINED = | ||
| 1063 | |||
| 1064 | # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then | ||
| 1065 | # this tag can be used to specify a list of macro names that should be expanded. | ||
| 1066 | # The macro definition that is found in the sources will be used. | ||
| 1067 | # Use the PREDEFINED tag if you want to use a different macro definition. | ||
| 1068 | |||
| 1069 | EXPAND_AS_DEFINED = | ||
| 1070 | |||
| 1071 | # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then | ||
| 1072 | # doxygen's preprocessor will remove all function-like macros that are alone | ||
| 1073 | # on a line, have an all uppercase name, and do not end with a semicolon. Such | ||
| 1074 | # function macros are typically used for boiler-plate code, and will confuse | ||
| 1075 | # the parser if not removed. | ||
| 1076 | |||
| 1077 | SKIP_FUNCTION_MACROS = YES | ||
| 1078 | |||
| 1079 | #--------------------------------------------------------------------------- | ||
| 1080 | # Configuration::additions related to external references | ||
| 1081 | #--------------------------------------------------------------------------- | ||
| 1082 | |||
| 1083 | # The TAGFILES option can be used to specify one or more tagfiles. | ||
| 1084 | # Optionally an initial location of the external documentation | ||
| 1085 | # can be added for each tagfile. The format of a tag file without | ||
| 1086 | # this location is as follows: | ||
| 1087 | # TAGFILES = file1 file2 ... | ||
| 1088 | # Adding location for the tag files is done as follows: | ||
| 1089 | # TAGFILES = file1=loc1 "file2 = loc2" ... | ||
| 1090 | # where "loc1" and "loc2" can be relative or absolute paths or | ||
| 1091 | # URLs. If a location is present for each tag, the installdox tool | ||
| 1092 | # does not have to be run to correct the links. | ||
| 1093 | # Note that each tag file must have a unique name | ||
| 1094 | # (where the name does NOT include the path) | ||
| 1095 | # If a tag file is not located in the directory in which doxygen | ||
| 1096 | # is run, you must also specify the path to the tagfile here. | ||
| 1097 | |||
| 1098 | TAGFILES = | ||
| 1099 | |||
| 1100 | # When a file name is specified after GENERATE_TAGFILE, doxygen will create | ||
| 1101 | # a tag file that is based on the input files it reads. | ||
| 1102 | |||
| 1103 | GENERATE_TAGFILE = | ||
| 1104 | |||
| 1105 | # If the ALLEXTERNALS tag is set to YES all external classes will be listed | ||
| 1106 | # in the class index. If set to NO only the inherited external classes | ||
| 1107 | # will be listed. | ||
| 1108 | |||
| 1109 | ALLEXTERNALS = NO | ||
| 1110 | |||
| 1111 | # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed | ||
| 1112 | # in the modules index. If set to NO, only the current project's groups will | ||
| 1113 | # be listed. | ||
| 1114 | |||
| 1115 | EXTERNAL_GROUPS = YES | ||
| 1116 | |||
| 1117 | # The PERL_PATH should be the absolute path and name of the perl script | ||
| 1118 | # interpreter (i.e. the result of `which perl'). | ||
| 1119 | |||
| 1120 | PERL_PATH = /usr/bin/perl | ||
| 1121 | |||
| 1122 | #--------------------------------------------------------------------------- | ||
| 1123 | # Configuration options related to the dot tool | ||
| 1124 | #--------------------------------------------------------------------------- | ||
| 1125 | |||
| 1126 | # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will | ||
| 1127 | # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base | ||
| 1128 | # or super classes. Setting the tag to NO turns the diagrams off. Note that | ||
| 1129 | # this option is superseded by the HAVE_DOT option below. This is only a | ||
| 1130 | # fallback. It is recommended to install and use dot, since it yields more | ||
| 1131 | # powerful graphs. | ||
| 1132 | |||
| 1133 | CLASS_DIAGRAMS = YES | ||
| 1134 | |||
| 1135 | # You can define message sequence charts within doxygen comments using the \msc | ||
| 1136 | # command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to | ||
| 1137 | # produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to | ||
| 1138 | # specify the directory where the mscgen tool resides. If left empty the tool is assumed to | ||
| 1139 | # be found in the default search path. | ||
| 1140 | |||
| 1141 | MSCGEN_PATH = | ||
| 1142 | |||
| 1143 | # If set to YES, the inheritance and collaboration graphs will hide | ||
| 1144 | # inheritance and usage relations if the target is undocumented | ||
| 1145 | # or is not a class. | ||
| 1146 | |||
| 1147 | HIDE_UNDOC_RELATIONS = YES | ||
| 1148 | |||
| 1149 | # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is | ||
| 1150 | # available from the path. This tool is part of Graphviz, a graph visualization | ||
| 1151 | # toolkit from AT&T and Lucent Bell Labs. The other options in this section | ||
| 1152 | # have no effect if this option is set to NO (the default) | ||
| 1153 | |||
| 1154 | HAVE_DOT = NO | ||
| 1155 | |||
| 1156 | # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen | ||
| 1157 | # will generate a graph for each documented class showing the direct and | ||
| 1158 | # indirect inheritance relations. Setting this tag to YES will force the | ||
| 1159 | # the CLASS_DIAGRAMS tag to NO. | ||
| 1160 | |||
| 1161 | CLASS_GRAPH = YES | ||
| 1162 | |||
| 1163 | # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen | ||
| 1164 | # will generate a graph for each documented class showing the direct and | ||
| 1165 | # indirect implementation dependencies (inheritance, containment, and | ||
| 1166 | # class references variables) of the class with other documented classes. | ||
| 1167 | |||
| 1168 | COLLABORATION_GRAPH = YES | ||
| 1169 | |||
| 1170 | # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen | ||
| 1171 | # will generate a graph for groups, showing the direct groups dependencies | ||
| 1172 | |||
| 1173 | GROUP_GRAPHS = YES | ||
| 1174 | |||
| 1175 | # If the UML_LOOK tag is set to YES doxygen will generate inheritance and | ||
| 1176 | # collaboration diagrams in a style similar to the OMG's Unified Modeling | ||
| 1177 | # Language. | ||
| 1178 | |||
| 1179 | UML_LOOK = NO | ||
| 1180 | |||
| 1181 | # If set to YES, the inheritance and collaboration graphs will show the | ||
| 1182 | # relations between templates and their instances. | ||
| 1183 | |||
| 1184 | TEMPLATE_RELATIONS = NO | ||
| 1185 | |||
| 1186 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT | ||
| 1187 | # tags are set to YES then doxygen will generate a graph for each documented | ||
| 1188 | # file showing the direct and indirect include dependencies of the file with | ||
| 1189 | # other documented files. | ||
| 1190 | |||
| 1191 | INCLUDE_GRAPH = YES | ||
| 1192 | |||
| 1193 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and | ||
| 1194 | # HAVE_DOT tags are set to YES then doxygen will generate a graph for each | ||
| 1195 | # documented header file showing the documented files that directly or | ||
| 1196 | # indirectly include this file. | ||
| 1197 | |||
| 1198 | INCLUDED_BY_GRAPH = YES | ||
| 1199 | |||
| 1200 | # If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will | ||
| 1201 | # generate a call dependency graph for every global function or class method. | ||
| 1202 | # Note that enabling this option will significantly increase the time of a run. | ||
| 1203 | # So in most cases it will be better to enable call graphs for selected | ||
| 1204 | # functions only using the \callgraph command. | ||
| 1205 | |||
| 1206 | CALL_GRAPH = NO | ||
| 1207 | |||
| 1208 | # If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will | ||
| 1209 | # generate a caller dependency graph for every global function or class method. | ||
| 1210 | # Note that enabling this option will significantly increase the time of a run. | ||
| 1211 | # So in most cases it will be better to enable caller graphs for selected | ||
| 1212 | # functions only using the \callergraph command. | ||
| 1213 | |||
| 1214 | CALLER_GRAPH = NO | ||
| 1215 | |||
| 1216 | # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen | ||
| 1217 | # will graphical hierarchy of all classes instead of a textual one. | ||
| 1218 | |||
| 1219 | GRAPHICAL_HIERARCHY = YES | ||
| 1220 | |||
| 1221 | # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES | ||
| 1222 | # then doxygen will show the dependencies a directory has on other directories | ||
| 1223 | # in a graphical way. The dependency relations are determined by the #include | ||
| 1224 | # relations between the files in the directories. | ||
| 1225 | |||
| 1226 | DIRECTORY_GRAPH = YES | ||
| 1227 | |||
| 1228 | # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images | ||
| 1229 | # generated by dot. Possible values are png, jpg, or gif | ||
| 1230 | # If left blank png will be used. | ||
| 1231 | |||
| 1232 | DOT_IMAGE_FORMAT = png | ||
| 1233 | |||
| 1234 | # The tag DOT_PATH can be used to specify the path where the dot tool can be | ||
| 1235 | # found. If left blank, it is assumed the dot tool can be found in the path. | ||
| 1236 | |||
| 1237 | DOT_PATH = | ||
| 1238 | |||
| 1239 | # The DOTFILE_DIRS tag can be used to specify one or more directories that | ||
| 1240 | # contain dot files that are included in the documentation (see the | ||
| 1241 | # \dotfile command). | ||
| 1242 | |||
| 1243 | DOTFILE_DIRS = | ||
| 1244 | |||
| 1245 | # The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of | ||
| 1246 | # nodes that will be shown in the graph. If the number of nodes in a graph | ||
| 1247 | # becomes larger than this value, doxygen will truncate the graph, which is | ||
| 1248 | # visualized by representing a node as a red box. Note that doxygen if the number | ||
| 1249 | # of direct children of the root node in a graph is already larger than | ||
| 1250 | # MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note | ||
| 1251 | # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. | ||
| 1252 | |||
| 1253 | DOT_GRAPH_MAX_NODES = 50 | ||
| 1254 | |||
| 1255 | # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the | ||
| 1256 | # graphs generated by dot. A depth value of 3 means that only nodes reachable | ||
| 1257 | # from the root by following a path via at most 3 edges will be shown. Nodes | ||
| 1258 | # that lay further from the root node will be omitted. Note that setting this | ||
| 1259 | # option to 1 or 2 may greatly reduce the computation time needed for large | ||
| 1260 | # code bases. Also note that the size of a graph can be further restricted by | ||
| 1261 | # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. | ||
| 1262 | |||
| 1263 | MAX_DOT_GRAPH_DEPTH = 0 | ||
| 1264 | |||
| 1265 | # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent | ||
| 1266 | # background. This is disabled by default, which results in a white background. | ||
| 1267 | # Warning: Depending on the platform used, enabling this option may lead to | ||
| 1268 | # badly anti-aliased labels on the edges of a graph (i.e. they become hard to | ||
| 1269 | # read). | ||
| 1270 | |||
| 1271 | DOT_TRANSPARENT = NO | ||
| 1272 | |||
| 1273 | # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output | ||
| 1274 | # files in one run (i.e. multiple -o and -T options on the command line). This | ||
| 1275 | # makes dot run faster, but since only newer versions of dot (>1.8.10) | ||
| 1276 | # support this, this feature is disabled by default. | ||
| 1277 | |||
| 1278 | DOT_MULTI_TARGETS = NO | ||
| 1279 | |||
| 1280 | # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will | ||
| 1281 | # generate a legend page explaining the meaning of the various boxes and | ||
| 1282 | # arrows in the dot generated graphs. | ||
| 1283 | |||
| 1284 | GENERATE_LEGEND = YES | ||
| 1285 | |||
| 1286 | # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will | ||
| 1287 | # remove the intermediate dot files that are used to generate | ||
| 1288 | # the various graphs. | ||
| 1289 | |||
| 1290 | DOT_CLEANUP = YES | ||
| 1291 | |||
| 1292 | #--------------------------------------------------------------------------- | ||
| 1293 | # Configuration::additions related to the search engine | ||
| 1294 | #--------------------------------------------------------------------------- | ||
| 1295 | |||
| 1296 | # The SEARCHENGINE tag specifies whether or not a search engine should be | ||
| 1297 | # used. If set to NO the values of all tags below this one will be ignored. | ||
| 1298 | |||
| 1299 | SEARCHENGINE = NO | ||
diff --git a/ue4/mycpu/Makefile b/ue4/mycpu/Makefile new file mode 100644 index 0000000..0dbb51a --- /dev/null +++ b/ue4/mycpu/Makefile | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | # Makefile for mycpu | ||
| 2 | # Author: Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 3 | # Created: 26.05.2009 | ||
| 4 | |||
| 5 | CXX= g++ | ||
| 6 | LD= $(CXX) | ||
| 7 | DEBUGFLAGS= -DNDEBUG | ||
| 8 | INCLUDE_PATH= -I/usr/local/include | ||
| 9 | CXXFLAGS= -O -ansi -pedantic-errors -Wall -Wno-long-long $(INCLUDE_PATH) $(DEBUGFLAGS) | ||
| 10 | LDFLAGS= | ||
| 11 | LIBS= -L/usr/local/lib -lboost_program_options | ||
| 12 | |||
| 13 | BIN= mycpu | ||
| 14 | OBJS= cinstruction.o instructions.o cprogram.o ccpu.o mycpu.o | ||
| 15 | HEADERS= cdat.h cmem.h cinstruction.h instructions.h cprogram.h cdisplay.h displays.h ccpu.h | ||
| 16 | |||
| 17 | .SUFFIXES: .cpp .o | ||
| 18 | |||
| 19 | all: $(BIN) | ||
| 20 | |||
| 21 | .cpp.o: | ||
| 22 | $(CXX) $(CXXFLAGS) -c $< -o $@ | ||
| 23 | |||
| 24 | $(OBJS): $(HEADERS) | ||
| 25 | |||
| 26 | $(BIN): $(OBJS) | ||
| 27 | $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) | ||
| 28 | |||
| 29 | debug: | ||
| 30 | @$(MAKE) all "DEBUGFLAGS=-DDEBUG -g" | ||
| 31 | |||
| 32 | clean: | ||
| 33 | rm -f $(OBJS) $(BIN) | ||
| 34 | |||
| 35 | run test: all | ||
| 36 | @./test/test.sh | ||
| 37 | |||
| 38 | .PHONY: clean | ||
| 39 | |||
| 40 | # vim600: noet sw=8 ts=8 | ||
diff --git a/ue4/mycpu/ccpu.cpp b/ue4/mycpu/ccpu.cpp new file mode 100644 index 0000000..af86200 --- /dev/null +++ b/ue4/mycpu/ccpu.cpp | |||
| @@ -0,0 +1,89 @@ | |||
| 1 | /** | ||
| 2 | * @module ccpu | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief CPU implementation. Used as a container for memory and instructions. | ||
| 5 | * Implements an run method to execute the program (= the instructions). | ||
| 6 | * @date 10.05.2009 | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifdef DEBUG | ||
| 10 | # include <iostream> | ||
| 11 | # include <iomanip> | ||
| 12 | #endif | ||
| 13 | #include "ccpu.h" | ||
| 14 | #include "displays.h" | ||
| 15 | |||
| 16 | using namespace std; | ||
| 17 | |||
| 18 | CCPU::CCPU(const unsigned cnt) | ||
| 19 | : m_regcnt(cnt), m_memory(NULL), m_program(NULL), m_flagzero(false), m_flagsign(false) | ||
| 20 | { | ||
| 21 | /* create registers */ | ||
| 22 | m_registers = new CDat[cnt]; | ||
| 23 | for(unsigned i = 0; i < cnt; ++i) | ||
| 24 | m_registers[i] = 0; | ||
| 25 | |||
| 26 | /* create displays */ | ||
| 27 | m_displays.insert(new CDisplayWDEZ); | ||
| 28 | m_displays.insert(new CDisplayWHEX); | ||
| 29 | } | ||
| 30 | |||
| 31 | /*----------------------------------------------------------------------------*/ | ||
| 32 | |||
| 33 | CCPU::~CCPU() | ||
| 34 | { | ||
| 35 | /* delete registers */ | ||
| 36 | delete[] m_registers; | ||
| 37 | m_registers = NULL; | ||
| 38 | |||
| 39 | /* delete displays */ | ||
| 40 | std::set<CDisplay *>::iterator it; | ||
| 41 | for (it = m_displays.begin() ; it != m_displays.end(); ++it) | ||
| 42 | delete *it; | ||
| 43 | } | ||
| 44 | |||
| 45 | /*----------------------------------------------------------------------------*/ | ||
| 46 | |||
| 47 | void CCPU::run() | ||
| 48 | { | ||
| 49 | if (m_memory == NULL) | ||
| 50 | throw runtime_error("CPU has no memory"); | ||
| 51 | if (m_program == NULL) | ||
| 52 | throw runtime_error("CPU has no program to execute"); | ||
| 53 | if (m_regcnt == 0) | ||
| 54 | throw runtime_error("CPU has no registers"); | ||
| 55 | |||
| 56 | bool run = true; | ||
| 57 | while(run) | ||
| 58 | { | ||
| 59 | unsigned pc = static_cast<unsigned>(m_registers[0]); | ||
| 60 | |||
| 61 | /* end of the program reached */ | ||
| 62 | if (pc == m_program->size()) | ||
| 63 | break; | ||
| 64 | |||
| 65 | /* pc is out of bound */ | ||
| 66 | if (pc > m_program->size()) | ||
| 67 | throw runtime_error("Programcounter is out of bound"); | ||
| 68 | |||
| 69 | /* execute instruction */ | ||
| 70 | (*m_program->at(pc))(this); | ||
| 71 | ++m_registers[0]; | ||
| 72 | } | ||
| 73 | } | ||
| 74 | |||
| 75 | /*----------------------------------------------------------------------------*/ | ||
| 76 | |||
| 77 | #if DEBUG | ||
| 78 | void CCPU::dumpRegisters(std::ostream& out) | ||
| 79 | { | ||
| 80 | out << "[REGISTER DUMP]" << endl; | ||
| 81 | for(unsigned i = 0; i < getRegisterCount(); ++i) | ||
| 82 | { | ||
| 83 | out << "[" << std::setw(4) << std::setfill('0') << i << "] " | ||
| 84 | << m_registers[i] << endl; | ||
| 85 | } | ||
| 86 | } | ||
| 87 | #endif | ||
| 88 | |||
| 89 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/ccpu.h b/ue4/mycpu/ccpu.h new file mode 100644 index 0000000..6849623 --- /dev/null +++ b/ue4/mycpu/ccpu.h | |||
| @@ -0,0 +1,241 @@ | |||
| 1 | /** | ||
| 2 | * @module ccpu | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief CPU implementation. Used as a container for memory and instructions. | ||
| 5 | * Implements a run method to execute the program (= the instructions). | ||
| 6 | * @date 10.05.2009 | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef CCPU_H | ||
| 10 | #define CCPU_H 1 | ||
| 11 | |||
| 12 | #include <iostream> | ||
| 13 | #include <set> | ||
| 14 | #include "cdat.h" | ||
| 15 | #include "cmem.h" | ||
| 16 | #include "cprogram.h" | ||
| 17 | #include "cdisplay.h" | ||
| 18 | |||
| 19 | /** | ||
| 20 | * @class CCPU | ||
| 21 | * | ||
| 22 | * CPU implementation. Used as a container for memory and instructions. | ||
| 23 | * Implements a run method to execute the program (= the instructions). | ||
| 24 | */ | ||
| 25 | class CCPU | ||
| 26 | { | ||
| 27 | public: | ||
| 28 | /** | ||
| 29 | * @method CCPU | ||
| 30 | * @brief Default ctor | ||
| 31 | * @param cnt number of registers to allocate for this cpu | ||
| 32 | * @return - | ||
| 33 | * @globalvars none | ||
| 34 | * @exception none | ||
| 35 | * @conditions none | ||
| 36 | */ | ||
| 37 | CCPU(const unsigned cnt); | ||
| 38 | |||
| 39 | /** | ||
| 40 | * @method ~CCPU | ||
| 41 | * @brief Default dtor | ||
| 42 | * @param - | ||
| 43 | * @return - | ||
| 44 | * @globalvars none | ||
| 45 | * @exception none | ||
| 46 | * @conditions none | ||
| 47 | */ | ||
| 48 | ~CCPU(); | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @method getRegisterCount | ||
| 52 | * @brief get number of registers | ||
| 53 | * @param - | ||
| 54 | * @return number of registers | ||
| 55 | * @globalvars none | ||
| 56 | * @exception none | ||
| 57 | * @conditions none | ||
| 58 | */ | ||
| 59 | const unsigned getRegisterCount() const | ||
| 60 | { | ||
| 61 | return m_regcnt; | ||
| 62 | } | ||
| 63 | |||
| 64 | /** | ||
| 65 | * @method getRegisters | ||
| 66 | * @brief get pointer to registers array | ||
| 67 | * @param - | ||
| 68 | * @return pointer to registers array | ||
| 69 | * @globalvars none | ||
| 70 | * @exception none | ||
| 71 | * @conditions none | ||
| 72 | */ | ||
| 73 | CDat *getRegisters() const | ||
| 74 | { | ||
| 75 | return m_registers; | ||
| 76 | } | ||
| 77 | |||
| 78 | /** | ||
| 79 | * @method setMemory | ||
| 80 | * @brief set memory of cpu | ||
| 81 | * @param memory pointer to memory | ||
| 82 | * @return - | ||
| 83 | * @globalvars none | ||
| 84 | * @exception none | ||
| 85 | * @conditions none | ||
| 86 | */ | ||
| 87 | void setMemory(CMem *memory) | ||
| 88 | { | ||
| 89 | m_memory = memory; | ||
| 90 | } | ||
| 91 | |||
| 92 | /** | ||
| 93 | * @method getMemory | ||
| 94 | * @brief get pointer to memory | ||
| 95 | * @param - | ||
| 96 | * @return pointer to memory | ||
| 97 | * @globalvars none | ||
| 98 | * @exception none | ||
| 99 | * @conditions none | ||
| 100 | */ | ||
| 101 | CMem *getMemory() const | ||
| 102 | { | ||
| 103 | return m_memory; | ||
| 104 | } | ||
| 105 | |||
| 106 | /** | ||
| 107 | * @method setProgram | ||
| 108 | * @brief set program to execute | ||
| 109 | * @param program pointer to program | ||
| 110 | * @return - | ||
| 111 | * @globalvars none | ||
| 112 | * @exception none | ||
| 113 | * @conditions none | ||
| 114 | */ | ||
| 115 | void setProgram(const CProgram *program) | ||
| 116 | { | ||
| 117 | m_program = program; | ||
| 118 | } | ||
| 119 | |||
| 120 | /** | ||
| 121 | * @method getProgram | ||
| 122 | * @brief get pointer to program | ||
| 123 | * @param - | ||
| 124 | * @return pointer to program | ||
| 125 | * @globalvars none | ||
| 126 | * @exception none | ||
| 127 | * @conditions none | ||
| 128 | */ | ||
| 129 | const CProgram *getProgram() | ||
| 130 | { | ||
| 131 | return m_program; | ||
| 132 | } | ||
| 133 | |||
| 134 | /** | ||
| 135 | * @method getDisplays | ||
| 136 | * @brief get set of pointers to displays | ||
| 137 | * @param - | ||
| 138 | * @return reference to set of pointers to displays | ||
| 139 | * @globalvars none | ||
| 140 | * @exception none | ||
| 141 | * @conditions none | ||
| 142 | */ | ||
| 143 | const std::set<CDisplay *>& getDisplays() | ||
| 144 | { | ||
| 145 | return m_displays; | ||
| 146 | } | ||
| 147 | |||
| 148 | /** | ||
| 149 | * @method setFlagZero | ||
| 150 | * @brief set zero flag | ||
| 151 | * @param value new value of zero flag | ||
| 152 | * @return - | ||
| 153 | * @globalvars none | ||
| 154 | * @exception none | ||
| 155 | * @conditions none | ||
| 156 | */ | ||
| 157 | void setFlagZero(const bool value) | ||
| 158 | { | ||
| 159 | m_flagzero = value; | ||
| 160 | } | ||
| 161 | |||
| 162 | /** | ||
| 163 | * @method getFlagZero | ||
| 164 | * @brief get value of zero flag | ||
| 165 | * @param - | ||
| 166 | * @return value of zero flag | ||
| 167 | * @globalvars none | ||
| 168 | * @exception none | ||
| 169 | * @conditions none | ||
| 170 | */ | ||
| 171 | const bool getFlagZero() | ||
| 172 | { | ||
| 173 | return m_flagzero; | ||
| 174 | } | ||
| 175 | |||
| 176 | /** | ||
| 177 | * @method setFlagSign | ||
| 178 | * @brief set sign flag | ||
| 179 | * @param value new value of sign flag | ||
| 180 | * @return - | ||
| 181 | * @globalvars none | ||
| 182 | * @exception none | ||
| 183 | * @conditions none | ||
| 184 | */ | ||
| 185 | void setFlagSign(const bool value) | ||
| 186 | { | ||
| 187 | m_flagsign = value; | ||
| 188 | } | ||
| 189 | |||
| 190 | /** | ||
| 191 | * @method getFlagSign | ||
| 192 | * @brief get value of sign flag | ||
| 193 | * @param - | ||
| 194 | * @return value of sign flag | ||
| 195 | * @globalvars none | ||
| 196 | * @exception none | ||
| 197 | * @conditions none | ||
| 198 | */ | ||
| 199 | const bool getFlagSign() | ||
| 200 | { | ||
| 201 | return m_flagsign; | ||
| 202 | } | ||
| 203 | |||
| 204 | /** | ||
| 205 | * @method run | ||
| 206 | * @brief execute current program | ||
| 207 | * @param - | ||
| 208 | * @return - | ||
| 209 | * @globalvars none | ||
| 210 | * @exception std::runtime_error | ||
| 211 | * @conditions none | ||
| 212 | */ | ||
| 213 | void run(); | ||
| 214 | |||
| 215 | #if DEBUG | ||
| 216 | /** | ||
| 217 | * @method dumpRegisters | ||
| 218 | * @brief dump content of registers to outputstream | ||
| 219 | * @param out outputstream to write to | ||
| 220 | * @return void | ||
| 221 | * @globalvars none | ||
| 222 | * @exception none | ||
| 223 | * @conditions none | ||
| 224 | */ | ||
| 225 | void dumpRegisters(std::ostream& out); | ||
| 226 | #endif | ||
| 227 | |||
| 228 | private: | ||
| 229 | /* members */ | ||
| 230 | CDat *m_registers; | ||
| 231 | unsigned m_regcnt; | ||
| 232 | CMem *m_memory; | ||
| 233 | const CProgram *m_program; | ||
| 234 | std::set<CDisplay *> m_displays; | ||
| 235 | bool m_flagzero; | ||
| 236 | bool m_flagsign; | ||
| 237 | }; | ||
| 238 | |||
| 239 | #endif | ||
| 240 | |||
| 241 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/cdat.h b/ue4/mycpu/cdat.h new file mode 100644 index 0000000..a533fae --- /dev/null +++ b/ue4/mycpu/cdat.h | |||
| @@ -0,0 +1,326 @@ | |||
| 1 | /** | ||
| 2 | * @module cdat | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief Datatype template and datatype definition for CCPU and CMem | ||
| 5 | * @date 10.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef CDAT_H | ||
| 9 | #define CDAT_H 1 | ||
| 10 | |||
| 11 | #include <boost/operators.hpp> | ||
| 12 | #include <iostream> | ||
| 13 | |||
| 14 | /** | ||
| 15 | * @class CDatT | ||
| 16 | * | ||
| 17 | * Datatype template for CCPU and CMem. | ||
| 18 | */ | ||
| 19 | template <class T> | ||
| 20 | class CDatT | ||
| 21 | : boost::operators<CDatT<T> > | ||
| 22 | { | ||
| 23 | public: | ||
| 24 | /** | ||
| 25 | * @method CDatT | ||
| 26 | * @brief Default ctor | ||
| 27 | * @param - | ||
| 28 | * @return - | ||
| 29 | * @globalvars none | ||
| 30 | * @exception bad_alloc | ||
| 31 | * @conditions none | ||
| 32 | */ | ||
| 33 | CDatT() | ||
| 34 | {} | ||
| 35 | |||
| 36 | /** | ||
| 37 | * @method ~CDatT | ||
| 38 | * @brief Default dtor | ||
| 39 | * @param - | ||
| 40 | * @return - | ||
| 41 | * @globalvars none | ||
| 42 | * @exception none | ||
| 43 | * @conditions none | ||
| 44 | */ | ||
| 45 | ~CDatT() | ||
| 46 | {} | ||
| 47 | |||
| 48 | /** | ||
| 49 | * @method CDatT | ||
| 50 | * @brief Copy constructor for CDatT | ||
| 51 | * @param other reference to CDatT which will be copied | ||
| 52 | * @return - | ||
| 53 | * @globalvars none | ||
| 54 | * @exception none | ||
| 55 | * @conditions none | ||
| 56 | */ | ||
| 57 | CDatT(const CDatT& other) | ||
| 58 | : m_value(other.m_value) | ||
| 59 | {} | ||
| 60 | |||
| 61 | /** | ||
| 62 | * @method CDatT | ||
| 63 | * @brief Copy constructor for int | ||
| 64 | * @param newval new value for CDatT | ||
| 65 | * @return - | ||
| 66 | * @globalvars none | ||
| 67 | * @exception none | ||
| 68 | * @conditions none | ||
| 69 | */ | ||
| 70 | CDatT(T newval) | ||
| 71 | : m_value(newval) | ||
| 72 | {} | ||
| 73 | |||
| 74 | /** | ||
| 75 | * @method getValue | ||
| 76 | * @brief returns value of CDatT | ||
| 77 | * @param - | ||
| 78 | * @return value of CDatT | ||
| 79 | * @globalvars none | ||
| 80 | * @exception none | ||
| 81 | * @conditions none | ||
| 82 | */ | ||
| 83 | T getValue() const | ||
| 84 | { | ||
| 85 | return m_value; | ||
| 86 | } | ||
| 87 | |||
| 88 | /** | ||
| 89 | * @method operator T | ||
| 90 | * @brief convert to T | ||
| 91 | * @param - | ||
| 92 | * @return T | ||
| 93 | * @globalvars none | ||
| 94 | * @exception none | ||
| 95 | * @conditions none | ||
| 96 | */ | ||
| 97 | operator T() | ||
| 98 | { | ||
| 99 | return m_value; | ||
| 100 | } | ||
| 101 | |||
| 102 | /** | ||
| 103 | * @method operator< | ||
| 104 | * @brief implementation of operator < | ||
| 105 | * @param x reference to CDatT | ||
| 106 | * @return true if cdat is less than object x | ||
| 107 | * @globalvars none | ||
| 108 | * @exception none | ||
| 109 | * @conditions none | ||
| 110 | */ | ||
| 111 | bool operator<(const CDatT& x) const | ||
| 112 | { | ||
| 113 | return m_value < x.m_value; | ||
| 114 | } | ||
| 115 | |||
| 116 | /** | ||
| 117 | * @method operator== | ||
| 118 | * @brief implementation of operator == | ||
| 119 | * @param x reference to CDatT | ||
| 120 | * @return true if cdat equals object x | ||
| 121 | * @globalvars none | ||
| 122 | * @exception none | ||
| 123 | * @conditions none | ||
| 124 | */ | ||
| 125 | bool operator==(const CDatT& x) const | ||
| 126 | { | ||
| 127 | return m_value == x.m_value; | ||
| 128 | } | ||
| 129 | |||
| 130 | /** | ||
| 131 | * @method operator+= | ||
| 132 | * @brief implementation of operator += | ||
| 133 | * @param x reference to CDatT | ||
| 134 | * @return refecence to CDatT | ||
| 135 | * @globalvars none | ||
| 136 | * @exception none | ||
| 137 | * @conditions none | ||
| 138 | */ | ||
| 139 | CDatT& operator+=(const CDatT& x) | ||
| 140 | { | ||
| 141 | m_value += x.m_value; | ||
| 142 | return *this; | ||
| 143 | } | ||
| 144 | |||
| 145 | /** | ||
| 146 | * @method operator-= | ||
| 147 | * @brief implementation of operator -= | ||
| 148 | * @param x reference to CDatT | ||
| 149 | * @return refecence to CDatT | ||
| 150 | * @globalvars none | ||
| 151 | * @exception none | ||
| 152 | * @conditions none | ||
| 153 | */ | ||
| 154 | CDatT& operator-=(const CDatT& x) | ||
| 155 | { | ||
| 156 | m_value -= x.m_value; | ||
| 157 | return *this; | ||
| 158 | } | ||
| 159 | |||
| 160 | /** | ||
| 161 | * @method operator*= | ||
| 162 | * @brief implementation of operator *= | ||
| 163 | * @param x reference to CDatT | ||
| 164 | * @return refecence to CDatT | ||
| 165 | * @globalvars none | ||
| 166 | * @exception none | ||
| 167 | * @conditions none | ||
| 168 | */ | ||
| 169 | CDatT& operator*=(const CDatT& x) | ||
| 170 | { | ||
| 171 | m_value *= x.m_value; | ||
| 172 | return *this; | ||
| 173 | } | ||
| 174 | |||
| 175 | /** | ||
| 176 | * @method operator/= | ||
| 177 | * @brief implementation of operator /= | ||
| 178 | * @param x reference to CDatT | ||
| 179 | * @return refecence to CDatT | ||
| 180 | * @globalvars none | ||
| 181 | * @exception none | ||
| 182 | * @conditions none | ||
| 183 | */ | ||
| 184 | CDatT& operator/=(const CDatT& x) | ||
| 185 | { | ||
| 186 | m_value /= x.m_value; | ||
| 187 | return *this; | ||
| 188 | } | ||
| 189 | |||
| 190 | /** | ||
| 191 | * @method operator%= | ||
| 192 | * @brief implementation of operator %= | ||
| 193 | * @param x reference to CDatT | ||
| 194 | * @return refecence to CDatT | ||
| 195 | * @globalvars none | ||
| 196 | * @exception none | ||
| 197 | * @conditions none | ||
| 198 | */ | ||
| 199 | CDatT& operator%=(const CDatT& x) | ||
| 200 | { | ||
| 201 | m_value %= x.m_value; | ||
| 202 | return *this; | ||
| 203 | } | ||
| 204 | |||
| 205 | /** | ||
| 206 | * @method operator|= | ||
| 207 | * @brief implementation of operator |= | ||
| 208 | * @param x reference to CDatT | ||
| 209 | * @return refecence to CDatT | ||
| 210 | * @globalvars none | ||
| 211 | * @exception none | ||
| 212 | * @conditions none | ||
| 213 | */ | ||
| 214 | CDatT& operator|=(const CDatT& x) | ||
| 215 | { | ||
| 216 | m_value |= x.m_value; | ||
| 217 | return *this; | ||
| 218 | } | ||
| 219 | |||
| 220 | /** | ||
| 221 | * @method operator&= | ||
| 222 | * @brief implementation of operator &= | ||
| 223 | * @param x reference to CDatT | ||
| 224 | * @return refecence to CDatT | ||
| 225 | * @globalvars none | ||
| 226 | * @exception none | ||
| 227 | * @conditions none | ||
| 228 | */ | ||
| 229 | CDatT& operator&=(const CDatT& x) | ||
| 230 | { | ||
| 231 | m_value &= x.m_value; | ||
| 232 | return *this; | ||
| 233 | } | ||
| 234 | |||
| 235 | /** | ||
| 236 | * @method operator^= | ||
| 237 | * @brief implementation of operator ^= | ||
| 238 | * @param x reference to CDatT | ||
| 239 | * @return refecence to CDatT | ||
| 240 | * @globalvars none | ||
| 241 | * @exception none | ||
| 242 | * @conditions none | ||
| 243 | */ | ||
| 244 | CDatT& operator^=(const CDatT& x) | ||
| 245 | { | ||
| 246 | m_value ^= x.m_value; | ||
| 247 | return *this; | ||
| 248 | } | ||
| 249 | |||
| 250 | /** | ||
| 251 | * @method operator++ | ||
| 252 | * @brief implementation of operator ++ | ||
| 253 | * @param - | ||
| 254 | * @return refecence to CDatT | ||
| 255 | * @globalvars none | ||
| 256 | * @exception none | ||
| 257 | * @conditions none | ||
| 258 | */ | ||
| 259 | CDatT& operator++() | ||
| 260 | { | ||
| 261 | m_value++; | ||
| 262 | return *this; | ||
| 263 | } | ||
| 264 | |||
| 265 | /** | ||
| 266 | * @method operator-- | ||
| 267 | * @brief implementation of operator -- | ||
| 268 | * @param - | ||
| 269 | * @return refecence to CDatT | ||
| 270 | * @globalvars none | ||
| 271 | * @exception none | ||
| 272 | * @conditions none | ||
| 273 | */ | ||
| 274 | CDatT& operator--() | ||
| 275 | { | ||
| 276 | m_value--; | ||
| 277 | return *this; | ||
| 278 | } | ||
| 279 | |||
| 280 | /** | ||
| 281 | * @method operator<< | ||
| 282 | * @brief Shift/output operator for outputstream | ||
| 283 | * @param stream reference to outputstream | ||
| 284 | * @param cdat object which will be printed to stream | ||
| 285 | * @return reference to outputstream | ||
| 286 | * @globalvars none | ||
| 287 | * @exception none | ||
| 288 | * @conditions none | ||
| 289 | */ | ||
| 290 | friend std::ostream& operator<<(std::ostream& stream, CDatT cdat) | ||
| 291 | { | ||
| 292 | stream << cdat.m_value; | ||
| 293 | return stream; | ||
| 294 | } | ||
| 295 | |||
| 296 | /** | ||
| 297 | * @method operator>> | ||
| 298 | * @brief Shift/read operator for inputstream | ||
| 299 | * @param stream reference to inputstream | ||
| 300 | * @param cdat reference to object which will be read from stream | ||
| 301 | * @return reference to inputstream | ||
| 302 | * @globalvars none | ||
| 303 | * @exception none | ||
| 304 | * @conditions none | ||
| 305 | */ | ||
| 306 | friend std::istream& operator>>(std::istream & stream, CDatT& cdat) | ||
| 307 | { | ||
| 308 | stream >> cdat.m_value; | ||
| 309 | return stream; | ||
| 310 | } | ||
| 311 | |||
| 312 | private: | ||
| 313 | /* members */ | ||
| 314 | T m_value; | ||
| 315 | }; | ||
| 316 | |||
| 317 | /** | ||
| 318 | * @class CDat | ||
| 319 | * | ||
| 320 | * Datatype for CCPU and CMem | ||
| 321 | */ | ||
| 322 | typedef CDatT<int> CDat; | ||
| 323 | |||
| 324 | #endif | ||
| 325 | |||
| 326 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/cdisplay.h b/ue4/mycpu/cdisplay.h new file mode 100644 index 0000000..82776ee --- /dev/null +++ b/ue4/mycpu/cdisplay.h | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | /** | ||
| 2 | * @module cdisplay | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief Abstract template class for displays | ||
| 5 | * @date 10.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef CDISPLAY_H | ||
| 9 | #define CDISPLAY_H 1 | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @class CDisplayT | ||
| 13 | * | ||
| 14 | * Abstract template class for displays | ||
| 15 | */ | ||
| 16 | template <class T> | ||
| 17 | class CDisplayT | ||
| 18 | { | ||
| 19 | public: | ||
| 20 | /** | ||
| 21 | * @method CDisplayT | ||
| 22 | * @brief Default ctor | ||
| 23 | * @param name name of display | ||
| 24 | * @return - | ||
| 25 | * @globalvars none | ||
| 26 | * @exception none | ||
| 27 | * @conditions none | ||
| 28 | */ | ||
| 29 | CDisplayT(std::string name) | ||
| 30 | : m_name(name) | ||
| 31 | {} | ||
| 32 | |||
| 33 | /** | ||
| 34 | * @method ~CDisplayT | ||
| 35 | * @brief Default dtor | ||
| 36 | * @param - | ||
| 37 | * @return - | ||
| 38 | * @globalvars none | ||
| 39 | * @exception none | ||
| 40 | * @conditions none | ||
| 41 | */ | ||
| 42 | virtual ~CDisplayT() | ||
| 43 | {} | ||
| 44 | |||
| 45 | /** | ||
| 46 | * @method getName | ||
| 47 | * @brief returns name of display | ||
| 48 | * @param - | ||
| 49 | * @return name of display | ||
| 50 | * @globalvars none | ||
| 51 | * @exception none | ||
| 52 | * @conditions none | ||
| 53 | */ | ||
| 54 | virtual const std::string& getName() | ||
| 55 | { | ||
| 56 | return m_name; | ||
| 57 | } | ||
| 58 | |||
| 59 | /** | ||
| 60 | * @method display | ||
| 61 | * @brief prints value to display | ||
| 62 | * @param value value to display | ||
| 63 | * @return - | ||
| 64 | * @globalvars none | ||
| 65 | * @exception none | ||
| 66 | * @conditions none | ||
| 67 | */ | ||
| 68 | virtual void display(const T &value) = 0; | ||
| 69 | |||
| 70 | protected: | ||
| 71 | /* members */ | ||
| 72 | /** name of display */ | ||
| 73 | std::string m_name; | ||
| 74 | }; | ||
| 75 | |||
| 76 | /** | ||
| 77 | * @class CDisplay | ||
| 78 | * | ||
| 79 | * Memory definition for CCPU | ||
| 80 | */ | ||
| 81 | typedef CDisplayT<CDat> CDisplay; | ||
| 82 | |||
| 83 | #endif | ||
| 84 | |||
| 85 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/cinstruction.cpp b/ue4/mycpu/cinstruction.cpp new file mode 100644 index 0000000..a766015 --- /dev/null +++ b/ue4/mycpu/cinstruction.cpp | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /** | ||
| 2 | * @module cinstruction | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief Abstract class for displays | ||
| 5 | * @date 13.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <sstream> | ||
| 9 | #include <stdexcept> | ||
| 10 | #include <boost/lexical_cast.hpp> | ||
| 11 | #include <assert.h> | ||
| 12 | #include "cinstruction.h" | ||
| 13 | #include "ccpu.h" | ||
| 14 | |||
| 15 | using namespace std; | ||
| 16 | |||
| 17 | const unsigned CInstruction::parseRegister(const std::string& str) | ||
| 18 | { | ||
| 19 | unsigned reg; | ||
| 20 | if (str.length() < 2 || str[0] != 'r') | ||
| 21 | throw runtime_error("Invalid syntax of register"); | ||
| 22 | |||
| 23 | try | ||
| 24 | { | ||
| 25 | reg = boost::lexical_cast<unsigned>(str.substr(1)); | ||
| 26 | } | ||
| 27 | catch(boost::bad_lexical_cast& ex) | ||
| 28 | { | ||
| 29 | throw runtime_error("Invalid syntax of register"); | ||
| 30 | } | ||
| 31 | |||
| 32 | return reg; | ||
| 33 | } | ||
| 34 | |||
| 35 | /*----------------------------------------------------------------------------*/ | ||
| 36 | |||
| 37 | inline void CInstruction::checkRegister(CCPU *cpu, const unsigned regidx) | ||
| 38 | { | ||
| 39 | assert(cpu != NULL); | ||
| 40 | if (regidx >= cpu->getRegisterCount()) | ||
| 41 | { | ||
| 42 | stringstream sstr; | ||
| 43 | sstr << "Register R" << regidx << " doesn't exist (out of bound)"; | ||
| 44 | throw runtime_error(sstr.str()); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/cinstruction.h b/ue4/mycpu/cinstruction.h new file mode 100644 index 0000000..4cc69de --- /dev/null +++ b/ue4/mycpu/cinstruction.h | |||
| @@ -0,0 +1,189 @@ | |||
| 1 | /** | ||
| 2 | * @module cinstruction | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief Abstract class for displays | ||
| 5 | * @date 13.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef CINSTRUCTION_H | ||
| 9 | #define CINSTRUCTION_H 1 | ||
| 10 | |||
| 11 | #include <iostream> | ||
| 12 | #include <list> | ||
| 13 | |||
| 14 | /* forward declare CCPU */ | ||
| 15 | class CCPU; | ||
| 16 | |||
| 17 | /** | ||
| 18 | * @class CInstruction | ||
| 19 | * | ||
| 20 | * Abstract class for displays | ||
| 21 | */ | ||
| 22 | class CInstruction | ||
| 23 | { | ||
| 24 | public: | ||
| 25 | /** | ||
| 26 | * @method CInstruction | ||
| 27 | * @brief Default ctor | ||
| 28 | * @param name name of instruction | ||
| 29 | * @return - | ||
| 30 | * @globalvars none | ||
| 31 | * @exception none | ||
| 32 | * @conditions none | ||
| 33 | */ | ||
| 34 | CInstruction(std::string name) | ||
| 35 | : m_name(name) | ||
| 36 | {} | ||
| 37 | |||
| 38 | /** | ||
| 39 | * @method ~CInstruction | ||
| 40 | * @brief Default dtor | ||
| 41 | * @param - | ||
| 42 | * @return - | ||
| 43 | * @globalvars none | ||
| 44 | * @exception none | ||
| 45 | * @conditions none | ||
| 46 | */ | ||
| 47 | virtual ~CInstruction() | ||
| 48 | {} | ||
| 49 | |||
| 50 | /** | ||
| 51 | * @method operator== | ||
| 52 | * @brief implementation of operator == | ||
| 53 | * @param name reference to std::string | ||
| 54 | * @return true if instructionname is name | ||
| 55 | * @globalvars none | ||
| 56 | * @exception none | ||
| 57 | * @conditions none | ||
| 58 | */ | ||
| 59 | virtual bool operator==(std::string& name) | ||
| 60 | { | ||
| 61 | return name == m_name; | ||
| 62 | } | ||
| 63 | |||
| 64 | /** | ||
| 65 | * @method operator() | ||
| 66 | * @brief implementation of operator (CCPU) | ||
| 67 | * @param cpu pointer to cpu | ||
| 68 | * @return - | ||
| 69 | * @globalvars none | ||
| 70 | * @exception std::runtime_error | ||
| 71 | * @conditions none | ||
| 72 | */ | ||
| 73 | virtual CInstruction& operator()(CCPU *cpu) | ||
| 74 | { | ||
| 75 | execute(cpu); | ||
| 76 | return *this; | ||
| 77 | } | ||
| 78 | |||
| 79 | /** | ||
| 80 | * @method getName | ||
| 81 | * @brief returns instruction name | ||
| 82 | * @param - | ||
| 83 | * @return name of instruction | ||
| 84 | * @globalvars none | ||
| 85 | * @exception none | ||
| 86 | * @conditions none | ||
| 87 | */ | ||
| 88 | virtual const std::string& getName() | ||
| 89 | { | ||
| 90 | return m_name; | ||
| 91 | } | ||
| 92 | |||
| 93 | /** | ||
| 94 | * @method dump | ||
| 95 | * @brief dumps information about instruction to outputstream | ||
| 96 | * @param stream outputstream | ||
| 97 | * @return reference to outputstream | ||
| 98 | * @globalvars none | ||
| 99 | * @exception none | ||
| 100 | * @conditions none | ||
| 101 | */ | ||
| 102 | virtual std::ostream& dump(std::ostream& stream) | ||
| 103 | { | ||
| 104 | stream << m_name; | ||
| 105 | return stream; | ||
| 106 | } | ||
| 107 | |||
| 108 | /** | ||
| 109 | * @method operator<< | ||
| 110 | * @brief Shift/output operator for outputstream | ||
| 111 | * @param stream reference to outputstream | ||
| 112 | * @param instr object which will be printed to stream | ||
| 113 | * @return reference to outputstream | ||
| 114 | * @globalvars none | ||
| 115 | * @exception none | ||
| 116 | * @conditions none | ||
| 117 | */ | ||
| 118 | friend std::ostream& operator<<(std::ostream& stream, CInstruction& instr) | ||
| 119 | { | ||
| 120 | return instr.dump(stream); | ||
| 121 | } | ||
| 122 | |||
| 123 | /** | ||
| 124 | * @method parseRegister | ||
| 125 | * @brief parses register syntax Rx (e.g. "R1") | ||
| 126 | * @param str register in assembler syntax | ||
| 127 | * @return registernumber | ||
| 128 | * @globalvars none | ||
| 129 | * @exception std::runtime_error | ||
| 130 | * @conditions none | ||
| 131 | */ | ||
| 132 | virtual const unsigned parseRegister(const std::string& str); | ||
| 133 | |||
| 134 | /** | ||
| 135 | * @method checkRegister | ||
| 136 | * @brief performs a register boundary check | ||
| 137 | * does the register exist in cpu? | ||
| 138 | * @param cpu pointer to cpu | ||
| 139 | * @param regidx registernumber | ||
| 140 | * @return - | ||
| 141 | * @globalvars none | ||
| 142 | * @exception std::runtime_error | ||
| 143 | * @conditions none | ||
| 144 | */ | ||
| 145 | virtual void checkRegister(CCPU *cpu, const unsigned regidx); | ||
| 146 | |||
| 147 | /** | ||
| 148 | * @method factory | ||
| 149 | * @brief creates a new instance of this instruction | ||
| 150 | * @param - | ||
| 151 | * @return new instruction instance | ||
| 152 | * @globalvars none | ||
| 153 | * @exception none | ||
| 154 | * @conditions none | ||
| 155 | */ | ||
| 156 | virtual CInstruction *factory() = 0; | ||
| 157 | |||
| 158 | /** | ||
| 159 | * @method compile | ||
| 160 | * @brief parses instruction parameters and prepares the | ||
| 161 | * instruction for executing | ||
| 162 | * @param params list of parameters of this instruction | ||
| 163 | * @return - | ||
| 164 | * @globalvars none | ||
| 165 | * @exception std::runtime_error | ||
| 166 | * @conditions none | ||
| 167 | */ | ||
| 168 | virtual void compile(std::list<std::string>& params) = 0; | ||
| 169 | |||
| 170 | /** | ||
| 171 | * @method execute | ||
| 172 | * @brief executes the instruction | ||
| 173 | * @param cpu pointer to cpu | ||
| 174 | * @return - | ||
| 175 | * @globalvars none | ||
| 176 | * @exception std::runtime_error | ||
| 177 | * @conditions none | ||
| 178 | */ | ||
| 179 | virtual void execute(CCPU *cpu) = 0; | ||
| 180 | |||
| 181 | protected: | ||
| 182 | /* members */ | ||
| 183 | /** name of instruction */ | ||
| 184 | std::string m_name; | ||
| 185 | }; | ||
| 186 | |||
| 187 | #endif | ||
| 188 | |||
| 189 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/cmem.h b/ue4/mycpu/cmem.h new file mode 100644 index 0000000..5045c34 --- /dev/null +++ b/ue4/mycpu/cmem.h | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | /** | ||
| 2 | * @module cmem | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief Memory template and memory definition for CCPU | ||
| 5 | * @date 10.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef CMEM_H | ||
| 9 | #define CMEM_H 1 | ||
| 10 | |||
| 11 | #include <vector> | ||
| 12 | #include <istream> | ||
| 13 | #include <sstream> | ||
| 14 | #include <stdexcept> | ||
| 15 | #include <boost/lexical_cast.hpp> | ||
| 16 | #ifdef DEBUG | ||
| 17 | # include <iostream> | ||
| 18 | # include <iomanip> | ||
| 19 | #endif | ||
| 20 | #include "cdat.h" | ||
| 21 | |||
| 22 | /** | ||
| 23 | * @class CVectorMem | ||
| 24 | * | ||
| 25 | * Extends std::vector template for use as memory for CCPU. | ||
| 26 | */ | ||
| 27 | template <class T, class Allocator=std::allocator<T> > | ||
| 28 | class CVectorMem | ||
| 29 | : public std::vector<T, Allocator> | ||
| 30 | { | ||
| 31 | public: | ||
| 32 | using std::vector<T, Allocator>::size; | ||
| 33 | using std::vector<T, Allocator>::at; | ||
| 34 | |||
| 35 | /** | ||
| 36 | * @method initialize | ||
| 37 | * @brief initialize the vector with the content of istream. istream is | ||
| 38 | * read per line. empty lines will add unitialized elements. | ||
| 39 | * @param in inputstream to read from | ||
| 40 | * @return void | ||
| 41 | * @globalvars none | ||
| 42 | * @exception std::runtime_error | ||
| 43 | * @conditions none | ||
| 44 | */ | ||
| 45 | void initialize(std::istream& in) | ||
| 46 | { | ||
| 47 | if (!in.good()) | ||
| 48 | return; | ||
| 49 | |||
| 50 | std::string line; | ||
| 51 | unsigned i = 0; | ||
| 52 | while (!in.eof() && in.good()) | ||
| 53 | { | ||
| 54 | ++i; | ||
| 55 | std::getline(in, line); | ||
| 56 | |||
| 57 | /* skip last line if it's empty */ | ||
| 58 | if (line.empty() && in.eof()) | ||
| 59 | break; | ||
| 60 | |||
| 61 | T value; | ||
| 62 | try | ||
| 63 | { | ||
| 64 | if (!line.empty()) | ||
| 65 | value = boost::lexical_cast<T>(line); | ||
| 66 | } | ||
| 67 | catch(boost::bad_lexical_cast& ex) | ||
| 68 | { | ||
| 69 | std::stringstream sstr; | ||
| 70 | sstr << "Unable to convert input (line " << i << "): " << ex.what(); | ||
| 71 | throw std::runtime_error(sstr.str()); | ||
| 72 | } | ||
| 73 | |||
| 74 | push_back(value); | ||
| 75 | } | ||
| 76 | } | ||
| 77 | |||
| 78 | #if DEBUG | ||
| 79 | /** | ||
| 80 | * @method dump | ||
| 81 | * @brief dumps contents of vector to outputstream | ||
| 82 | * @param out outputstream to write to | ||
| 83 | * @return void | ||
| 84 | * @globalvars none | ||
| 85 | * @exception none | ||
| 86 | * @conditions none | ||
| 87 | */ | ||
| 88 | void dump(std::ostream& out) | ||
| 89 | { | ||
| 90 | out << "[MEMORY DUMP]" << std::endl; | ||
| 91 | for(unsigned i = 0; i < size(); ++i) | ||
| 92 | { | ||
| 93 | out << "[" << std::setw(4) << std::setfill('0') << i << "] " | ||
| 94 | << at(i) << std::endl; | ||
| 95 | } | ||
| 96 | } | ||
| 97 | #endif | ||
| 98 | }; | ||
| 99 | |||
| 100 | /** | ||
| 101 | * @class CMem | ||
| 102 | * | ||
| 103 | * Memory definition for CCPU | ||
| 104 | */ | ||
| 105 | typedef CVectorMem<CDat> CMem; | ||
| 106 | |||
| 107 | #endif | ||
| 108 | |||
| 109 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/cprogram.cpp b/ue4/mycpu/cprogram.cpp new file mode 100644 index 0000000..3fcf734 --- /dev/null +++ b/ue4/mycpu/cprogram.cpp | |||
| @@ -0,0 +1,161 @@ | |||
| 1 | /** | ||
| 2 | * @module cprogram | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief CProgram extends std::vector and adds a method for parsing programfile | ||
| 5 | * @date 12.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <boost/algorithm/string.hpp> | ||
| 9 | #include <boost/algorithm/string/split.hpp> | ||
| 10 | #ifdef DEBUG | ||
| 11 | # include <iostream> | ||
| 12 | # include <iomanip> | ||
| 13 | #endif | ||
| 14 | #include "cprogram.h" | ||
| 15 | #include "instructions.h" | ||
| 16 | |||
| 17 | using namespace std; | ||
| 18 | |||
| 19 | CProgram::CProgram() | ||
| 20 | { | ||
| 21 | m_instrset.insert(new CInstructionInc); | ||
| 22 | m_instrset.insert(new CInstructionDec); | ||
| 23 | m_instrset.insert(new CInstructionAdd); | ||
| 24 | m_instrset.insert(new CInstructionSub); | ||
| 25 | m_instrset.insert(new CInstructionMul); | ||
| 26 | m_instrset.insert(new CInstructionDiv); | ||
| 27 | m_instrset.insert(new CInstructionLoad); | ||
| 28 | m_instrset.insert(new CInstructionStore); | ||
| 29 | m_instrset.insert(new CInstructionTest); | ||
| 30 | m_instrset.insert(new CInstructionLabel); | ||
| 31 | m_instrset.insert(new CInstructionJumpA); | ||
| 32 | m_instrset.insert(new CInstructionJumpZ); | ||
| 33 | m_instrset.insert(new CInstructionJumpS); | ||
| 34 | m_instrset.insert(new CInstructionWrite); | ||
| 35 | } | ||
| 36 | |||
| 37 | /*----------------------------------------------------------------------------*/ | ||
| 38 | |||
| 39 | CProgram::~CProgram() | ||
| 40 | { | ||
| 41 | /* free instruction set */ | ||
| 42 | set<CInstruction *>::iterator it; | ||
| 43 | for (it = m_instrset.begin(); it != m_instrset.end(); ++it) | ||
| 44 | delete *it; | ||
| 45 | |||
| 46 | /* free instruction */ | ||
| 47 | for (iterator it = begin(); it != end(); ++it) | ||
| 48 | delete *it; | ||
| 49 | } | ||
| 50 | |||
| 51 | /*----------------------------------------------------------------------------*/ | ||
| 52 | |||
| 53 | void CProgram::compile(std::istream& in) | ||
| 54 | { | ||
| 55 | if (!in.good()) | ||
| 56 | return; | ||
| 57 | |||
| 58 | string line; | ||
| 59 | unsigned i = 0; | ||
| 60 | while (!in.eof() && in.good()) | ||
| 61 | { | ||
| 62 | ++i; | ||
| 63 | |||
| 64 | /* read stream per line */ | ||
| 65 | getline(in, line); | ||
| 66 | if (line.empty()) | ||
| 67 | continue; | ||
| 68 | |||
| 69 | boost::trim(line); | ||
| 70 | boost::to_lower(line); | ||
| 71 | |||
| 72 | /* ignore comments */ | ||
| 73 | if (line.find_first_of('#') == 0) | ||
| 74 | continue; | ||
| 75 | |||
| 76 | /* get instruction name */ | ||
| 77 | size_t pos = line.find_first_of(' '); | ||
| 78 | string instrname(line.substr(0, pos)); | ||
| 79 | |||
| 80 | /* search and create instruction */ | ||
| 81 | CInstruction *instrptr = NULL; | ||
| 82 | set<CInstruction *>::iterator it; | ||
| 83 | for (it = m_instrset.begin(); it != m_instrset.end(); ++it) | ||
| 84 | { | ||
| 85 | if (*(*it) == instrname) | ||
| 86 | { | ||
| 87 | instrptr = *it; | ||
| 88 | break; | ||
| 89 | } | ||
| 90 | } | ||
| 91 | if (instrptr == NULL) | ||
| 92 | { | ||
| 93 | stringstream sstr; | ||
| 94 | sstr << "Unknown instruction '" << instrname << "' on line " << i << "."; | ||
| 95 | throw runtime_error(sstr.str()); | ||
| 96 | } | ||
| 97 | |||
| 98 | /* create instruction */ | ||
| 99 | CInstruction *instr = instrptr->factory(); | ||
| 100 | |||
| 101 | /* parse instruction parameters */ | ||
| 102 | string params = (pos == string::npos) ? "" : line.substr(pos + 1); | ||
| 103 | boost::trim(params); | ||
| 104 | list<string> instrparams; | ||
| 105 | boost::split(instrparams, params, boost::is_any_of(", \t"), boost::token_compress_on); | ||
| 106 | |||
| 107 | /* let instruction parse the parameters. catch+throw exception */ | ||
| 108 | try | ||
| 109 | { | ||
| 110 | /* handle label instruction ourself, but still add a dummy instruction */ | ||
| 111 | if (instrname == "label") | ||
| 112 | { | ||
| 113 | if (instrparams.size() != 1) | ||
| 114 | throw runtime_error("Invalid paramater count - must be 1"); | ||
| 115 | string label(instrparams.front()); | ||
| 116 | if (label.length() < 2 || label[ label.length() - 1] != ':') | ||
| 117 | throw runtime_error("Label has invalid syntax"); | ||
| 118 | m_labels[ label.substr(0, label.length() - 1) ] = size(); | ||
| 119 | } | ||
| 120 | instr->compile(instrparams); | ||
| 121 | } | ||
| 122 | catch(runtime_error& ex) | ||
| 123 | { | ||
| 124 | stringstream sstr; | ||
| 125 | sstr << "Unable to compile instruction '" << instrname | ||
| 126 | << "' (line " << i << "): " << ex.what(); | ||
| 127 | throw runtime_error(sstr.str()); | ||
| 128 | } | ||
| 129 | |||
| 130 | push_back(instr); | ||
| 131 | } | ||
| 132 | } | ||
| 133 | |||
| 134 | /*----------------------------------------------------------------------------*/ | ||
| 135 | |||
| 136 | unsigned CProgram::findLabel(const std::string& label) const | ||
| 137 | { | ||
| 138 | map<string, unsigned>::const_iterator it; | ||
| 139 | it = m_labels.find(label); | ||
| 140 | if (it == m_labels.end()) | ||
| 141 | throw runtime_error("Unknown label '" + label + "'"); | ||
| 142 | return it->second; | ||
| 143 | } | ||
| 144 | |||
| 145 | /*----------------------------------------------------------------------------*/ | ||
| 146 | |||
| 147 | #if DEBUG | ||
| 148 | void CProgram::dump(std::ostream& out) | ||
| 149 | { | ||
| 150 | out << "[PROGRAM DUMP]" << endl; | ||
| 151 | unsigned i = 0; | ||
| 152 | for(iterator it = begin(); it < end(); ++it) | ||
| 153 | { | ||
| 154 | out << "[" << std::setw(4) << std::setfill('0') << i << "] " | ||
| 155 | << *(*it) << endl; | ||
| 156 | ++i; | ||
| 157 | } | ||
| 158 | } | ||
| 159 | #endif | ||
| 160 | |||
| 161 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/cprogram.h b/ue4/mycpu/cprogram.h new file mode 100644 index 0000000..27e7647 --- /dev/null +++ b/ue4/mycpu/cprogram.h | |||
| @@ -0,0 +1,106 @@ | |||
| 1 | /** | ||
| 2 | * @module cprogram | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief CProgram extends std::vector and adds a method for parsing programfile | ||
| 5 | * @date 10.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef CPROGRAM_H | ||
| 9 | #define CPROGRAM_H 1 | ||
| 10 | |||
| 11 | #include <vector> | ||
| 12 | #include <set> | ||
| 13 | #include <map> | ||
| 14 | #include "cinstruction.h" | ||
| 15 | |||
| 16 | /** | ||
| 17 | * @class CProgram | ||
| 18 | * | ||
| 19 | * CProgram extends std::vector and adds a method for parsing | ||
| 20 | * programfile. This adds instances of CInstruction to CProgram itself. | ||
| 21 | */ | ||
| 22 | class CProgram | ||
| 23 | : public std::vector<CInstruction *> | ||
| 24 | { | ||
| 25 | public: | ||
| 26 | /** | ||
| 27 | * @method CProgram | ||
| 28 | * @brief Default ctor | ||
| 29 | * @param - | ||
| 30 | * @return - | ||
| 31 | * @globalvars none | ||
| 32 | * @exception none | ||
| 33 | * @conditions none | ||
| 34 | */ | ||
| 35 | CProgram(); | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @method ~CProgram | ||
| 39 | * @brief Default dtor | ||
| 40 | * @param - | ||
| 41 | * @return - | ||
| 42 | * @globalvars none | ||
| 43 | * @exception none | ||
| 44 | * @conditions none | ||
| 45 | */ | ||
| 46 | ~CProgram(); | ||
| 47 | |||
| 48 | /** | ||
| 49 | * @method getLabels | ||
| 50 | * @brief get reference to labels map | ||
| 51 | * @param - | ||
| 52 | * @return reference to labels map | ||
| 53 | * @globalvars none | ||
| 54 | * @exception none | ||
| 55 | * @conditions none | ||
| 56 | */ | ||
| 57 | const std::map<std::string, unsigned>& getLabels() const | ||
| 58 | { | ||
| 59 | return m_labels; | ||
| 60 | } | ||
| 61 | |||
| 62 | /** | ||
| 63 | * @method findLabel | ||
| 64 | * @brief search for label | ||
| 65 | * @param label name of label to search for | ||
| 66 | * @return index of found label in program | ||
| 67 | * @globalvars none | ||
| 68 | * @exception std::runtime_error | ||
| 69 | * @conditions none | ||
| 70 | */ | ||
| 71 | unsigned findLabel(const std::string& label) const; | ||
| 72 | |||
| 73 | /** | ||
| 74 | * @method compile | ||
| 75 | * @brief create instructions from parsing stream | ||
| 76 | * @param in inputstream to read from | ||
| 77 | * @return void | ||
| 78 | * @globalvars none | ||
| 79 | * @exception std::runtime_error | ||
| 80 | * @conditions none | ||
| 81 | */ | ||
| 82 | void compile(std::istream& in); | ||
| 83 | |||
| 84 | #if DEBUG | ||
| 85 | /** | ||
| 86 | * @method dump | ||
| 87 | * @brief dumps contents to outputstream | ||
| 88 | * @param out outputstream to write to | ||
| 89 | * @return void | ||
| 90 | * @globalvars none | ||
| 91 | * @exception none | ||
| 92 | * @conditions none | ||
| 93 | */ | ||
| 94 | void dump(std::ostream& out); | ||
| 95 | #endif | ||
| 96 | |||
| 97 | private: | ||
| 98 | /* members */ | ||
| 99 | /** set of known instructions */ | ||
| 100 | std::set<CInstruction *> m_instrset; | ||
| 101 | std::map<std::string, unsigned> m_labels; | ||
| 102 | }; | ||
| 103 | |||
| 104 | #endif | ||
| 105 | |||
| 106 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/displays.h b/ue4/mycpu/displays.h new file mode 100644 index 0000000..d4f3f36 --- /dev/null +++ b/ue4/mycpu/displays.h | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | /** | ||
| 2 | * @module displays | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief Implementations of CDisplay | ||
| 5 | * @date 10.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef DISPLAYS_H | ||
| 9 | #define DISPLAYS_H 1 | ||
| 10 | |||
| 11 | #include <iomanip> | ||
| 12 | #include "cdisplay.h" | ||
| 13 | |||
| 14 | /** | ||
| 15 | * @class CDisplayWDEZ | ||
| 16 | * | ||
| 17 | * Implementation of CDisplay | ||
| 18 | * Prints CDat to stdout as decimal | ||
| 19 | */ | ||
| 20 | class CDisplayWDEZ | ||
| 21 | : public CDisplay | ||
| 22 | { | ||
| 23 | public: | ||
| 24 | CDisplayWDEZ() | ||
| 25 | : CDisplay("wdez") | ||
| 26 | {} | ||
| 27 | |||
| 28 | /** | ||
| 29 | * @method display | ||
| 30 | * @brief prints value to display | ||
| 31 | * @param value value to display | ||
| 32 | * @return - | ||
| 33 | * @globalvars none | ||
| 34 | * @exception none | ||
| 35 | * @conditions none | ||
| 36 | */ | ||
| 37 | void display(const CDat &value) | ||
| 38 | { | ||
| 39 | std::cout << std::dec << value << std::endl; | ||
| 40 | } | ||
| 41 | }; | ||
| 42 | |||
| 43 | /*============================================================================*/ | ||
| 44 | |||
| 45 | /** | ||
| 46 | * @class CDisplayWHEX | ||
| 47 | * | ||
| 48 | * Implementation of CDisplay | ||
| 49 | * Prints CDat to stdout as decimal | ||
| 50 | */ | ||
| 51 | class CDisplayWHEX | ||
| 52 | : public CDisplay | ||
| 53 | { | ||
| 54 | public: | ||
| 55 | CDisplayWHEX() | ||
| 56 | : CDisplay("whex") | ||
| 57 | {} | ||
| 58 | |||
| 59 | /** | ||
| 60 | * @method display | ||
| 61 | * @brief prints value to display | ||
| 62 | * @param value value to display | ||
| 63 | * @return - | ||
| 64 | * @globalvars none | ||
| 65 | * @exception none | ||
| 66 | * @conditions none | ||
| 67 | */ | ||
| 68 | void display(const CDat &value) | ||
| 69 | { | ||
| 70 | std::cout << std::hex << value << std::endl; | ||
| 71 | } | ||
| 72 | }; | ||
| 73 | |||
| 74 | #endif | ||
| 75 | |||
| 76 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/instructions.cpp b/ue4/mycpu/instructions.cpp new file mode 100644 index 0000000..ef9e944 --- /dev/null +++ b/ue4/mycpu/instructions.cpp | |||
| @@ -0,0 +1,341 @@ | |||
| 1 | /** | ||
| 2 | * @module instructions | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief Implementations of CInstruction | ||
| 5 | * @date 10.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include <map> | ||
| 9 | #include <assert.h> | ||
| 10 | #include "instructions.h" | ||
| 11 | |||
| 12 | using namespace std; | ||
| 13 | |||
| 14 | void CInstructionInc::compile(std::list<std::string>& params) | ||
| 15 | { | ||
| 16 | if (params.size() != 1) | ||
| 17 | throw runtime_error("Invalid paramater count - must be 1"); | ||
| 18 | m_regidx1 = parseRegister(params.front()); | ||
| 19 | params.pop_front(); | ||
| 20 | } | ||
| 21 | |||
| 22 | /*----------------------------------------------------------------------------*/ | ||
| 23 | |||
| 24 | void CInstructionInc::execute(CCPU *cpu) | ||
| 25 | { | ||
| 26 | assert(cpu != NULL); | ||
| 27 | assert(cpu->getRegisters() != NULL); | ||
| 28 | checkRegister(cpu, m_regidx1); | ||
| 29 | cpu->getRegisters()[ m_regidx1 ]++; | ||
| 30 | } | ||
| 31 | |||
| 32 | /*============================================================================*/ | ||
| 33 | |||
| 34 | void CInstructionDec::compile(std::list<std::string>& params) | ||
| 35 | { | ||
| 36 | if (params.size() != 1) | ||
| 37 | throw runtime_error("Invalid paramater count - must be 1"); | ||
| 38 | m_regidx1 = parseRegister(params.front()); | ||
| 39 | params.pop_front(); | ||
| 40 | } | ||
| 41 | |||
| 42 | /*----------------------------------------------------------------------------*/ | ||
| 43 | |||
| 44 | void CInstructionDec::execute(CCPU *cpu) | ||
| 45 | { | ||
| 46 | assert(cpu != NULL); | ||
| 47 | assert(cpu->getRegisters() != NULL); | ||
| 48 | checkRegister(cpu, m_regidx1); | ||
| 49 | cpu->getRegisters()[ m_regidx1 ]--; | ||
| 50 | } | ||
| 51 | |||
| 52 | /*============================================================================*/ | ||
| 53 | |||
| 54 | void CInstructionAdd::compile(std::list<std::string>& params) | ||
| 55 | { | ||
| 56 | if (params.size() != 3) | ||
| 57 | throw runtime_error("Invalid paramater count - must be 3"); | ||
| 58 | m_regidx1 = parseRegister(params.front()); | ||
| 59 | params.pop_front(); | ||
| 60 | m_regidx2 = parseRegister(params.front()); | ||
| 61 | params.pop_front(); | ||
| 62 | m_regidx3 = parseRegister(params.front()); | ||
| 63 | params.pop_front(); | ||
| 64 | } | ||
| 65 | |||
| 66 | /*----------------------------------------------------------------------------*/ | ||
| 67 | |||
| 68 | void CInstructionAdd::execute(CCPU *cpu) | ||
| 69 | { | ||
| 70 | assert(cpu != NULL); | ||
| 71 | assert(cpu->getRegisters() != NULL); | ||
| 72 | checkRegister(cpu, m_regidx1); | ||
| 73 | checkRegister(cpu, m_regidx2); | ||
| 74 | checkRegister(cpu, m_regidx3); | ||
| 75 | cpu->getRegisters()[ m_regidx1 ] = cpu->getRegisters()[ m_regidx2 ] | ||
| 76 | + cpu->getRegisters()[ m_regidx3 ]; | ||
| 77 | } | ||
| 78 | |||
| 79 | /*============================================================================*/ | ||
| 80 | |||
| 81 | void CInstructionSub::compile(std::list<std::string>& params) | ||
| 82 | { | ||
| 83 | if (params.size() != 3) | ||
| 84 | throw runtime_error("Invalid paramater count - must be 3"); | ||
| 85 | m_regidx1 = parseRegister(params.front()); | ||
| 86 | params.pop_front(); | ||
| 87 | m_regidx2 = parseRegister(params.front()); | ||
| 88 | params.pop_front(); | ||
| 89 | m_regidx3 = parseRegister(params.front()); | ||
| 90 | params.pop_front(); | ||
| 91 | } | ||
| 92 | |||
| 93 | /*----------------------------------------------------------------------------*/ | ||
| 94 | |||
| 95 | void CInstructionSub::execute(CCPU *cpu) | ||
| 96 | { | ||
| 97 | assert(cpu != NULL); | ||
| 98 | assert(cpu->getRegisters() != NULL); | ||
| 99 | checkRegister(cpu, m_regidx1); | ||
| 100 | checkRegister(cpu, m_regidx2); | ||
| 101 | checkRegister(cpu, m_regidx3); | ||
| 102 | cpu->getRegisters()[ m_regidx1 ] = cpu->getRegisters()[ m_regidx2 ] | ||
| 103 | - cpu->getRegisters()[ m_regidx3 ]; | ||
| 104 | } | ||
| 105 | |||
| 106 | /*============================================================================*/ | ||
| 107 | |||
| 108 | void CInstructionMul::compile(std::list<std::string>& params) | ||
| 109 | { | ||
| 110 | if (params.size() != 3) | ||
| 111 | throw runtime_error("Invalid paramater count - must be 3"); | ||
| 112 | m_regidx1 = parseRegister(params.front()); | ||
| 113 | params.pop_front(); | ||
| 114 | m_regidx2 = parseRegister(params.front()); | ||
| 115 | params.pop_front(); | ||
| 116 | m_regidx3 = parseRegister(params.front()); | ||
| 117 | params.pop_front(); | ||
| 118 | } | ||
| 119 | |||
| 120 | /*----------------------------------------------------------------------------*/ | ||
| 121 | |||
| 122 | void CInstructionMul::execute(CCPU *cpu) | ||
| 123 | { | ||
| 124 | checkRegister(cpu, m_regidx1); | ||
| 125 | checkRegister(cpu, m_regidx2); | ||
| 126 | checkRegister(cpu, m_regidx3); | ||
| 127 | cpu->getRegisters()[ m_regidx1 ] = cpu->getRegisters()[ m_regidx2 ] | ||
| 128 | * cpu->getRegisters()[ m_regidx3 ]; | ||
| 129 | } | ||
| 130 | |||
| 131 | /*============================================================================*/ | ||
| 132 | |||
| 133 | void CInstructionDiv::compile(std::list<std::string>& params) | ||
| 134 | { | ||
| 135 | if (params.size() != 3) | ||
| 136 | throw runtime_error("Invalid paramater count - must be 3"); | ||
| 137 | m_regidx1 = parseRegister(params.front()); | ||
| 138 | params.pop_front(); | ||
| 139 | m_regidx2 = parseRegister(params.front()); | ||
| 140 | params.pop_front(); | ||
| 141 | m_regidx3 = parseRegister(params.front()); | ||
| 142 | params.pop_front(); | ||
| 143 | } | ||
| 144 | |||
| 145 | /*----------------------------------------------------------------------------*/ | ||
| 146 | |||
| 147 | void CInstructionDiv::execute(CCPU *cpu) | ||
| 148 | { | ||
| 149 | assert(cpu != NULL); | ||
| 150 | assert(cpu->getRegisters() != NULL); | ||
| 151 | checkRegister(cpu, m_regidx1); | ||
| 152 | checkRegister(cpu, m_regidx2); | ||
| 153 | checkRegister(cpu, m_regidx3); | ||
| 154 | cpu->getRegisters()[ m_regidx1 ] = cpu->getRegisters()[ m_regidx2 ] | ||
| 155 | / cpu->getRegisters()[ m_regidx3 ]; | ||
| 156 | } | ||
| 157 | |||
| 158 | /*============================================================================*/ | ||
| 159 | |||
| 160 | void CInstructionLoad::compile(std::list<std::string>& params) | ||
| 161 | { | ||
| 162 | if (params.size() != 2) | ||
| 163 | throw runtime_error("Invalid paramater count - must be 2"); | ||
| 164 | m_regidx1 = parseRegister(params.front()); | ||
| 165 | params.pop_front(); | ||
| 166 | m_regidx2 = parseRegister(params.front()); | ||
| 167 | params.pop_front(); | ||
| 168 | } | ||
| 169 | |||
| 170 | /*----------------------------------------------------------------------------*/ | ||
| 171 | |||
| 172 | void CInstructionLoad::execute(CCPU *cpu) | ||
| 173 | { | ||
| 174 | assert(cpu != NULL); | ||
| 175 | assert(cpu->getRegisters() != NULL); | ||
| 176 | assert(cpu->getMemory() != NULL); | ||
| 177 | checkRegister(cpu, m_regidx1); | ||
| 178 | checkRegister(cpu, m_regidx2); | ||
| 179 | CDat val(cpu->getRegisters()[ m_regidx2 ]); | ||
| 180 | cpu->getRegisters()[ m_regidx1 ] = (*cpu->getMemory())[ val ]; | ||
| 181 | } | ||
| 182 | |||
| 183 | /*============================================================================*/ | ||
| 184 | |||
| 185 | void CInstructionStore::compile(std::list<std::string>& params) | ||
| 186 | { | ||
| 187 | if (params.size() != 2) | ||
| 188 | throw runtime_error("Invalid paramater count - must be 2"); | ||
| 189 | m_regidx1 = parseRegister(params.front()); | ||
| 190 | params.pop_front(); | ||
| 191 | m_regidx2 = parseRegister(params.front()); | ||
| 192 | params.pop_front(); | ||
| 193 | } | ||
| 194 | |||
| 195 | /*----------------------------------------------------------------------------*/ | ||
| 196 | |||
| 197 | void CInstructionStore::execute(CCPU *cpu) | ||
| 198 | { | ||
| 199 | assert(cpu != NULL); | ||
| 200 | assert(cpu->getRegisters() != NULL); | ||
| 201 | assert(cpu->getMemory() != NULL); | ||
| 202 | checkRegister(cpu, m_regidx1); | ||
| 203 | checkRegister(cpu, m_regidx2); | ||
| 204 | CDat val(cpu->getRegisters()[ m_regidx2 ]); | ||
| 205 | (*cpu->getMemory())[ val ] = cpu->getRegisters()[ m_regidx1 ]; | ||
| 206 | } | ||
| 207 | |||
| 208 | /*============================================================================*/ | ||
| 209 | |||
| 210 | void CInstructionTest::compile(std::list<std::string>& params) | ||
| 211 | { | ||
| 212 | if (params.size() != 1) | ||
| 213 | throw runtime_error("Invalid paramater count - must be 1"); | ||
| 214 | m_regidx1 = parseRegister(params.front()); | ||
| 215 | params.pop_front(); | ||
| 216 | } | ||
| 217 | |||
| 218 | /*----------------------------------------------------------------------------*/ | ||
| 219 | |||
| 220 | void CInstructionTest::execute(CCPU *cpu) | ||
| 221 | { | ||
| 222 | assert(cpu != NULL); | ||
| 223 | assert(cpu->getRegisters() != NULL); | ||
| 224 | checkRegister(cpu, m_regidx1); | ||
| 225 | if (cpu->getRegisters()[ m_regidx1 ] == CDat(0)) | ||
| 226 | cpu->setFlagZero(true); | ||
| 227 | if (cpu->getRegisters()[ m_regidx1 ] < CDat(0)) | ||
| 228 | cpu->setFlagSign(true); | ||
| 229 | } | ||
| 230 | |||
| 231 | /*============================================================================*/ | ||
| 232 | |||
| 233 | void CInstructionJumpA::compile(std::list<std::string>& params) | ||
| 234 | { | ||
| 235 | if (params.size() != 1) | ||
| 236 | throw runtime_error("Invalid paramater count - must be 1"); | ||
| 237 | m_addr = params.front(); | ||
| 238 | params.pop_front(); | ||
| 239 | } | ||
| 240 | |||
| 241 | /*----------------------------------------------------------------------------*/ | ||
| 242 | |||
| 243 | void CInstructionJumpA::execute(CCPU *cpu) | ||
| 244 | { | ||
| 245 | assert(cpu != NULL); | ||
| 246 | assert(cpu->getRegisters() != NULL); | ||
| 247 | assert(cpu->getProgram() != NULL); | ||
| 248 | if (m_addr.empty()) | ||
| 249 | throw runtime_error("Empty address"); | ||
| 250 | cpu->getRegisters()[ 0 ] = cpu->getProgram()->findLabel(m_addr); | ||
| 251 | } | ||
| 252 | |||
| 253 | /*============================================================================*/ | ||
| 254 | |||
| 255 | void CInstructionJumpZ::compile(std::list<std::string>& params) | ||
| 256 | { | ||
| 257 | if (params.size() != 1) | ||
| 258 | throw runtime_error("Invalid paramater count - must be 1"); | ||
| 259 | m_addr = params.front(); | ||
| 260 | params.pop_front(); | ||
| 261 | } | ||
| 262 | |||
| 263 | /*----------------------------------------------------------------------------*/ | ||
| 264 | |||
| 265 | void CInstructionJumpZ::execute(CCPU *cpu) | ||
| 266 | { | ||
| 267 | assert(cpu != NULL); | ||
| 268 | assert(cpu->getRegisters() != NULL); | ||
| 269 | assert(cpu->getProgram() != NULL); | ||
| 270 | if (!cpu->getFlagZero()) | ||
| 271 | return; | ||
| 272 | if (m_addr.empty()) | ||
| 273 | throw runtime_error("Empty address"); | ||
| 274 | cpu->getRegisters()[ 0 ] = cpu->getProgram()->findLabel(m_addr); | ||
| 275 | } | ||
| 276 | |||
| 277 | /*============================================================================*/ | ||
| 278 | |||
| 279 | void CInstructionJumpS::compile(std::list<std::string>& params) | ||
| 280 | { | ||
| 281 | if (params.size() != 1) | ||
| 282 | throw runtime_error("Invalid paramater count - must be 1"); | ||
| 283 | m_addr = params.front(); | ||
| 284 | params.pop_front(); | ||
| 285 | } | ||
| 286 | |||
| 287 | /*----------------------------------------------------------------------------*/ | ||
| 288 | |||
| 289 | void CInstructionJumpS::execute(CCPU *cpu) | ||
| 290 | { | ||
| 291 | assert(cpu != NULL); | ||
| 292 | assert(cpu->getRegisters() != NULL); | ||
| 293 | assert(cpu->getProgram() != NULL); | ||
| 294 | if (!cpu->getFlagSign()) | ||
| 295 | return; | ||
| 296 | if (m_addr.empty()) | ||
| 297 | throw runtime_error("Empty address"); | ||
| 298 | cpu->getRegisters()[ 0 ] = cpu->getProgram()->findLabel(m_addr); | ||
| 299 | } | ||
| 300 | |||
| 301 | /*============================================================================*/ | ||
| 302 | |||
| 303 | void CInstructionWrite::compile(std::list<std::string>& params) | ||
| 304 | { | ||
| 305 | if (params.size() != 2) | ||
| 306 | throw runtime_error("Invalid paramater count - must be 2"); | ||
| 307 | m_dev = params.front(); | ||
| 308 | params.pop_front(); | ||
| 309 | m_regidx1 = parseRegister(params.front()); | ||
| 310 | params.pop_front(); | ||
| 311 | } | ||
| 312 | |||
| 313 | /*----------------------------------------------------------------------------*/ | ||
| 314 | |||
| 315 | void CInstructionWrite::execute(CCPU *cpu) | ||
| 316 | { | ||
| 317 | assert(cpu != NULL); | ||
| 318 | assert(cpu->getRegisters() != NULL); | ||
| 319 | checkRegister(cpu, m_regidx1); | ||
| 320 | if (m_dev.empty()) | ||
| 321 | throw runtime_error("Empty device"); | ||
| 322 | |||
| 323 | CDisplay *display = NULL; | ||
| 324 | std::set<CDisplay *> displays = cpu->getDisplays(); | ||
| 325 | std::set<CDisplay *>::iterator it; | ||
| 326 | for(it = displays.begin(); it != displays.end(); ++it) | ||
| 327 | { | ||
| 328 | if ((*it)->getName() == m_dev) | ||
| 329 | { | ||
| 330 | display = *it; | ||
| 331 | break; | ||
| 332 | } | ||
| 333 | } | ||
| 334 | if (display == NULL) | ||
| 335 | throw runtime_error("Unknown display"); | ||
| 336 | |||
| 337 | display->display(cpu->getRegisters()[ m_regidx1 ]); | ||
| 338 | } | ||
| 339 | |||
| 340 | |||
| 341 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/instructions.h b/ue4/mycpu/instructions.h new file mode 100644 index 0000000..4c36562 --- /dev/null +++ b/ue4/mycpu/instructions.h | |||
| @@ -0,0 +1,454 @@ | |||
| 1 | /** | ||
| 2 | * @module instructions | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief Implementations of CInstruction | ||
| 5 | * @date 10.05.2009 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef INSTRUCTIONS_H | ||
| 9 | #define INSTRUCTIONS_H 1 | ||
| 10 | |||
| 11 | #include "cinstruction.h" | ||
| 12 | #include "ccpu.h" | ||
| 13 | |||
| 14 | /** | ||
| 15 | * @class CInstructionInc | ||
| 16 | * | ||
| 17 | * Implementation of assembler command "inc" | ||
| 18 | * Syntax: inc R1 | ||
| 19 | * (R1++) | ||
| 20 | */ | ||
| 21 | class CInstructionInc | ||
| 22 | : public CInstruction | ||
| 23 | { | ||
| 24 | public: | ||
| 25 | CInstructionInc() | ||
| 26 | : CInstruction("inc") | ||
| 27 | {} | ||
| 28 | |||
| 29 | CInstructionInc *factory() | ||
| 30 | { | ||
| 31 | return new CInstructionInc; | ||
| 32 | } | ||
| 33 | |||
| 34 | void compile(std::list<std::string>& params); | ||
| 35 | void execute(CCPU *cpu); | ||
| 36 | |||
| 37 | protected: | ||
| 38 | /** register number */ | ||
| 39 | unsigned m_regidx1; | ||
| 40 | }; | ||
| 41 | |||
| 42 | /*============================================================================*/ | ||
| 43 | |||
| 44 | /** | ||
| 45 | * @class CInstructionDec | ||
| 46 | * | ||
| 47 | * Implementation of assembler command "dec" | ||
| 48 | * Syntax: dec R1 | ||
| 49 | * (R1--) | ||
| 50 | */ | ||
| 51 | class CInstructionDec | ||
| 52 | : public CInstruction | ||
| 53 | { | ||
| 54 | public: | ||
| 55 | CInstructionDec() | ||
| 56 | : CInstruction("dec") | ||
| 57 | {} | ||
| 58 | |||
| 59 | CInstructionDec *factory() | ||
| 60 | { | ||
| 61 | return new CInstructionDec; | ||
| 62 | } | ||
| 63 | |||
| 64 | void compile(std::list<std::string>& params); | ||
| 65 | void execute(CCPU *cpu); | ||
| 66 | |||
| 67 | protected: | ||
| 68 | /** register number */ | ||
| 69 | unsigned m_regidx1; | ||
| 70 | }; | ||
| 71 | |||
| 72 | /*============================================================================*/ | ||
| 73 | |||
| 74 | /** | ||
| 75 | * @class CInstructionAdd | ||
| 76 | * | ||
| 77 | * Implementation of assembler command "add" | ||
| 78 | * Syntax: add R1, R2, R3 | ||
| 79 | * (R1 = R2 + R3) | ||
| 80 | */ | ||
| 81 | class CInstructionAdd | ||
| 82 | : public CInstruction | ||
| 83 | { | ||
| 84 | public: | ||
| 85 | CInstructionAdd() | ||
| 86 | : CInstruction("add") | ||
| 87 | {} | ||
| 88 | |||
| 89 | CInstructionAdd *factory() | ||
| 90 | { | ||
| 91 | return new CInstructionAdd; | ||
| 92 | } | ||
| 93 | |||
| 94 | void compile(std::list<std::string>& params); | ||
| 95 | void execute(CCPU *cpu); | ||
| 96 | |||
| 97 | protected: | ||
| 98 | /** register number */ | ||
| 99 | unsigned m_regidx1; | ||
| 100 | /** register number */ | ||
| 101 | unsigned m_regidx2; | ||
| 102 | /** register number */ | ||
| 103 | unsigned m_regidx3; | ||
| 104 | }; | ||
| 105 | |||
| 106 | /*============================================================================*/ | ||
| 107 | |||
| 108 | /** | ||
| 109 | * @class CInstructionSub | ||
| 110 | * | ||
| 111 | * Implementation of assembler command "sub" | ||
| 112 | * Syntax: sub R1, R2, R3 | ||
| 113 | * (R1 = R2 - R3) | ||
| 114 | */ | ||
| 115 | class CInstructionSub | ||
| 116 | : public CInstruction | ||
| 117 | { | ||
| 118 | public: | ||
| 119 | CInstructionSub() | ||
| 120 | : CInstruction("sub") | ||
| 121 | {} | ||
| 122 | |||
| 123 | CInstructionSub *factory() | ||
| 124 | { | ||
| 125 | return new CInstructionSub; | ||
| 126 | } | ||
| 127 | |||
| 128 | void compile(std::list<std::string>& params); | ||
| 129 | void execute(CCPU *cpu); | ||
| 130 | |||
| 131 | protected: | ||
| 132 | /** register number */ | ||
| 133 | unsigned m_regidx1; | ||
| 134 | /** register number */ | ||
| 135 | unsigned m_regidx2; | ||
| 136 | /** register number */ | ||
| 137 | unsigned m_regidx3; | ||
| 138 | }; | ||
| 139 | |||
| 140 | /*============================================================================*/ | ||
| 141 | |||
| 142 | /** | ||
| 143 | * @class CInstructionMul | ||
| 144 | * | ||
| 145 | * Implementation of assembler command "mul" | ||
| 146 | * Syntax: mul R1, R2, R3 | ||
| 147 | * (R1 = R2 * R3) | ||
| 148 | */ | ||
| 149 | class CInstructionMul | ||
| 150 | : public CInstruction | ||
| 151 | { | ||
| 152 | public: | ||
| 153 | CInstructionMul() | ||
| 154 | : CInstruction("mul") | ||
| 155 | {} | ||
| 156 | |||
| 157 | CInstructionMul *factory() | ||
| 158 | { | ||
| 159 | return new CInstructionMul; | ||
| 160 | } | ||
| 161 | |||
| 162 | void compile(std::list<std::string>& params); | ||
| 163 | void execute(CCPU *cpu); | ||
| 164 | |||
| 165 | protected: | ||
| 166 | /** register number */ | ||
| 167 | unsigned m_regidx1; | ||
| 168 | /** register number */ | ||
| 169 | unsigned m_regidx2; | ||
| 170 | /** register number */ | ||
| 171 | unsigned m_regidx3; | ||
| 172 | }; | ||
| 173 | |||
| 174 | /*============================================================================*/ | ||
| 175 | |||
| 176 | /** | ||
| 177 | * @class CInstructionDiv | ||
| 178 | * | ||
| 179 | * Implementation of assembler command "div" | ||
| 180 | * Syntax: div R1, R2, R3 | ||
| 181 | * (R1 = R2 / R3) | ||
| 182 | */ | ||
| 183 | class CInstructionDiv | ||
| 184 | : public CInstruction | ||
| 185 | { | ||
| 186 | public: | ||
| 187 | CInstructionDiv() | ||
| 188 | : CInstruction("div") | ||
| 189 | {} | ||
| 190 | |||
| 191 | CInstructionDiv *factory() | ||
| 192 | { | ||
| 193 | return new CInstructionDiv; | ||
| 194 | } | ||
| 195 | |||
| 196 | void compile(std::list<std::string>& params); | ||
| 197 | void execute(CCPU *cpu); | ||
| 198 | |||
| 199 | protected: | ||
| 200 | /** register number */ | ||
| 201 | unsigned m_regidx1; | ||
| 202 | /** register number */ | ||
| 203 | unsigned m_regidx2; | ||
| 204 | /** register number */ | ||
| 205 | unsigned m_regidx3; | ||
| 206 | }; | ||
| 207 | |||
| 208 | /*============================================================================*/ | ||
| 209 | |||
| 210 | /** | ||
| 211 | * @class CInstructionLoad | ||
| 212 | * | ||
| 213 | * Implementation of assembler command "load" | ||
| 214 | * Syntax: load R1, R2 | ||
| 215 | * (R1 = memory[R2]) | ||
| 216 | */ | ||
| 217 | class CInstructionLoad | ||
| 218 | : public CInstruction | ||
| 219 | { | ||
| 220 | public: | ||
| 221 | CInstructionLoad() | ||
| 222 | : CInstruction("load") | ||
| 223 | {} | ||
| 224 | |||
| 225 | CInstructionLoad *factory() | ||
| 226 | { | ||
| 227 | return new CInstructionLoad; | ||
| 228 | } | ||
| 229 | |||
| 230 | void compile(std::list<std::string>& params); | ||
| 231 | void execute(CCPU *cpu); | ||
| 232 | |||
| 233 | protected: | ||
| 234 | /** register number */ | ||
| 235 | unsigned m_regidx1; | ||
| 236 | /** register number */ | ||
| 237 | unsigned m_regidx2; | ||
| 238 | }; | ||
| 239 | |||
| 240 | /*============================================================================*/ | ||
| 241 | |||
| 242 | /** | ||
| 243 | * @class CInstructionStore | ||
| 244 | * | ||
| 245 | * Implementation of assembler command "store" | ||
| 246 | * Syntax: store R1, R2 | ||
| 247 | * (memory[R2] = R1) | ||
| 248 | */ | ||
| 249 | class CInstructionStore | ||
| 250 | : public CInstruction | ||
| 251 | { | ||
| 252 | public: | ||
| 253 | CInstructionStore() | ||
| 254 | : CInstruction("store") | ||
| 255 | {} | ||
| 256 | |||
| 257 | CInstructionStore *factory() | ||
| 258 | { | ||
| 259 | return new CInstructionStore; | ||
| 260 | } | ||
| 261 | |||
| 262 | void compile(std::list<std::string>& params); | ||
| 263 | void execute(CCPU *cpu); | ||
| 264 | |||
| 265 | protected: | ||
| 266 | /** register number */ | ||
| 267 | unsigned m_regidx1; | ||
| 268 | /** register number */ | ||
| 269 | unsigned m_regidx2; | ||
| 270 | }; | ||
| 271 | |||
| 272 | /*============================================================================*/ | ||
| 273 | |||
| 274 | /** | ||
| 275 | * @class CInstructionTest | ||
| 276 | * | ||
| 277 | * Implementation of assembler command "test" | ||
| 278 | * Syntax: test R1 | ||
| 279 | * (R1 == 0: zeroflag: true, R1 < 0: signflag: true) | ||
| 280 | */ | ||
| 281 | class CInstructionTest | ||
| 282 | : public CInstruction | ||
| 283 | { | ||
| 284 | public: | ||
| 285 | CInstructionTest() | ||
| 286 | : CInstruction("test") | ||
| 287 | {} | ||
| 288 | |||
| 289 | CInstructionTest *factory() | ||
| 290 | { | ||
| 291 | return new CInstructionTest; | ||
| 292 | } | ||
| 293 | |||
| 294 | void compile(std::list<std::string>& params); | ||
| 295 | void execute(CCPU *cpu); | ||
| 296 | |||
| 297 | protected: | ||
| 298 | /** register number */ | ||
| 299 | unsigned m_regidx1; | ||
| 300 | }; | ||
| 301 | |||
| 302 | /*============================================================================*/ | ||
| 303 | |||
| 304 | /** | ||
| 305 | * @class CInstructionLabel | ||
| 306 | * | ||
| 307 | * Implementation of assembler command "label" | ||
| 308 | * Syntax: label name: | ||
| 309 | */ | ||
| 310 | class CInstructionLabel | ||
| 311 | : public CInstruction | ||
| 312 | { | ||
| 313 | public: | ||
| 314 | CInstructionLabel() | ||
| 315 | : CInstruction("label") | ||
| 316 | {} | ||
| 317 | |||
| 318 | CInstructionLabel *factory() | ||
| 319 | { | ||
| 320 | return new CInstructionLabel; | ||
| 321 | } | ||
| 322 | |||
| 323 | void compile(std::list<std::string>& params) | ||
| 324 | {} | ||
| 325 | |||
| 326 | void execute(CCPU *cpu) | ||
| 327 | {} | ||
| 328 | }; | ||
| 329 | |||
| 330 | /*============================================================================*/ | ||
| 331 | |||
| 332 | /** | ||
| 333 | * @class CInstructionJumpA | ||
| 334 | * | ||
| 335 | * Implementation of assembler command "jumpa" | ||
| 336 | * Syntax: jumpa labelname | ||
| 337 | * (jump to labelname) | ||
| 338 | */ | ||
| 339 | class CInstructionJumpA | ||
| 340 | : public CInstruction | ||
| 341 | { | ||
| 342 | public: | ||
| 343 | CInstructionJumpA() | ||
| 344 | : CInstruction("jumpa"), m_addr("") | ||
| 345 | {} | ||
| 346 | |||
| 347 | CInstructionJumpA *factory() | ||
| 348 | { | ||
| 349 | return new CInstructionJumpA; | ||
| 350 | } | ||
| 351 | |||
| 352 | void compile(std::list<std::string>& params); | ||
| 353 | void execute(CCPU *cpu); | ||
| 354 | |||
| 355 | protected: | ||
| 356 | /** labelname */ | ||
| 357 | std::string m_addr; | ||
| 358 | }; | ||
| 359 | |||
| 360 | /*============================================================================*/ | ||
| 361 | |||
| 362 | /** | ||
| 363 | * @class CInstructionJumpZ | ||
| 364 | * | ||
| 365 | * Implementation of assembler command "jumpz" | ||
| 366 | * Syntax: jumpz labelname | ||
| 367 | * (jump to labelname if zeroflag) | ||
| 368 | */ | ||
| 369 | class CInstructionJumpZ | ||
| 370 | : public CInstruction | ||
| 371 | { | ||
| 372 | public: | ||
| 373 | CInstructionJumpZ() | ||
| 374 | : CInstruction("jumpz"), m_addr("") | ||
| 375 | {} | ||
| 376 | |||
| 377 | CInstructionJumpZ *factory() | ||
| 378 | { | ||
| 379 | return new CInstructionJumpZ; | ||
| 380 | } | ||
| 381 | |||
| 382 | void compile(std::list<std::string>& params); | ||
| 383 | void execute(CCPU *cpu); | ||
| 384 | |||
| 385 | protected: | ||
| 386 | /** labelname */ | ||
| 387 | std::string m_addr; | ||
| 388 | }; | ||
| 389 | |||
| 390 | /*============================================================================*/ | ||
| 391 | |||
| 392 | /** | ||
| 393 | * @class CInstructionJumpS | ||
| 394 | * | ||
| 395 | * Implementation of assembler command "jumps" | ||
| 396 | * Syntax: jumps labelname | ||
| 397 | * (jump to labelname if signflag) | ||
| 398 | */ | ||
| 399 | class CInstructionJumpS | ||
| 400 | : public CInstruction | ||
| 401 | { | ||
| 402 | public: | ||
| 403 | CInstructionJumpS() | ||
| 404 | : CInstruction("jumps"), m_addr("") | ||
| 405 | {} | ||
| 406 | |||
| 407 | CInstructionJumpS *factory() | ||
| 408 | { | ||
| 409 | return new CInstructionJumpS; | ||
| 410 | } | ||
| 411 | |||
| 412 | void compile(std::list<std::string>& params); | ||
| 413 | void execute(CCPU *cpu); | ||
| 414 | |||
| 415 | protected: | ||
| 416 | /** labelname */ | ||
| 417 | std::string m_addr; | ||
| 418 | }; | ||
| 419 | |||
| 420 | /*============================================================================*/ | ||
| 421 | |||
| 422 | /** | ||
| 423 | * @class CInstructionWrite | ||
| 424 | * | ||
| 425 | * Implementation of assembler command "write" | ||
| 426 | * Syntax: write DEV, R1 | ||
| 427 | * (write R1 to DEV, which is a name of a display) | ||
| 428 | */ | ||
| 429 | class CInstructionWrite | ||
| 430 | : public CInstruction | ||
| 431 | { | ||
| 432 | public: | ||
| 433 | CInstructionWrite() | ||
| 434 | : CInstruction("write"), m_dev("") | ||
| 435 | {} | ||
| 436 | |||
| 437 | CInstructionWrite *factory() | ||
| 438 | { | ||
| 439 | return new CInstructionWrite; | ||
| 440 | } | ||
| 441 | |||
| 442 | void compile(std::list<std::string>& params); | ||
| 443 | void execute(CCPU *cpu); | ||
| 444 | |||
| 445 | protected: | ||
| 446 | /** register number */ | ||
| 447 | unsigned m_regidx1; | ||
| 448 | /** device name */ | ||
| 449 | std::string m_dev; | ||
| 450 | }; | ||
| 451 | |||
| 452 | #endif | ||
| 453 | |||
| 454 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/mycpu.cpp b/ue4/mycpu/mycpu.cpp new file mode 100644 index 0000000..b25e721 --- /dev/null +++ b/ue4/mycpu/mycpu.cpp | |||
| @@ -0,0 +1,155 @@ | |||
| 1 | /** | ||
| 2 | * @module mycpu | ||
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 4 | * @brief mycpu executes a programfile (in simple assembler) by parsing the | ||
| 5 | * programfile first. This creates a vector of instructions, which will | ||
| 6 | * be executed in linear order (except jumps) afterwards. In order to | ||
| 7 | * initialize the memory of the cpu before execution an optional | ||
| 8 | * memoryfile can be passed as commandline option. | ||
| 9 | * @date 13.05.2009 | ||
| 10 | * @par Exercise | ||
| 11 | * 4 | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <boost/program_options.hpp> | ||
| 15 | #include <iostream> | ||
| 16 | #include <fstream> | ||
| 17 | #include <stdexcept> | ||
| 18 | #include <stdlib.h> | ||
| 19 | #include "ccpu.h" | ||
| 20 | #include "cmem.h" | ||
| 21 | #include "cprogram.h" | ||
| 22 | |||
| 23 | using namespace std; | ||
| 24 | namespace po = boost::program_options; | ||
| 25 | |||
| 26 | /** | ||
| 27 | * @func main | ||
| 28 | * @brief program entry point | ||
| 29 | * @param argc standard parameter of main | ||
| 30 | * @param argv standard parameter of main | ||
| 31 | * @return 0 on success, not 0 otherwise | ||
| 32 | * @globalvars none | ||
| 33 | * @exception none | ||
| 34 | * @conditions none | ||
| 35 | * | ||
| 36 | * parse commandline options, create and initialize memory, | ||
| 37 | * create cprogram instance, which parses the programfile and | ||
| 38 | * execute CCPU::run() | ||
| 39 | * On error print error message to stderr. | ||
| 40 | * Unknown commandline options will print a usage message. | ||
| 41 | */ | ||
| 42 | int main(int argc, char* argv[]) | ||
| 43 | { | ||
| 44 | string me(argv[0]); | ||
| 45 | |||
| 46 | /* define commandline options */ | ||
| 47 | po::options_description desc("Allowed options"); | ||
| 48 | desc.add_options() | ||
| 49 | ("help,h", "this help message") | ||
| 50 | ("compile,c", po::value<string>(), "input programfile") | ||
| 51 | ("memory,m", po::value<string>(), "input memoryfile"); | ||
| 52 | |||
| 53 | /* parse commandline options */ | ||
| 54 | po::variables_map vm; | ||
| 55 | try | ||
| 56 | { | ||
| 57 | po::store(po::parse_command_line(argc, argv, desc), vm); | ||
| 58 | po::notify(vm); | ||
| 59 | } | ||
| 60 | catch(po::error& ex) | ||
| 61 | { | ||
| 62 | cerr << me << ": Error: " << ex.what() << endl; | ||
| 63 | } | ||
| 64 | |||
| 65 | /* print usage upon request or missing params */ | ||
| 66 | if (vm.count("help") || !vm.count("compile")) | ||
| 67 | { | ||
| 68 | cout << "Usage: " << me << " -c <programfile> [-m <memoryfile>]" << endl; | ||
| 69 | cout << desc << endl; | ||
| 70 | return 0; | ||
| 71 | } | ||
| 72 | |||
| 73 | /* create memory and optionally initialize memory from file */ | ||
| 74 | CMem memory; | ||
| 75 | if (vm.count("memory")) | ||
| 76 | { | ||
| 77 | string memoryfile(vm["memory"].as<string>()); | ||
| 78 | ifstream file(memoryfile.c_str(), ios::in); | ||
| 79 | if (!file.is_open()) | ||
| 80 | { | ||
| 81 | cerr << me << ": Unable to open memoryfile '" << memoryfile << "' for reading." << endl; | ||
| 82 | return 1; | ||
| 83 | } | ||
| 84 | |||
| 85 | try | ||
| 86 | { | ||
| 87 | memory.initialize(file); | ||
| 88 | file.close(); | ||
| 89 | } | ||
| 90 | catch(runtime_error& ex) | ||
| 91 | { | ||
| 92 | file.close(); | ||
| 93 | cerr << me << ": Error while reading from memoryfile:" << endl | ||
| 94 | << " " << ex.what() << endl; | ||
| 95 | return 1; | ||
| 96 | } | ||
| 97 | |||
| 98 | #if DEBUG | ||
| 99 | memory.dump(cerr); | ||
| 100 | #endif | ||
| 101 | } | ||
| 102 | |||
| 103 | /* create program instance */ | ||
| 104 | CProgram program; | ||
| 105 | string programfile(vm["compile"].as<string>()); | ||
| 106 | ifstream file(programfile.c_str(), ios::in); | ||
| 107 | if (!file.is_open()) | ||
| 108 | { | ||
| 109 | cerr << me << ": Unable to open programfile '" << programfile << "' for reading." << endl; | ||
| 110 | return 1; | ||
| 111 | } | ||
| 112 | |||
| 113 | try | ||
| 114 | { | ||
| 115 | program.compile(file); | ||
| 116 | file.close(); | ||
| 117 | } | ||
| 118 | catch(runtime_error& ex) | ||
| 119 | { | ||
| 120 | file.close(); | ||
| 121 | cerr << me << ": Error while compiling programfile:" << endl | ||
| 122 | << " " << ex.what() << endl; | ||
| 123 | return 1; | ||
| 124 | } | ||
| 125 | |||
| 126 | #if DEBUG | ||
| 127 | program.dump(cerr); | ||
| 128 | #endif | ||
| 129 | |||
| 130 | |||
| 131 | /* create cpu and execute the program */ | ||
| 132 | try | ||
| 133 | { | ||
| 134 | CCPU cpu(256); | ||
| 135 | cpu.setMemory(&memory); | ||
| 136 | cpu.setProgram(&program); | ||
| 137 | cpu.run(); | ||
| 138 | #if DEBUG | ||
| 139 | //cpu.dumpRegisters(cerr); | ||
| 140 | #endif | ||
| 141 | } | ||
| 142 | catch(runtime_error& ex) | ||
| 143 | { | ||
| 144 | cerr << me << ": Error while executing program:" << endl | ||
| 145 | << " " << ex.what() << endl; | ||
| 146 | #if DEBUG | ||
| 147 | memory.dump(cerr); | ||
| 148 | #endif | ||
| 149 | return 1; | ||
| 150 | } | ||
| 151 | |||
| 152 | return 0; | ||
| 153 | } | ||
| 154 | |||
| 155 | /* vim: set et sw=2 ts=2: */ | ||
diff --git a/ue4/mycpu/test/test.sh b/ue4/mycpu/test/test.sh new file mode 100755 index 0000000..ff1076c --- /dev/null +++ b/ue4/mycpu/test/test.sh | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | binary="./mycpu" | ||
| 4 | tmpfile="test/tmpfile" | ||
| 5 | inputs=( $(ls test/* | grep _program | sort -n) ) | ||
| 6 | |||
| 7 | for input in ${inputs[@]} | ||
| 8 | do | ||
| 9 | echo "Testing $input ..." | ||
| 10 | |||
| 11 | programfile="$input" | ||
| 12 | args="-c $programfile" | ||
| 13 | memoryfile="${input/_program/_memory}" | ||
| 14 | reffile="${input/_program/_output}" | ||
| 15 | if [ -e "$memoryfile" ] | ||
| 16 | then | ||
| 17 | args+=" -m $memoryfile" | ||
| 18 | fi | ||
| 19 | |||
| 20 | if [ ! -e "$reffile" ] | ||
| 21 | then | ||
| 22 | echo " ERROR: reference file $reffile doesn't exist" | ||
| 23 | exit 1 | ||
| 24 | fi | ||
| 25 | |||
| 26 | rm -rf "$tmpfile" | ||
| 27 | echo " Executing $binary $args ..." | ||
| 28 | $binary $args > $tmpfile | ||
| 29 | |||
| 30 | md5_1=$(md5sum < "$reffile") | ||
| 31 | md5_2=$(md5sum < "$tmpfile") | ||
| 32 | if [ "$md5_1" != "$md5_2" ] | ||
| 33 | then | ||
| 34 | echo " ERROR: output and $reffile differ" | ||
| 35 | diff -Naur "$reffile" "$tmpfile" | ||
| 36 | rm -rf "$tmpfile" | ||
| 37 | exit 1 | ||
| 38 | else | ||
| 39 | echo " SUCCESS" | ||
| 40 | fi | ||
| 41 | rm -rf "$tmpfile" | ||
| 42 | done | ||
diff --git a/ue4/mycpu/test/test1_memory b/ue4/mycpu/test/test1_memory new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/ue4/mycpu/test/test1_memory | |||
| @@ -0,0 +1 @@ | |||
| 20 | |||
diff --git a/ue4/mycpu/test/test1_output b/ue4/mycpu/test/test1_output new file mode 100644 index 0000000..ac30dc2 --- /dev/null +++ b/ue4/mycpu/test/test1_output | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
diff --git a/ue4/mycpu/test/test1_program b/ue4/mycpu/test/test1_program new file mode 100644 index 0000000..ae5e9d2 --- /dev/null +++ b/ue4/mycpu/test/test1_program | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # set R2 = 10 | ||
| 2 | LOAD R2, R1 | ||
| 3 | |||
| 4 | # start of loop | ||
| 5 | label Loop: | ||
| 6 | inc R3 | ||
| 7 | sub R4, R3, R2 | ||
| 8 | test R4 | ||
| 9 | jumpz EndLoop | ||
| 10 | write WDEZ, R3 | ||
| 11 | jumpa Loop | ||
| 12 | |||
| 13 | label EndLoop: | ||
diff --git a/ue4/protokoll.pdf b/ue4/protokoll.pdf new file mode 100644 index 0000000..b7a0097 --- /dev/null +++ b/ue4/protokoll.pdf | |||
| Binary files differ | |||
diff --git a/ue4/protokoll/Makefile b/ue4/protokoll/Makefile new file mode 100644 index 0000000..3acf895 --- /dev/null +++ b/ue4/protokoll/Makefile | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | # Makefile for protokoll | ||
| 2 | # Author: Guenther Neuwirth (0626638), Manuel Mausz (0728348) | ||
| 3 | # Created: 26.04.2009 | ||
| 4 | |||
| 5 | TEXFILE= protokoll.tex | ||
| 6 | PDFFILE= $(shell echo $(TEXFILE) | sed -e 's/\.tex$$/\.pdf/') | ||
| 7 | PDFLATEX= pdflatex | ||
| 8 | TMPDIR= tmp | ||
| 9 | |||
| 10 | all: tex | ||
| 11 | |||
| 12 | tex: | ||
| 13 | @echo $(PDFFILE)" lala" | ||
| 14 | @mkdir -p $(TMPDIR) | ||
| 15 | @$(PDFLATEX) -interaction=nonstopmode -output-directory=$(TMPDIR) $(TEXFILE) | ||
| 16 | @$(PDFLATEX) -interaction=nonstopmode -output-directory=$(TMPDIR) $(TEXFILE) | ||
| 17 | @cp $(TMPDIR)/$(PDFFILE) ../ | ||
| 18 | @rm -rf $(TMPDIR) | ||
| 19 | |||
| 20 | # vim600: noet sw=8 ts=8 | ||
diff --git a/ue4/protokoll/fancyheadings.sty b/ue4/protokoll/fancyheadings.sty new file mode 100644 index 0000000..c1e706e --- /dev/null +++ b/ue4/protokoll/fancyheadings.sty | |||
| @@ -0,0 +1,166 @@ | |||
| 1 | % fancyheadings.sty version 1.94 | ||
| 2 | % Fancy headers and footers. | ||
| 3 | % Piet van Oostrum, Dept of Computer Science, University of Utrecht | ||
| 4 | % Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands | ||
| 5 | % Telephone: +31 30 2531806. Email: piet@cs.ruu.nl | ||
| 6 | % Sep 16, 1994 | ||
| 7 | % version 1.4: Correction for use with \reversemargin | ||
| 8 | % Sep 29, 1994: | ||
| 9 | % version 1.5: Added the \iftopfloat, \ifbotfloat and \iffloatpage commands | ||
| 10 | % Oct 4, 1994: | ||
| 11 | % version 1.6: Reset single spacing in headers/footers for use with | ||
| 12 | % setspace.sty or doublespace.sty | ||
| 13 | % Oct 4, 1994: | ||
| 14 | % version 1.7: changed \let\@mkboth\markboth to | ||
| 15 | % \def\@mkboth{\protect\markboth} to make it more robust | ||
| 16 | % Dec 5, 1994: | ||
| 17 | % version 1.8: corrections for amsbook/amsart: define \@chapapp and (more | ||
| 18 | % importantly) use the \chapter/sectionmark definitions from ps@headings if | ||
| 19 | % they exist (which should be true for all standard classes). | ||
| 20 | % May 31, 1995: | ||
| 21 | % version 1.9: The proposed \renewcommand{\headrulewidth}{\iffloatpage... | ||
| 22 | % construction in the doc did not work properly with the fancyplain style. | ||
| 23 | % June 1, 1995: | ||
| 24 | % version 1.91: The definition of \@mkboth wasn't restored on subsequent | ||
| 25 | % \pagestyle{fancy}'s. | ||
| 26 | % June 1, 1995: | ||
| 27 | % version 1.92: The sequence \pagestyle{fancyplain} \pagestyle{plain} | ||
| 28 | % \pagestyle{fancy} would erroneously select the plain version. | ||
| 29 | % June 1, 1995: | ||
| 30 | % version 1.93: \fancypagestyle command added. | ||
| 31 | % Dec 11, 1995: | ||
| 32 | % version 1.94: suggested by Conrad Hughes <chughes@maths.tcd.ie> | ||
| 33 | % CJCH, Dec 11, 1995: added \footruleskip to allow control over footrule | ||
| 34 | % position (old hardcoded value of .3\normalbaselineskip is far too high | ||
| 35 | % when used with very small footer fonts). | ||
| 36 | % Jan 31, 1996: | ||
| 37 | % version 1.95: call \@normalsize in the reset code if that is defined, | ||
| 38 | % otherwise \normalsize. | ||
| 39 | % this is to solve a problem with ucthesis.cls, as this doesn't | ||
| 40 | % define \@currsize. Unfortunately for latex209 calling \normalsize doesn't | ||
| 41 | % work as this is optimized to do very little, so there \@normalsize should | ||
| 42 | % be called. Hopefully this code works for all versions of LaTeX known to | ||
| 43 | % mankind. | ||
| 44 | |||
| 45 | \let\fancy@def\gdef | ||
| 46 | \def\lhead{\@ifnextchar[{\@xlhead}{\@ylhead}} | ||
| 47 | \def\@xlhead[#1]#2{\fancy@def\@elhead{#1}\fancy@def\@olhead{#2}} | ||
| 48 | \def\@ylhead#1{\fancy@def\@elhead{#1}\fancy@def\@olhead{#1}} | ||
| 49 | |||
| 50 | \def\chead{\@ifnextchar[{\@xchead}{\@ychead}} | ||
| 51 | \def\@xchead[#1]#2{\fancy@def\@echead{#1}\fancy@def\@ochead{#2}} | ||
| 52 | \def\@ychead#1{\fancy@def\@echead{#1}\fancy@def\@ochead{#1}} | ||
| 53 | |||
| 54 | \def\rhead{\@ifnextchar[{\@xrhead}{\@yrhead}} | ||
| 55 | \def\@xrhead[#1]#2{\fancy@def\@erhead{#1}\fancy@def\@orhead{#2}} | ||
| 56 | \def\@yrhead#1{\fancy@def\@erhead{#1}\fancy@def\@orhead{#1}} | ||
| 57 | |||
| 58 | \def\lfoot{\@ifnextchar[{\@xlfoot}{\@ylfoot}} | ||
| 59 | \def\@xlfoot[#1]#2{\fancy@def\@elfoot{#1}\fancy@def\@olfoot{#2}} | ||
| 60 | \def\@ylfoot#1{\fancy@def\@elfoot{#1}\fancy@def\@olfoot{#1}} | ||
| 61 | |||
| 62 | \def\cfoot{\@ifnextchar[{\@xcfoot}{\@ycfoot}} | ||
| 63 | \def\@xcfoot[#1]#2{\fancy@def\@ecfoot{#1}\fancy@def\@ocfoot{#2}} | ||
| 64 | \def\@ycfoot#1{\fancy@def\@ecfoot{#1}\fancy@def\@ocfoot{#1}} | ||
| 65 | |||
| 66 | \def\rfoot{\@ifnextchar[{\@xrfoot}{\@yrfoot}} | ||
| 67 | \def\@xrfoot[#1]#2{\fancy@def\@erfoot{#1}\fancy@def\@orfoot{#2}} | ||
| 68 | \def\@yrfoot#1{\fancy@def\@erfoot{#1}\fancy@def\@orfoot{#1}} | ||
| 69 | |||
| 70 | \newdimen\headrulewidth | ||
| 71 | \newdimen\footrulewidth | ||
| 72 | \newdimen\plainheadrulewidth | ||
| 73 | \newdimen\plainfootrulewidth | ||
| 74 | \newdimen\headwidth | ||
| 75 | \newdimen\footruleskip | ||
| 76 | \newif\if@fancyplain \@fancyplainfalse | ||
| 77 | \def\fancyplain#1#2{\if@fancyplain#1\else#2\fi} | ||
| 78 | |||
| 79 | % Command to reset various things in the headers: | ||
| 80 | % a.o. single spacing (taken from setspace.sty) | ||
| 81 | % and the catcode of ^^M (so that epsf files in the header work if a | ||
| 82 | % verbatim crosses a page boundary) | ||
| 83 | \def\fancy@reset{\restorecr | ||
| 84 | \def\baselinestretch{1}% | ||
| 85 | \ifx\undefined\@newbaseline% NFSS not present; 2.09 or 2e | ||
| 86 | \ifx\@normalsize\undefined \normalsize % for ucthesis.cls | ||
| 87 | \else \@normalsize \fi | ||
| 88 | \else% NFSS (2.09) present | ||
| 89 | \@newbaseline% | ||
| 90 | \fi} | ||
| 91 | |||
| 92 | % Initialization of the head and foot text. | ||
| 93 | |||
| 94 | \headrulewidth 0.4pt | ||
| 95 | \footrulewidth\z@ | ||
| 96 | \plainheadrulewidth\z@ | ||
| 97 | \plainfootrulewidth\z@ | ||
| 98 | \footruleskip .3\normalbaselineskip | ||
| 99 | |||
| 100 | \lhead[\fancyplain{}{\sl\rightmark}]{\fancyplain{}{\sl\leftmark}} | ||
| 101 | % i.e. empty on ``plain'' pages, \rightmark on even, \leftmark on odd pages | ||
| 102 | \chead{} | ||
| 103 | \rhead[\fancyplain{}{\sl\leftmark}]{\fancyplain{}{\sl\rightmark}} | ||
| 104 | % i.e. empty on ``plain'' pages, \leftmark on even, \rightmark on odd pages | ||
| 105 | \lfoot{} | ||
| 106 | \cfoot{\rm\thepage} % page number | ||
| 107 | \rfoot{} | ||
| 108 | |||
| 109 | % Put together a header or footer given the left, center and | ||
| 110 | % right text, fillers at left and right and a rule. | ||
| 111 | % The \lap commands put the text into an hbox of zero size, | ||
| 112 | % so overlapping text does not generate an errormessage. | ||
| 113 | |||
| 114 | \def\@fancyhead#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset\vbox{\hbox | ||
| 115 | {\rlap{\parbox[b]{\headwidth}{\raggedright#2\strut}}\hfill | ||
| 116 | \parbox[b]{\headwidth}{\centering#3\strut}\hfill | ||
| 117 | \llap{\parbox[b]{\headwidth}{\raggedleft#4\strut}}}\headrule}}#5} | ||
| 118 | |||
| 119 | |||
| 120 | \def\@fancyfoot#1#2#3#4#5{#1\hbox to\headwidth{\fancy@reset\vbox{\footrule | ||
| 121 | \hbox{\rlap{\parbox[t]{\headwidth}{\raggedright#2\strut}}\hfill | ||
| 122 | \parbox[t]{\headwidth}{\centering#3\strut}\hfill | ||
| 123 | \llap{\parbox[t]{\headwidth}{\raggedleft#4\strut}}}}}#5} | ||
| 124 | |||
| 125 | \def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi | ||
| 126 | \hrule\@height\headrulewidth\@width\headwidth \vskip-\headrulewidth}} | ||
| 127 | |||
| 128 | \def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi | ||
| 129 | \vskip-\footruleskip\vskip-\footrulewidth | ||
| 130 | \hrule\@width\headwidth\@height\footrulewidth\vskip\footruleskip}} | ||
| 131 | |||
| 132 | \def\ps@fancy{% | ||
| 133 | \@ifundefined{@chapapp}{\let\@chapapp\chaptername}{}%for amsbook | ||
| 134 | \@ifundefined{chapter}{\def\sectionmark##1{\markboth | ||
| 135 | {\uppercase{\ifnum \c@secnumdepth>\z@ | ||
| 136 | \thesection\hskip 1em\relax \fi ##1}}{}}% | ||
| 137 | \def\subsectionmark##1{\markright {\ifnum \c@secnumdepth >\@ne | ||
| 138 | \thesubsection\hskip 1em\relax \fi ##1}}}% | ||
| 139 | {\def\chaptermark##1{\markboth {\uppercase{\ifnum \c@secnumdepth>\m@ne | ||
| 140 | \@chapapp\ \thechapter. \ \fi ##1}}{}} | ||
| 141 | \def\sectionmark##1{\markright{\uppercase{\ifnum \c@secnumdepth >\z@ | ||
| 142 | \thesection. \ \fi ##1}}}}% | ||
| 143 | \csname ps@headings\endcsname % use \ps@headings defaults if they exist | ||
| 144 | \ps@@fancy | ||
| 145 | \gdef\ps@fancy{\@fancyplainfalse\ps@@fancy}% | ||
| 146 | \headwidth\textwidth} | ||
| 147 | \def\ps@fancyplain{\ps@fancy \let\ps@plain\ps@plain@fancy} | ||
| 148 | \def\ps@plain@fancy{\@fancyplaintrue\ps@@fancy} | ||
| 149 | \def\ps@@fancy{% | ||
| 150 | \def\@mkboth{\protect\markboth}% | ||
| 151 | \def\@oddhead{\@fancyhead\@lodd\@olhead\@ochead\@orhead\@rodd}% | ||
| 152 | \def\@oddfoot{\@fancyfoot\@lodd\@olfoot\@ocfoot\@orfoot\@rodd}% | ||
| 153 | \def\@evenhead{\@fancyhead\@rodd\@elhead\@echead\@erhead\@lodd}% | ||
| 154 | \def\@evenfoot{\@fancyfoot\@rodd\@elfoot\@ecfoot\@erfoot\@lodd}% | ||
| 155 | } | ||
| 156 | \def\@lodd{\if@reversemargin\hss\else\relax\fi} | ||
| 157 | \def\@rodd{\if@reversemargin\relax\else\hss\fi} | ||
| 158 | |||
| 159 | \let\latex@makecol\@makecol | ||
| 160 | \def\@makecol{\let\topfloat\@toplist\let\botfloat\@botlist\latex@makecol} | ||
| 161 | \def\iftopfloat#1#2{\ifx\topfloat\empty #2\else #1\fi} | ||
| 162 | \def\ifbotfloat#1#2{\ifx\botfloat\empty #2\else #1\fi} | ||
| 163 | \def\iffloatpage#1#2{\if@fcolmade #1\else #2\fi} | ||
| 164 | |||
| 165 | \newcommand{\fancypagestyle}[2]{% | ||
| 166 | \@namedef{ps@#1}{\let\fancy@def\def#2\relax\ps@fancy}} | ||
diff --git a/ue4/protokoll/oop_prot.sty b/ue4/protokoll/oop_prot.sty new file mode 100644 index 0000000..26a66e6 --- /dev/null +++ b/ue4/protokoll/oop_prot.sty | |||
| @@ -0,0 +1,222 @@ | |||
| 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 2 | % | ||
| 3 | % OOP_prot.sty | ||
| 4 | % | ||
| 5 | % | ||
| 6 | % 13.03.07 | ||
| 7 | % | ||
| 8 | % Institut f"ur Technische Informatik (182/1) | ||
| 9 | % Real Time Systems Group | ||
| 10 | % Technische Universit"at Wien | ||
| 11 | % 1040 Treitlstr. 3, 3. Stk. | ||
| 12 | % (www.vmars.tuwien.ac.at) | ||
| 13 | % | ||
| 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 15 | |||
| 16 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 17 | % | ||
| 18 | % packages | ||
| 19 | % | ||
| 20 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 21 | |||
| 22 | \usepackage{fancyheadings} | ||
| 23 | \usepackage{german} | ||
| 24 | \usepackage{graphicx} | ||
| 25 | \usepackage{listings} | ||
| 26 | \usepackage[T1]{fontenc} | ||
| 27 | %\usepackage[latin1]{inputenc} | ||
| 28 | \usepackage{times} | ||
| 29 | \usepackage{epsfig} | ||
| 30 | |||
| 31 | %in order to get the source code in a really good shape | ||
| 32 | \lstset{%backgroundcolor=\color[gray]{.9}, | ||
| 33 | extendedchars=true, | ||
| 34 | basicstyle=\scriptsize, | ||
| 35 | % frame={tb}, | ||
| 36 | % morekeywords={outp,inp,bit_is_clear,bit_is_set,sei,cli,sbi,cbi,INTERRUPT,SIGNAL,uint8,uint16_t,uint32_t,uint64_t,int8_t,int16_t,int32_t,int64_t,memptr}, | ||
| 37 | language=C++, | ||
| 38 | breaklines=true, | ||
| 39 | % lineskip=2pt, | ||
| 40 | % numbers=left, | ||
| 41 | % stepnumber=5, | ||
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 46 | % | ||
| 47 | % user-defined commands | ||
| 48 | % | ||
| 49 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 50 | |||
| 51 | % typeset pin numbers | ||
| 52 | \newcommand{\pin}[1]{\emph{\textbf{#1}}\ } | ||
| 53 | %\renewcommand{\chaptername}{Aufgabe} | ||
| 54 | |||
| 55 | \newcommand{\matrnr}{Matr. Nr.} | ||
| 56 | |||
| 57 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 58 | % | ||
| 59 | % some size definitions and counter settings | ||
| 60 | % | ||
| 61 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 62 | |||
| 63 | \oddsidemargin 1cm | ||
| 64 | \evensidemargin 1cm | ||
| 65 | \topmargin 0pt | ||
| 66 | \headsep 50pt | ||
| 67 | \textheight 21.5cm | ||
| 68 | \textwidth 14.1cm | ||
| 69 | |||
| 70 | \renewcommand{\floatpagefraction}{0.9} | ||
| 71 | \renewcommand{\textfraction}{0.05} | ||
| 72 | \renewcommand{\topfraction}{1.0} | ||
| 73 | \renewcommand{\bottomfraction}{1.0} | ||
| 74 | |||
| 75 | \setcounter{totalnumber}{3} | ||
| 76 | \setcounter{bottomnumber}{3} | ||
| 77 | \setcounter{topnumber}{3} | ||
| 78 | |||
| 79 | \setlength{\unitlength}{1mm} | ||
| 80 | \setlength{\parindent}{6mm} | ||
| 81 | \setlength{\parskip}{12pt plus2pt minus2pt} | ||
| 82 | |||
| 83 | \sloppy | ||
| 84 | |||
| 85 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 86 | % | ||
| 87 | % define variables used on titlepage | ||
| 88 | % | ||
| 89 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 90 | |||
| 91 | % heading | ||
| 92 | \def\headline#1{\gdef\@headline{#1}} | ||
| 93 | % authors | ||
| 94 | \def\vornamea#1{\gdef\@vornamea{#1}} | ||
| 95 | \def\nachnamea#1{\gdef\@nachnamea{#1}} | ||
| 96 | \def\matrikela#1{\gdef\@matrikela{#1}} | ||
| 97 | \def\emaila#1{\gdef\@emaila{#1}} | ||
| 98 | |||
| 99 | \def\vornameb#1{\gdef\@vornameb{#1}} | ||
| 100 | \def\nachnameb#1{\gdef\@nachnameb{#1}} | ||
| 101 | \def\matrikelb#1{\gdef\@matrikelb{#1}} | ||
| 102 | \def\emailb#1{\gdef\@emailb{#1}} | ||
| 103 | |||
| 104 | \def\vornamec#1{\gdef\@vornamec{#1}} | ||
| 105 | \def\nachnamec#1{\gdef\@nachnamec{#1}} | ||
| 106 | \def\matrikelc#1{\gdef\@matrikelc{#1}} | ||
| 107 | \def\emailc#1{\gdef\@emailc{#1}} | ||
| 108 | |||
| 109 | \def\vornamed#1{\gdef\@vornamed{#1}} | ||
| 110 | \def\nachnamed#1{\gdef\@nachnamed{#1}} | ||
| 111 | \def\matrikeld#1{\gdef\@matrikeld{#1}} | ||
| 112 | \def\emaild#1{\gdef\@emaild{#1}} | ||
| 113 | |||
| 114 | % address of department | ||
| 115 | \def\address#1{\gdef\@address{#1}} | ||
| 116 | % LVA-Nr. | ||
| 117 | \def\lvanr#1{\gdef\@aufgabe{#1}} | ||
| 118 | |||
| 119 | \setcounter{footnote}{0} | ||
| 120 | |||
| 121 | % initialize variables | ||
| 122 | \gdef\@headline{Object-Oriented Programming VL} | ||
| 123 | %\gdef\@title{Laborprotokoll} | ||
| 124 | |||
| 125 | \gdef\@vornamea{VStud1} | ||
| 126 | \gdef\@nachnamea{NStud1} | ||
| 127 | \gdef\@matrikela{000000} | ||
| 128 | \gdef\@emaila{e000000@student.tuwien.ac.at} | ||
| 129 | |||
| 130 | \gdef\@vornameb{VStud2} | ||
| 131 | \gdef\@nachnameb{NStud2} | ||
| 132 | \gdef\@matrikelb{000000} | ||
| 133 | \gdef\@emailb{e000000@student.tuwien.ac.at} | ||
| 134 | |||
| 135 | \gdef\@vornamec{VStud3} | ||
| 136 | \gdef\@nachnamec{NStud3} | ||
| 137 | \gdef\@matrikelc{0000000} | ||
| 138 | \gdef\@emailc{e000000@student.tuwien.ac.at} | ||
| 139 | |||
| 140 | \gdef\@aufgabe{zu Aufgabe 1} | ||
| 141 | |||
| 142 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 143 | % | ||
| 144 | % titlepage | ||
| 145 | % | ||
| 146 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 147 | |||
| 148 | \def\maketitle{ | ||
| 149 | \begin{titlepage} | ||
| 150 | |||
| 151 | % enlarge page | ||
| 152 | \setlength{\topmargin}{0pt} | ||
| 153 | \setlength{\headheight}{0pt} | ||
| 154 | \setlength{\headsep}{0pt} | ||
| 155 | \setlength{\footskip}{0pt} | ||
| 156 | |||
| 157 | \let\footnotesize\small \let\footnoterule\relax \setcounter{page}{1} | ||
| 158 | \null | ||
| 159 | \vfill | ||
| 160 | \large | ||
| 161 | \vskip -4 cm | ||
| 162 | |||
| 163 | \begin{center} | ||
| 164 | % heading | ||
| 165 | {\LARGE\bf \@headline \par} \vskip 2cm | ||
| 166 | |||
| 167 | \vskip 1cm | ||
| 168 | |||
| 169 | % title | ||
| 170 | {\LARGE\bf Laborprotokoll \par} | ||
| 171 | \vskip 0.5cm | ||
| 172 | {\Huge\bf \@title \par} | ||
| 173 | \vskip 1cm | ||
| 174 | %{\Large \bf \@aufgabe \par} | ||
| 175 | \vskip 4cm | ||
| 176 | |||
| 177 | \begin{flushright} | ||
| 178 | \@author | ||
| 179 | \vskip 1cm | ||
| 180 | Wien, am~\today{} | ||
| 181 | \end{flushright} | ||
| 182 | \end{center} \par | ||
| 183 | \vskip 1.5cm | ||
| 184 | |||
| 185 | \end{titlepage} | ||
| 186 | |||
| 187 | \setcounter{footnote}{0} | ||
| 188 | \let\thanks\relax | ||
| 189 | } % \def\maketitle | ||
| 190 | |||
| 191 | |||
| 192 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 193 | |||
| 194 | \newenvironment{Ventry}[1]% | ||
| 195 | {\begin{list}{}{\renewcommand{\makelabel}[1]{\textbf{##1:}\hfill}% | ||
| 196 | \settowidth{\labelwidth}{\textbf{#1:}}% | ||
| 197 | \setlength{\leftmargin}{\labelwidth}% | ||
| 198 | \addtolength{\leftmargin}{\labelsep}}}% | ||
| 199 | {\end{list}} | ||
| 200 | |||
| 201 | \newcommand{\tablesize}{\fontsize{8}{10}\selectfont} | ||
| 202 | |||
| 203 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 204 | % | ||
| 205 | % layout of non-title pages | ||
| 206 | % | ||
| 207 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 208 | |||
| 209 | \pagenumbering{roman} | ||
| 210 | \setlength{\parskip}{5pt plus2pt minus2pt} | ||
| 211 | |||
| 212 | \setlength{\parskip}{1mm} | ||
| 213 | \clearpage | ||
| 214 | \setlength{\parskip}{5pt plus2pt minus2pt} | ||
| 215 | |||
| 216 | \pagestyle{fancy} | ||
| 217 | %\renewcommand{\chaptermark}[1]{\markboth{\thechapter\ #1}{}} | ||
| 218 | \renewcommand{\sectionmark}[1]{\markboth{\thesection\ #1}{}} | ||
| 219 | \addtolength{\headheight}{2pt} | ||
| 220 | |||
| 221 | \pagenumbering{arabic} | ||
| 222 | \setcounter{page} {1} | ||
diff --git a/ue4/protokoll/protokoll.tex b/ue4/protokoll/protokoll.tex new file mode 100644 index 0000000..3db10b0 --- /dev/null +++ b/ue4/protokoll/protokoll.tex | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | \documentclass[12pt,a4paper,titlepage,oneside]{article} | ||
| 2 | \usepackage[utf8]{inputenc} | ||
| 3 | \usepackage{oop_prot} | ||
| 4 | \usepackage{url} | ||
| 5 | \usepackage{pdfpages} | ||
| 6 | \usepackage{booktabs} | ||
| 7 | |||
| 8 | \title{Beispiel 4} | ||
| 9 | |||
| 10 | \author{ | ||
| 11 | Günther Neuwirth, \matrnr 0626638\\ | ||
| 12 | {\small e0626638@student.tuwien.ac.at}\\ | ||
| 13 | Manuel Mausz, \matrnr 0728348\\ | ||
| 14 | {\small manuel-tu@mausz.at}\\ | ||
| 15 | } | ||
| 16 | |||
| 17 | \begin{document} | ||
| 18 | |||
| 19 | % create titlepage | ||
| 20 | \maketitle | ||
| 21 | \tableofcontents | ||
| 22 | \newpage | ||
| 23 | |||
| 24 | %------------------------------------------------------------------ | ||
| 25 | %------------------------------------------------------------------ | ||
| 26 | |||
| 27 | \section{Aufgabenstellung - Beispiel 4} | ||
| 28 | \includegraphics[width=\textwidth,page=1]{../angabe.pdf} | ||
| 29 | \includegraphics[width=\textwidth,page=2]{../angabe.pdf} | ||
| 30 | |||
| 31 | %------------------------------------------------------------------ | ||
| 32 | %------------------------------------------------------------------ | ||
| 33 | |||
| 34 | \section{Beispiel 4} | ||
| 35 | |||
| 36 | \subsection{Design}\label{Design} | ||
| 37 | |||
| 38 | Abbildung~\ref{fig:classdiagram1} zeigt das Klassendiagramm der Aufgabe. | ||
| 39 | |||
| 40 | TODO | ||
| 41 | |||
| 42 | %================================================================== | ||
| 43 | \begin{center} | ||
| 44 | \begin{figure}[htb] | ||
| 45 | \epsfxsize=1.6\textwidth\epsfbox{mycpu.png} | ||
| 46 | \caption{Klassendiagramm 1} | ||
| 47 | \label{fig:classdiagram1} | ||
| 48 | \end{figure} | ||
| 49 | \end{center} | ||
| 50 | %================================================================== | ||
| 51 | |||
| 52 | \subsection{Verwaltung der Ressourcen} | ||
| 53 | |||
| 54 | TODO | ||
| 55 | |||
| 56 | \subsection{Fehlerbehandlung} | ||
| 57 | |||
| 58 | TODO | ||
| 59 | |||
| 60 | \subsection{Implementierung} | ||
| 61 | |||
| 62 | TODO | ||
| 63 | |||
| 64 | \section{Projektverlauf} | ||
| 65 | |||
| 66 | \subsection{Probleme und Fallstricke} | ||
| 67 | |||
| 68 | TODO | ||
| 69 | |||
| 70 | \subsection{Arbeitsaufwand} | ||
| 71 | |||
| 72 | \begin{tabular}{ll} | ||
| 73 | \toprule | ||
| 74 | Entwicklungsschritt / Meilenstein & Arbeitsaufwand\\ | ||
| 75 | \midrule | ||
| 76 | TODO & TODO\\ | ||
| 77 | \hline | ||
| 78 | TODO & TODO\\ | ||
| 79 | \bottomrule | ||
| 80 | \end{tabular} | ||
| 81 | |||
| 82 | %------------------------------------------------------------------ | ||
| 83 | %------------------------------------------------------------------ | ||
| 84 | |||
| 85 | \newpage | ||
| 86 | \section{Listings}\label{Listings} | ||
| 87 | |||
| 88 | \subsection{mycpu.cpp} | ||
| 89 | \lstinputlisting{../mycpu/mycpu.cpp} | ||
| 90 | |||
| 91 | \end{document} | ||
| 92 | |||
