├── .gitignore ├── Doxyfile ├── Makefile ├── README.txt ├── functions.c ├── functions.h ├── keywords.h ├── verilog-parser ├── verilog-parser.c └── verilog ├── c17.v └── code /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Libraries 12 | *.lib 13 | *.a 14 | *.la 15 | *.lo 16 | 17 | # Shared objects (inc. Windows DLLs) 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | 23 | # Executables 24 | *.exe 25 | *.out 26 | *.app 27 | *.i*86 28 | *.x86_64 29 | *.hex 30 | 31 | # Debug files 32 | *.dSYM/ 33 | *.su 34 | 35 | # Others 36 | *.orig 37 | doc/ 38 | astyle 39 | -------------------------------------------------------------------------------- /Doxyfile: -------------------------------------------------------------------------------- 1 | # Doxyfile 1.6.1 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 18 | # that follow. The default is UTF-8 which is also the encoding used for all 19 | # text before the first occurrence of this tag. Doxygen uses libiconv (or the 20 | # iconv built into libc) for the transcoding. See 21 | # http://www.gnu.org/software/libiconv for the list of 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 = "Verilog parser" 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 = doc 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, Esperanto, Farsi, Finnish, French, German, 58 | # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 59 | # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 60 | # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, 61 | # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. 62 | 63 | OUTPUT_LANGUAGE = English 64 | 65 | # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 66 | # include brief member descriptions after the members that are listed in 67 | # the file and class documentation (similar to JavaDoc). 68 | # Set to NO to disable this. 69 | 70 | BRIEF_MEMBER_DESC = YES 71 | 72 | # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 73 | # the brief description of a member or function before the detailed description. 74 | # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 75 | # brief descriptions will be completely suppressed. 76 | 77 | REPEAT_BRIEF = YES 78 | 79 | # This tag implements a quasi-intelligent brief description abbreviator 80 | # that is used to form the text in various listings. Each string 81 | # in this list, if found as the leading text of the brief description, will be 82 | # stripped from the text and the result after processing the whole list, is 83 | # used as the annotated text. Otherwise, the brief description is used as-is. 84 | # If left blank, the following values are used ("$name" is automatically 85 | # replaced with the name of the entity): "The $name class" "The $name widget" 86 | # "The $name file" "is" "provides" "specifies" "contains" 87 | # "represents" "a" "an" "the" 88 | 89 | ABBREVIATE_BRIEF = 90 | 91 | # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 92 | # Doxygen will generate a detailed section even if there is only a brief 93 | # description. 94 | 95 | ALWAYS_DETAILED_SEC = NO 96 | 97 | # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 98 | # inherited members of a class in the documentation of that class as if those 99 | # members were ordinary class members. Constructors, destructors and assignment 100 | # operators of the base classes will not be shown. 101 | 102 | INLINE_INHERITED_MEMB = NO 103 | 104 | # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 105 | # path before files name in the file list and in the header files. If set 106 | # to NO the shortest path that makes the file name unique will be used. 107 | 108 | FULL_PATH_NAMES = YES 109 | 110 | # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 111 | # can be used to strip a user-defined part of the path. Stripping is 112 | # only done if one of the specified strings matches the left-hand part of 113 | # the path. The tag can be used to show relative paths in the file list. 114 | # If left blank the directory from which doxygen is run is used as the 115 | # path to strip. 116 | 117 | STRIP_FROM_PATH = 118 | 119 | # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 120 | # the path mentioned in the documentation of a class, which tells 121 | # the reader which header file to include in order to use a class. 122 | # If left blank only the name of the header file containing the class 123 | # definition is used. Otherwise one should specify the include paths that 124 | # are normally passed to the compiler using the -I flag. 125 | 126 | STRIP_FROM_INC_PATH = 127 | 128 | # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 129 | # (but less readable) file names. This can be useful is your file systems 130 | # doesn't support long names like on DOS, Mac, or CD-ROM. 131 | 132 | SHORT_NAMES = NO 133 | 134 | # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 135 | # will interpret the first line (until the first dot) of a JavaDoc-style 136 | # comment as the brief description. If set to NO, the JavaDoc 137 | # comments will behave just like regular Qt-style comments 138 | # (thus requiring an explicit @brief command for a brief description.) 139 | 140 | JAVADOC_AUTOBRIEF = NO 141 | 142 | # If the QT_AUTOBRIEF tag is set to YES then Doxygen will 143 | # interpret the first line (until the first dot) of a Qt-style 144 | # comment as the brief description. If set to NO, the comments 145 | # will behave just like regular Qt-style comments (thus requiring 146 | # an explicit \brief command for a brief description.) 147 | 148 | QT_AUTOBRIEF = NO 149 | 150 | # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 151 | # treat a multi-line C++ special comment block (i.e. a block of //! or /// 152 | # comments) as a brief description. This used to be the default behaviour. 153 | # The new default is to treat a multi-line C++ comment block as a detailed 154 | # description. Set this tag to YES if you prefer the old behaviour instead. 155 | 156 | MULTILINE_CPP_IS_BRIEF = NO 157 | 158 | # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 159 | # member inherits the documentation from any documented member that it 160 | # re-implements. 161 | 162 | INHERIT_DOCS = YES 163 | 164 | # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 165 | # a new page for each member. If set to NO, the documentation of a member will 166 | # be part of the file/class/namespace that contains it. 167 | 168 | SEPARATE_MEMBER_PAGES = NO 169 | 170 | # The TAB_SIZE tag can be used to set the number of spaces in a tab. 171 | # Doxygen uses this value to replace tabs by spaces in code fragments. 172 | 173 | TAB_SIZE = 8 174 | 175 | # This tag can be used to specify a number of aliases that acts 176 | # as commands in the documentation. An alias has the form "name=value". 177 | # For example adding "sideeffect=\par Side Effects:\n" will allow you to 178 | # put the command \sideeffect (or @sideeffect) in the documentation, which 179 | # will result in a user-defined paragraph with heading "Side Effects:". 180 | # You can put \n's in the value part of an alias to insert newlines. 181 | 182 | ALIASES = 183 | 184 | # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 185 | # sources only. Doxygen will then generate output that is more tailored for C. 186 | # For instance, some of the names that are used will be different. The list 187 | # of all members will be omitted, etc. 188 | 189 | OPTIMIZE_OUTPUT_FOR_C = NO 190 | 191 | # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 192 | # sources only. Doxygen will then generate output that is more tailored for 193 | # Java. For instance, namespaces will be presented as packages, qualified 194 | # scopes will look different, etc. 195 | 196 | OPTIMIZE_OUTPUT_JAVA = NO 197 | 198 | # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 199 | # sources only. Doxygen will then generate output that is more tailored for 200 | # Fortran. 201 | 202 | OPTIMIZE_FOR_FORTRAN = NO 203 | 204 | # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 205 | # sources. Doxygen will then generate output that is tailored for 206 | # VHDL. 207 | 208 | OPTIMIZE_OUTPUT_VHDL = NO 209 | 210 | # Doxygen selects the parser to use depending on the extension of the files it parses. 211 | # With this tag you can assign which parser to use for a given extension. 212 | # Doxygen has a built-in mapping, but you can override or extend it using this tag. 213 | # The format is ext=language, where ext is a file extension, and language is one of 214 | # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, 215 | # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat 216 | # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), 217 | # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. 218 | 219 | EXTENSION_MAPPING = 220 | 221 | # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 222 | # to include (a tag file for) the STL sources as input, then you should 223 | # set this tag to YES in order to let doxygen match functions declarations and 224 | # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 225 | # func(std::string) {}). This also make the inheritance and collaboration 226 | # diagrams that involve STL classes more complete and accurate. 227 | 228 | BUILTIN_STL_SUPPORT = NO 229 | 230 | # If you use Microsoft's C++/CLI language, you should set this option to YES to 231 | # enable parsing support. 232 | 233 | CPP_CLI_SUPPORT = NO 234 | 235 | # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 236 | # Doxygen will parse them like normal C++ but will assume all classes use public 237 | # instead of private inheritance when no explicit protection keyword is present. 238 | 239 | SIP_SUPPORT = NO 240 | 241 | # For Microsoft's IDL there are propget and propput attributes to indicate getter 242 | # and setter methods for a property. Setting this option to YES (the default) 243 | # will make doxygen to replace the get and set methods by a property in the 244 | # documentation. This will only work if the methods are indeed getting or 245 | # setting a simple type. If this is not the case, or you want to show the 246 | # methods anyway, you should set this option to NO. 247 | 248 | IDL_PROPERTY_SUPPORT = YES 249 | 250 | # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 251 | # tag is set to YES, then doxygen will reuse the documentation of the first 252 | # member in the group (if any) for the other members of the group. By default 253 | # all members of a group must be documented explicitly. 254 | 255 | DISTRIBUTE_GROUP_DOC = NO 256 | 257 | # Set the SUBGROUPING tag to YES (the default) to allow class member groups of 258 | # the same type (for instance a group of public functions) to be put as a 259 | # subgroup of that type (e.g. under the Public Functions section). Set it to 260 | # NO to prevent subgrouping. Alternatively, this can be done per class using 261 | # the \nosubgrouping command. 262 | 263 | SUBGROUPING = YES 264 | 265 | # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 266 | # is documented as struct, union, or enum with the name of the typedef. So 267 | # typedef struct TypeS {} TypeT, will appear in the documentation as a struct 268 | # with name TypeT. When disabled the typedef will appear as a member of a file, 269 | # namespace, or class. And the struct will be named TypeS. This can typically 270 | # be useful for C code in case the coding convention dictates that all compound 271 | # types are typedef'ed and only the typedef is referenced, never the tag name. 272 | 273 | TYPEDEF_HIDES_STRUCT = NO 274 | 275 | # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 276 | # determine which symbols to keep in memory and which to flush to disk. 277 | # When the cache is full, less often used symbols will be written to disk. 278 | # For small to medium size projects (<1000 input files) the default value is 279 | # probably good enough. For larger projects a too small cache size can cause 280 | # doxygen to be busy swapping symbols to and from disk most of the time 281 | # causing a significant performance penality. 282 | # If the system has enough physical memory increasing the cache will improve the 283 | # performance by keeping more symbols in memory. Note that the value works on 284 | # a logarithmic scale so increasing the size by one will rougly double the 285 | # memory usage. The cache size is given by this formula: 286 | # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 287 | # corresponding to a cache size of 2^16 = 65536 symbols 288 | 289 | SYMBOL_CACHE_SIZE = 0 290 | 291 | #--------------------------------------------------------------------------- 292 | # Build related configuration options 293 | #--------------------------------------------------------------------------- 294 | 295 | # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 296 | # documentation are documented, even if no documentation was available. 297 | # Private class members and static file members will be hidden unless 298 | # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES 299 | 300 | EXTRACT_ALL = NO 301 | 302 | # If the EXTRACT_PRIVATE tag is set to YES all private members of a class 303 | # will be included in the documentation. 304 | 305 | EXTRACT_PRIVATE = NO 306 | 307 | # If the EXTRACT_STATIC tag is set to YES all static members of a file 308 | # will be included in the documentation. 309 | 310 | EXTRACT_STATIC = NO 311 | 312 | # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 313 | # defined locally in source files will be included in the documentation. 314 | # If set to NO only classes defined in header files are included. 315 | 316 | EXTRACT_LOCAL_CLASSES = YES 317 | 318 | # This flag is only useful for Objective-C code. When set to YES local 319 | # methods, which are defined in the implementation section but not in 320 | # the interface are included in the documentation. 321 | # If set to NO (the default) only methods in the interface are included. 322 | 323 | EXTRACT_LOCAL_METHODS = NO 324 | 325 | # If this flag is set to YES, the members of anonymous namespaces will be 326 | # extracted and appear in the documentation as a namespace called 327 | # 'anonymous_namespace{file}', where file will be replaced with the base 328 | # name of the file that contains the anonymous namespace. By default 329 | # anonymous namespace are hidden. 330 | 331 | EXTRACT_ANON_NSPACES = NO 332 | 333 | # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 334 | # undocumented members of documented classes, files or namespaces. 335 | # If set to NO (the default) these members will be included in the 336 | # various overviews, but no documentation section is generated. 337 | # This option has no effect if EXTRACT_ALL is enabled. 338 | 339 | HIDE_UNDOC_MEMBERS = NO 340 | 341 | # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 342 | # undocumented classes that are normally visible in the class hierarchy. 343 | # If set to NO (the default) these classes will be included in the various 344 | # overviews. This option has no effect if EXTRACT_ALL is enabled. 345 | 346 | HIDE_UNDOC_CLASSES = NO 347 | 348 | # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 349 | # friend (class|struct|union) declarations. 350 | # If set to NO (the default) these declarations will be included in the 351 | # documentation. 352 | 353 | HIDE_FRIEND_COMPOUNDS = NO 354 | 355 | # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 356 | # documentation blocks found inside the body of a function. 357 | # If set to NO (the default) these blocks will be appended to the 358 | # function's detailed documentation block. 359 | 360 | HIDE_IN_BODY_DOCS = NO 361 | 362 | # The INTERNAL_DOCS tag determines if documentation 363 | # that is typed after a \internal command is included. If the tag is set 364 | # to NO (the default) then the documentation will be excluded. 365 | # Set it to YES to include the internal documentation. 366 | 367 | INTERNAL_DOCS = NO 368 | 369 | # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 370 | # file names in lower-case letters. If set to YES upper-case letters are also 371 | # allowed. This is useful if you have classes or files whose names only differ 372 | # in case and if your file system supports case sensitive file names. Windows 373 | # and Mac users are advised to set this option to NO. 374 | 375 | CASE_SENSE_NAMES = YES 376 | 377 | # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 378 | # will show members with their full class and namespace scopes in the 379 | # documentation. If set to YES the scope will be hidden. 380 | 381 | HIDE_SCOPE_NAMES = NO 382 | 383 | # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 384 | # will put a list of the files that are included by a file in the documentation 385 | # of that file. 386 | 387 | SHOW_INCLUDE_FILES = YES 388 | 389 | # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 390 | # is inserted in the documentation for inline members. 391 | 392 | INLINE_INFO = YES 393 | 394 | # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 395 | # will sort the (detailed) documentation of file and class members 396 | # alphabetically by member name. If set to NO the members will appear in 397 | # declaration order. 398 | 399 | SORT_MEMBER_DOCS = YES 400 | 401 | # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 402 | # brief documentation of file, namespace and class members alphabetically 403 | # by member name. If set to NO (the default) the members will appear in 404 | # declaration order. 405 | 406 | SORT_BRIEF_DOCS = NO 407 | 408 | # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. 409 | 410 | SORT_MEMBERS_CTORS_1ST = NO 411 | 412 | # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 413 | # hierarchy of group names into alphabetical order. If set to NO (the default) 414 | # the group names will appear in their defined order. 415 | 416 | SORT_GROUP_NAMES = NO 417 | 418 | # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 419 | # sorted by fully-qualified names, including namespaces. If set to 420 | # NO (the default), the class list will be sorted only by class name, 421 | # not including the namespace part. 422 | # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 423 | # Note: This option applies only to the class list, not to the 424 | # alphabetical list. 425 | 426 | SORT_BY_SCOPE_NAME = NO 427 | 428 | # The GENERATE_TODOLIST tag can be used to enable (YES) or 429 | # disable (NO) the todo list. This list is created by putting \todo 430 | # commands in the documentation. 431 | 432 | GENERATE_TODOLIST = YES 433 | 434 | # The GENERATE_TESTLIST tag can be used to enable (YES) or 435 | # disable (NO) the test list. This list is created by putting \test 436 | # commands in the documentation. 437 | 438 | GENERATE_TESTLIST = YES 439 | 440 | # The GENERATE_BUGLIST tag can be used to enable (YES) or 441 | # disable (NO) the bug list. This list is created by putting \bug 442 | # commands in the documentation. 443 | 444 | GENERATE_BUGLIST = YES 445 | 446 | # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 447 | # disable (NO) the deprecated list. This list is created by putting 448 | # \deprecated commands in the documentation. 449 | 450 | GENERATE_DEPRECATEDLIST= YES 451 | 452 | # The ENABLED_SECTIONS tag can be used to enable conditional 453 | # documentation sections, marked by \if sectionname ... \endif. 454 | 455 | ENABLED_SECTIONS = 456 | 457 | # The MAX_INITIALIZER_LINES tag determines the maximum number of lines 458 | # the initial value of a variable or define consists of for it to appear in 459 | # the documentation. If the initializer consists of more lines than specified 460 | # here it will be hidden. Use a value of 0 to hide initializers completely. 461 | # The appearance of the initializer of individual variables and defines in the 462 | # documentation can be controlled using \showinitializer or \hideinitializer 463 | # command in the documentation regardless of this setting. 464 | 465 | MAX_INITIALIZER_LINES = 30 466 | 467 | # Set the SHOW_USED_FILES tag to NO to disable the list of files generated 468 | # at the bottom of the documentation of classes and structs. If set to YES the 469 | # list will mention the files that were used to generate the documentation. 470 | 471 | SHOW_USED_FILES = YES 472 | 473 | # If the sources in your project are distributed over multiple directories 474 | # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 475 | # in the documentation. The default is NO. 476 | 477 | SHOW_DIRECTORIES = NO 478 | 479 | # Set the SHOW_FILES tag to NO to disable the generation of the Files page. 480 | # This will remove the Files entry from the Quick Index and from the 481 | # Folder Tree View (if specified). The default is YES. 482 | 483 | SHOW_FILES = YES 484 | 485 | # Set the SHOW_NAMESPACES tag to NO to disable the generation of the 486 | # Namespaces page. 487 | # This will remove the Namespaces entry from the Quick Index 488 | # and from the Folder Tree View (if specified). The default is YES. 489 | 490 | SHOW_NAMESPACES = YES 491 | 492 | # The FILE_VERSION_FILTER tag can be used to specify a program or script that 493 | # doxygen should invoke to get the current version for each file (typically from 494 | # the version control system). Doxygen will invoke the program by executing (via 495 | # popen()) the command , where is the value of 496 | # the FILE_VERSION_FILTER tag, and is the name of an input file 497 | # provided by doxygen. Whatever the program writes to standard output 498 | # is used as the file version. See the manual for examples. 499 | 500 | FILE_VERSION_FILTER = 501 | 502 | # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 503 | # doxygen. The layout file controls the global structure of the generated output files 504 | # in an output format independent way. The create the layout file that represents 505 | # doxygen's defaults, run doxygen with the -l option. You can optionally specify a 506 | # file name after the option, if omitted DoxygenLayout.xml will be used as the name 507 | # of the layout file. 508 | 509 | LAYOUT_FILE = 510 | 511 | #--------------------------------------------------------------------------- 512 | # configuration options related to warning and progress messages 513 | #--------------------------------------------------------------------------- 514 | 515 | # The QUIET tag can be used to turn on/off the messages that are generated 516 | # by doxygen. Possible values are YES and NO. If left blank NO is used. 517 | 518 | QUIET = NO 519 | 520 | # The WARNINGS tag can be used to turn on/off the warning messages that are 521 | # generated by doxygen. Possible values are YES and NO. If left blank 522 | # NO is used. 523 | 524 | WARNINGS = YES 525 | 526 | # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 527 | # for undocumented members. If EXTRACT_ALL is set to YES then this flag will 528 | # automatically be disabled. 529 | 530 | WARN_IF_UNDOCUMENTED = YES 531 | 532 | # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 533 | # potential errors in the documentation, such as not documenting some 534 | # parameters in a documented function, or documenting parameters that 535 | # don't exist or using markup commands wrongly. 536 | 537 | WARN_IF_DOC_ERROR = YES 538 | 539 | # This WARN_NO_PARAMDOC option can be abled to get warnings for 540 | # functions that are documented, but have no documentation for their parameters 541 | # or return value. If set to NO (the default) doxygen will only warn about 542 | # wrong or incomplete parameter documentation, but not about the absence of 543 | # documentation. 544 | 545 | WARN_NO_PARAMDOC = NO 546 | 547 | # The WARN_FORMAT tag determines the format of the warning messages that 548 | # doxygen can produce. The string should contain the $file, $line, and $text 549 | # tags, which will be replaced by the file and line number from which the 550 | # warning originated and the warning text. Optionally the format may contain 551 | # $version, which will be replaced by the version of the file (if it could 552 | # be obtained via FILE_VERSION_FILTER) 553 | 554 | WARN_FORMAT = "$file:$line: $text" 555 | 556 | # The WARN_LOGFILE tag can be used to specify a file to which warning 557 | # and error messages should be written. If left blank the output is written 558 | # to stderr. 559 | 560 | WARN_LOGFILE = 561 | 562 | #--------------------------------------------------------------------------- 563 | # configuration options related to the input files 564 | #--------------------------------------------------------------------------- 565 | 566 | # The INPUT tag can be used to specify the files and/or directories that contain 567 | # documented source files. You may enter file names like "myfile.cpp" or 568 | # directories like "/usr/src/myproject". Separate the files or directories 569 | # with spaces. 570 | 571 | INPUT = 572 | 573 | # This tag can be used to specify the character encoding of the source files 574 | # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 575 | # also the default input encoding. Doxygen uses libiconv (or the iconv built 576 | # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 577 | # the list of possible encodings. 578 | 579 | INPUT_ENCODING = UTF-8 580 | 581 | # If the value of the INPUT tag contains directories, you can use the 582 | # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 583 | # and *.h) to filter out the source-files in the directories. If left 584 | # blank the following patterns are tested: 585 | # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 586 | # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 587 | 588 | FILE_PATTERNS = 589 | 590 | # The RECURSIVE tag can be used to turn specify whether or not subdirectories 591 | # should be searched for input files as well. Possible values are YES and NO. 592 | # If left blank NO is used. 593 | 594 | RECURSIVE = NO 595 | 596 | # The EXCLUDE tag can be used to specify files and/or directories that should 597 | # excluded from the INPUT source files. This way you can easily exclude a 598 | # subdirectory from a directory tree whose root is specified with the INPUT tag. 599 | 600 | EXCLUDE = 601 | 602 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or 603 | # directories that are symbolic links (a Unix filesystem feature) are excluded 604 | # from the input. 605 | 606 | EXCLUDE_SYMLINKS = NO 607 | 608 | # If the value of the INPUT tag contains directories, you can use the 609 | # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 610 | # certain files from those directories. Note that the wildcards are matched 611 | # against the file with absolute path, so to exclude all test directories 612 | # for example use the pattern */test/* 613 | 614 | EXCLUDE_PATTERNS = 615 | 616 | # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 617 | # (namespaces, classes, functions, etc.) that should be excluded from the 618 | # output. The symbol name can be a fully qualified name, a word, or if the 619 | # wildcard * is used, a substring. Examples: ANamespace, AClass, 620 | # AClass::ANamespace, ANamespace::*Test 621 | 622 | EXCLUDE_SYMBOLS = 623 | 624 | # The EXAMPLE_PATH tag can be used to specify one or more files or 625 | # directories that contain example code fragments that are included (see 626 | # the \include command). 627 | 628 | EXAMPLE_PATH = 629 | 630 | # If the value of the EXAMPLE_PATH tag contains directories, you can use the 631 | # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 632 | # and *.h) to filter out the source-files in the directories. If left 633 | # blank all files are included. 634 | 635 | EXAMPLE_PATTERNS = 636 | 637 | # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 638 | # searched for input files to be used with the \include or \dontinclude 639 | # commands irrespective of the value of the RECURSIVE tag. 640 | # Possible values are YES and NO. If left blank NO is used. 641 | 642 | EXAMPLE_RECURSIVE = NO 643 | 644 | # The IMAGE_PATH tag can be used to specify one or more files or 645 | # directories that contain image that are included in the documentation (see 646 | # the \image command). 647 | 648 | IMAGE_PATH = 649 | 650 | # The INPUT_FILTER tag can be used to specify a program that doxygen should 651 | # invoke to filter for each input file. Doxygen will invoke the filter program 652 | # by executing (via popen()) the command , where 653 | # is the value of the INPUT_FILTER tag, and is the name of an 654 | # input file. Doxygen will then use the output that the filter program writes 655 | # to standard output. 656 | # If FILTER_PATTERNS is specified, this tag will be 657 | # ignored. 658 | 659 | INPUT_FILTER = 660 | 661 | # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 662 | # basis. 663 | # Doxygen will compare the file name with each pattern and apply the 664 | # filter if there is a match. 665 | # The filters are a list of the form: 666 | # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 667 | # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 668 | # is applied to all files. 669 | 670 | FILTER_PATTERNS = 671 | 672 | # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 673 | # INPUT_FILTER) will be used to filter the input files when producing source 674 | # files to browse (i.e. when SOURCE_BROWSER is set to YES). 675 | 676 | FILTER_SOURCE_FILES = NO 677 | 678 | #--------------------------------------------------------------------------- 679 | # configuration options related to source browsing 680 | #--------------------------------------------------------------------------- 681 | 682 | # If the SOURCE_BROWSER tag is set to YES then a list of source files will 683 | # be generated. Documented entities will be cross-referenced with these sources. 684 | # Note: To get rid of all source code in the generated output, make sure also 685 | # VERBATIM_HEADERS is set to NO. 686 | 687 | SOURCE_BROWSER = NO 688 | 689 | # Setting the INLINE_SOURCES tag to YES will include the body 690 | # of functions and classes directly in the documentation. 691 | 692 | INLINE_SOURCES = NO 693 | 694 | # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 695 | # doxygen to hide any special comment blocks from generated source code 696 | # fragments. Normal C and C++ comments will always remain visible. 697 | 698 | STRIP_CODE_COMMENTS = YES 699 | 700 | # If the REFERENCED_BY_RELATION tag is set to YES 701 | # then for each documented function all documented 702 | # functions referencing it will be listed. 703 | 704 | REFERENCED_BY_RELATION = NO 705 | 706 | # If the REFERENCES_RELATION tag is set to YES 707 | # then for each documented function all documented entities 708 | # called/used by that function will be listed. 709 | 710 | REFERENCES_RELATION = NO 711 | 712 | # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 713 | # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 714 | # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 715 | # link to the source code. 716 | # Otherwise they will link to the documentation. 717 | 718 | REFERENCES_LINK_SOURCE = YES 719 | 720 | # If the USE_HTAGS tag is set to YES then the references to source code 721 | # will point to the HTML generated by the htags(1) tool instead of doxygen 722 | # built-in source browser. The htags tool is part of GNU's global source 723 | # tagging system (see http://www.gnu.org/software/global/global.html). You 724 | # will need version 4.8.6 or higher. 725 | 726 | USE_HTAGS = NO 727 | 728 | # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 729 | # will generate a verbatim copy of the header file for each class for 730 | # which an include is specified. Set to NO to disable this. 731 | 732 | VERBATIM_HEADERS = YES 733 | 734 | #--------------------------------------------------------------------------- 735 | # configuration options related to the alphabetical class index 736 | #--------------------------------------------------------------------------- 737 | 738 | # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 739 | # of all compounds will be generated. Enable this if the project 740 | # contains a lot of classes, structs, unions or interfaces. 741 | 742 | ALPHABETICAL_INDEX = NO 743 | 744 | # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 745 | # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 746 | # in which this list will be split (can be a number in the range [1..20]) 747 | 748 | COLS_IN_ALPHA_INDEX = 5 749 | 750 | # In case all classes in a project start with a common prefix, all 751 | # classes will be put under the same header in the alphabetical index. 752 | # The IGNORE_PREFIX tag can be used to specify one or more prefixes that 753 | # should be ignored while generating the index headers. 754 | 755 | IGNORE_PREFIX = 756 | 757 | #--------------------------------------------------------------------------- 758 | # configuration options related to the HTML output 759 | #--------------------------------------------------------------------------- 760 | 761 | # If the GENERATE_HTML tag is set to YES (the default) Doxygen will 762 | # generate HTML output. 763 | 764 | GENERATE_HTML = YES 765 | 766 | # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 767 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 768 | # put in front of it. If left blank `html' will be used as the default path. 769 | 770 | HTML_OUTPUT = html 771 | 772 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for 773 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank 774 | # doxygen will generate files with .html extension. 775 | 776 | HTML_FILE_EXTENSION = .html 777 | 778 | # The HTML_HEADER tag can be used to specify a personal HTML header for 779 | # each generated HTML page. If it is left blank doxygen will generate a 780 | # standard header. 781 | 782 | HTML_HEADER = 783 | 784 | # The HTML_FOOTER tag can be used to specify a personal HTML footer for 785 | # each generated HTML page. If it is left blank doxygen will generate a 786 | # standard footer. 787 | 788 | HTML_FOOTER = 789 | 790 | # If the HTML_TIMESTAMP tag is set to YES then the generated HTML 791 | # documentation will contain the timesstamp. 792 | 793 | HTML_TIMESTAMP = NO 794 | 795 | # The HTML_STYLESHEET tag can be used to specify a user-defined cascading 796 | # style sheet that is used by each HTML page. It can be used to 797 | # fine-tune the look of the HTML output. If the tag is left blank doxygen 798 | # will generate a default style sheet. Note that doxygen will try to copy 799 | # the style sheet file to the HTML output directory, so don't put your own 800 | # stylesheet in the HTML output directory as well, or it will be erased! 801 | 802 | HTML_STYLESHEET = 803 | 804 | # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 805 | # files or namespaces will be aligned in HTML using tables. If set to 806 | # NO a bullet list will be used. 807 | 808 | HTML_ALIGN_MEMBERS = YES 809 | 810 | # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 811 | # documentation will contain sections that can be hidden and shown after the 812 | # page has loaded. For this to work a browser that supports 813 | # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 814 | # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). 815 | 816 | HTML_DYNAMIC_SECTIONS = NO 817 | 818 | # If the GENERATE_DOCSET tag is set to YES, additional index files 819 | # will be generated that can be used as input for Apple's Xcode 3 820 | # integrated development environment, introduced with OSX 10.5 (Leopard). 821 | # To create a documentation set, doxygen will generate a Makefile in the 822 | # HTML output directory. Running make will produce the docset in that 823 | # directory and running "make install" will install the docset in 824 | # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 825 | # it at startup. 826 | # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. 827 | 828 | GENERATE_DOCSET = NO 829 | 830 | # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 831 | # feed. A documentation feed provides an umbrella under which multiple 832 | # documentation sets from a single provider (such as a company or product suite) 833 | # can be grouped. 834 | 835 | DOCSET_FEEDNAME = "Doxygen generated docs" 836 | 837 | # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 838 | # should uniquely identify the documentation set bundle. This should be a 839 | # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 840 | # will append .docset to the name. 841 | 842 | DOCSET_BUNDLE_ID = org.doxygen.Project 843 | 844 | # If the GENERATE_HTMLHELP tag is set to YES, additional index files 845 | # will be generated that can be used as input for tools like the 846 | # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 847 | # of the generated HTML documentation. 848 | 849 | GENERATE_HTMLHELP = NO 850 | 851 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 852 | # be used to specify the file name of the resulting .chm file. You 853 | # can add a path in front of the file if the result should not be 854 | # written to the html output directory. 855 | 856 | CHM_FILE = 857 | 858 | # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 859 | # be used to specify the location (absolute path including file name) of 860 | # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 861 | # the HTML help compiler on the generated index.hhp. 862 | 863 | HHC_LOCATION = 864 | 865 | # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 866 | # controls if a separate .chi index file is generated (YES) or that 867 | # it should be included in the master .chm file (NO). 868 | 869 | GENERATE_CHI = NO 870 | 871 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 872 | # is used to encode HtmlHelp index (hhk), content (hhc) and project file 873 | # content. 874 | 875 | CHM_INDEX_ENCODING = 876 | 877 | # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 878 | # controls whether a binary table of contents is generated (YES) or a 879 | # normal table of contents (NO) in the .chm file. 880 | 881 | BINARY_TOC = NO 882 | 883 | # The TOC_EXPAND flag can be set to YES to add extra items for group members 884 | # to the contents of the HTML help documentation and to the tree view. 885 | 886 | TOC_EXPAND = NO 887 | 888 | # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 889 | # are set, an additional index file will be generated that can be used as input for 890 | # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 891 | # HTML documentation. 892 | 893 | GENERATE_QHP = NO 894 | 895 | # If the QHG_LOCATION tag is specified, the QCH_FILE tag can 896 | # be used to specify the file name of the resulting .qch file. 897 | # The path specified is relative to the HTML output folder. 898 | 899 | QCH_FILE = 900 | 901 | # The QHP_NAMESPACE tag specifies the namespace to use when generating 902 | # Qt Help Project output. For more information please see 903 | # http://doc.trolltech.com/qthelpproject.html#namespace 904 | 905 | QHP_NAMESPACE = 906 | 907 | # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 908 | # Qt Help Project output. For more information please see 909 | # http://doc.trolltech.com/qthelpproject.html#virtual-folders 910 | 911 | QHP_VIRTUAL_FOLDER = doc 912 | 913 | # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. 914 | # For more information please see 915 | # http://doc.trolltech.com/qthelpproject.html#custom-filters 916 | 917 | QHP_CUST_FILTER_NAME = 918 | 919 | # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see 920 | # Qt Help Project / Custom Filters. 921 | 922 | QHP_CUST_FILTER_ATTRS = 923 | 924 | # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's 925 | # filter section matches. 926 | # Qt Help Project / Filter Attributes. 927 | 928 | QHP_SECT_FILTER_ATTRS = 929 | 930 | # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 931 | # be used to specify the location of Qt's qhelpgenerator. 932 | # If non-empty doxygen will try to run qhelpgenerator on the generated 933 | # .qhp file. 934 | 935 | QHG_LOCATION = 936 | 937 | # The DISABLE_INDEX tag can be used to turn on/off the condensed index at 938 | # top of each HTML page. The value NO (the default) enables the index and 939 | # the value YES disables it. 940 | 941 | DISABLE_INDEX = NO 942 | 943 | # This tag can be used to set the number of enum values (range [1..20]) 944 | # that doxygen will group on one line in the generated HTML documentation. 945 | 946 | ENUM_VALUES_PER_LINE = 4 947 | 948 | # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 949 | # structure should be generated to display hierarchical information. 950 | # If the tag value is set to YES, a side panel will be generated 951 | # containing a tree-like index structure (just like the one that 952 | # is generated for HTML Help). For this to work a browser that supports 953 | # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). 954 | # Windows users are probably better off using the HTML help feature. 955 | 956 | GENERATE_TREEVIEW = NO 957 | 958 | # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, 959 | # and Class Hierarchy pages using a tree view instead of an ordered list. 960 | 961 | USE_INLINE_TREES = NO 962 | 963 | # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 964 | # used to set the initial width (in pixels) of the frame in which the tree 965 | # is shown. 966 | 967 | TREEVIEW_WIDTH = 250 968 | 969 | # Use this tag to change the font size of Latex formulas included 970 | # as images in the HTML documentation. The default is 10. Note that 971 | # when you change the font size after a successful doxygen run you need 972 | # to manually remove any form_*.png images from the HTML output directory 973 | # to force them to be regenerated. 974 | 975 | FORMULA_FONTSIZE = 10 976 | 977 | # When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript 978 | # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) 979 | # there is already a search function so this one should typically 980 | # be disabled. 981 | 982 | SEARCHENGINE = YES 983 | 984 | #--------------------------------------------------------------------------- 985 | # configuration options related to the LaTeX output 986 | #--------------------------------------------------------------------------- 987 | 988 | # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 989 | # generate Latex output. 990 | 991 | GENERATE_LATEX = YES 992 | 993 | # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 994 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 995 | # put in front of it. If left blank `latex' will be used as the default path. 996 | 997 | LATEX_OUTPUT = latex 998 | 999 | # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 1000 | # invoked. If left blank `latex' will be used as the default command name. 1001 | 1002 | LATEX_CMD_NAME = latex 1003 | 1004 | # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 1005 | # generate index for LaTeX. If left blank `makeindex' will be used as the 1006 | # default command name. 1007 | 1008 | MAKEINDEX_CMD_NAME = makeindex 1009 | 1010 | # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 1011 | # LaTeX documents. This may be useful for small projects and may help to 1012 | # save some trees in general. 1013 | 1014 | COMPACT_LATEX = NO 1015 | 1016 | # The PAPER_TYPE tag can be used to set the paper type that is used 1017 | # by the printer. Possible values are: a4, a4wide, letter, legal and 1018 | # executive. If left blank a4wide will be used. 1019 | 1020 | PAPER_TYPE = a4wide 1021 | 1022 | # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 1023 | # packages that should be included in the LaTeX output. 1024 | 1025 | EXTRA_PACKAGES = 1026 | 1027 | # The LATEX_HEADER tag can be used to specify a personal LaTeX header for 1028 | # the generated latex document. The header should contain everything until 1029 | # the first chapter. If it is left blank doxygen will generate a 1030 | # standard header. Notice: only use this tag if you know what you are doing! 1031 | 1032 | LATEX_HEADER = 1033 | 1034 | # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 1035 | # is prepared for conversion to pdf (using ps2pdf). The pdf file will 1036 | # contain links (just like the HTML output) instead of page references 1037 | # This makes the output suitable for online browsing using a pdf viewer. 1038 | 1039 | PDF_HYPERLINKS = YES 1040 | 1041 | # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 1042 | # plain latex in the generated Makefile. Set this option to YES to get a 1043 | # higher quality PDF documentation. 1044 | 1045 | USE_PDFLATEX = YES 1046 | 1047 | # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 1048 | # command to the generated LaTeX files. This will instruct LaTeX to keep 1049 | # running if errors occur, instead of asking the user for help. 1050 | # This option is also used when generating formulas in HTML. 1051 | 1052 | LATEX_BATCHMODE = NO 1053 | 1054 | # If LATEX_HIDE_INDICES is set to YES then doxygen will not 1055 | # include the index chapters (such as File Index, Compound Index, etc.) 1056 | # in the output. 1057 | 1058 | LATEX_HIDE_INDICES = NO 1059 | 1060 | # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. 1061 | 1062 | LATEX_SOURCE_CODE = NO 1063 | 1064 | #--------------------------------------------------------------------------- 1065 | # configuration options related to the RTF output 1066 | #--------------------------------------------------------------------------- 1067 | 1068 | # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 1069 | # The RTF output is optimized for Word 97 and may not look very pretty with 1070 | # other RTF readers or editors. 1071 | 1072 | GENERATE_RTF = NO 1073 | 1074 | # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 1075 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1076 | # put in front of it. If left blank `rtf' will be used as the default path. 1077 | 1078 | RTF_OUTPUT = rtf 1079 | 1080 | # If the COMPACT_RTF tag is set to YES Doxygen generates more compact 1081 | # RTF documents. This may be useful for small projects and may help to 1082 | # save some trees in general. 1083 | 1084 | COMPACT_RTF = NO 1085 | 1086 | # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 1087 | # will contain hyperlink fields. The RTF file will 1088 | # contain links (just like the HTML output) instead of page references. 1089 | # This makes the output suitable for online browsing using WORD or other 1090 | # programs which support those fields. 1091 | # Note: wordpad (write) and others do not support links. 1092 | 1093 | RTF_HYPERLINKS = NO 1094 | 1095 | # Load stylesheet definitions from file. Syntax is similar to doxygen's 1096 | # config file, i.e. a series of assignments. You only have to provide 1097 | # replacements, missing definitions are set to their default value. 1098 | 1099 | RTF_STYLESHEET_FILE = 1100 | 1101 | # Set optional variables used in the generation of an rtf document. 1102 | # Syntax is similar to doxygen's config file. 1103 | 1104 | RTF_EXTENSIONS_FILE = 1105 | 1106 | #--------------------------------------------------------------------------- 1107 | # configuration options related to the man page output 1108 | #--------------------------------------------------------------------------- 1109 | 1110 | # If the GENERATE_MAN tag is set to YES (the default) Doxygen will 1111 | # generate man pages 1112 | 1113 | GENERATE_MAN = NO 1114 | 1115 | # The MAN_OUTPUT tag is used to specify where the man pages will be put. 1116 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1117 | # put in front of it. If left blank `man' will be used as the default path. 1118 | 1119 | MAN_OUTPUT = man 1120 | 1121 | # The MAN_EXTENSION tag determines the extension that is added to 1122 | # the generated man pages (default is the subroutine's section .3) 1123 | 1124 | MAN_EXTENSION = .3 1125 | 1126 | # If the MAN_LINKS tag is set to YES and Doxygen generates man output, 1127 | # then it will generate one additional man file for each entity 1128 | # documented in the real man page(s). These additional files 1129 | # only source the real man page, but without them the man command 1130 | # would be unable to find the correct page. The default is NO. 1131 | 1132 | MAN_LINKS = NO 1133 | 1134 | #--------------------------------------------------------------------------- 1135 | # configuration options related to the XML output 1136 | #--------------------------------------------------------------------------- 1137 | 1138 | # If the GENERATE_XML tag is set to YES Doxygen will 1139 | # generate an XML file that captures the structure of 1140 | # the code including all documentation. 1141 | 1142 | GENERATE_XML = NO 1143 | 1144 | # The XML_OUTPUT tag is used to specify where the XML pages will be put. 1145 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1146 | # put in front of it. If left blank `xml' will be used as the default path. 1147 | 1148 | XML_OUTPUT = xml 1149 | 1150 | # The XML_SCHEMA tag can be used to specify an XML schema, 1151 | # which can be used by a validating XML parser to check the 1152 | # syntax of the XML files. 1153 | 1154 | XML_SCHEMA = 1155 | 1156 | # The XML_DTD tag can be used to specify an XML DTD, 1157 | # which can be used by a validating XML parser to check the 1158 | # syntax of the XML files. 1159 | 1160 | XML_DTD = 1161 | 1162 | # If the XML_PROGRAMLISTING tag is set to YES Doxygen will 1163 | # dump the program listings (including syntax highlighting 1164 | # and cross-referencing information) to the XML output. Note that 1165 | # enabling this will significantly increase the size of the XML output. 1166 | 1167 | XML_PROGRAMLISTING = YES 1168 | 1169 | #--------------------------------------------------------------------------- 1170 | # configuration options for the AutoGen Definitions output 1171 | #--------------------------------------------------------------------------- 1172 | 1173 | # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 1174 | # generate an AutoGen Definitions (see autogen.sf.net) file 1175 | # that captures the structure of the code including all 1176 | # documentation. Note that this feature is still experimental 1177 | # and incomplete at the moment. 1178 | 1179 | GENERATE_AUTOGEN_DEF = NO 1180 | 1181 | #--------------------------------------------------------------------------- 1182 | # configuration options related to the Perl module output 1183 | #--------------------------------------------------------------------------- 1184 | 1185 | # If the GENERATE_PERLMOD tag is set to YES Doxygen will 1186 | # generate a Perl module file that captures the structure of 1187 | # the code including all documentation. Note that this 1188 | # feature is still experimental and incomplete at the 1189 | # moment. 1190 | 1191 | GENERATE_PERLMOD = NO 1192 | 1193 | # If the PERLMOD_LATEX tag is set to YES Doxygen will generate 1194 | # the necessary Makefile rules, Perl scripts and LaTeX code to be able 1195 | # to generate PDF and DVI output from the Perl module output. 1196 | 1197 | PERLMOD_LATEX = NO 1198 | 1199 | # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 1200 | # nicely formatted so it can be parsed by a human reader. 1201 | # This is useful 1202 | # if you want to understand what is going on. 1203 | # On the other hand, if this 1204 | # tag is set to NO the size of the Perl module output will be much smaller 1205 | # and Perl will parse it just the same. 1206 | 1207 | PERLMOD_PRETTY = YES 1208 | 1209 | # The names of the make variables in the generated doxyrules.make file 1210 | # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 1211 | # This is useful so different doxyrules.make files included by the same 1212 | # Makefile don't overwrite each other's variables. 1213 | 1214 | PERLMOD_MAKEVAR_PREFIX = 1215 | 1216 | #--------------------------------------------------------------------------- 1217 | # Configuration options related to the preprocessor 1218 | #--------------------------------------------------------------------------- 1219 | 1220 | # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 1221 | # evaluate all C-preprocessor directives found in the sources and include 1222 | # files. 1223 | 1224 | ENABLE_PREPROCESSING = YES 1225 | 1226 | # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 1227 | # names in the source code. If set to NO (the default) only conditional 1228 | # compilation will be performed. Macro expansion can be done in a controlled 1229 | # way by setting EXPAND_ONLY_PREDEF to YES. 1230 | 1231 | MACRO_EXPANSION = NO 1232 | 1233 | # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 1234 | # then the macro expansion is limited to the macros specified with the 1235 | # PREDEFINED and EXPAND_AS_DEFINED tags. 1236 | 1237 | EXPAND_ONLY_PREDEF = NO 1238 | 1239 | # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 1240 | # in the INCLUDE_PATH (see below) will be search if a #include is found. 1241 | 1242 | SEARCH_INCLUDES = YES 1243 | 1244 | # The INCLUDE_PATH tag can be used to specify one or more directories that 1245 | # contain include files that are not input files but should be processed by 1246 | # the preprocessor. 1247 | 1248 | INCLUDE_PATH = 1249 | 1250 | # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 1251 | # patterns (like *.h and *.hpp) to filter out the header-files in the 1252 | # directories. If left blank, the patterns specified with FILE_PATTERNS will 1253 | # be used. 1254 | 1255 | INCLUDE_FILE_PATTERNS = 1256 | 1257 | # The PREDEFINED tag can be used to specify one or more macro names that 1258 | # are defined before the preprocessor is started (similar to the -D option of 1259 | # gcc). The argument of the tag is a list of macros of the form: name 1260 | # or name=definition (no spaces). If the definition and the = are 1261 | # omitted =1 is assumed. To prevent a macro definition from being 1262 | # undefined via #undef or recursively expanded use the := operator 1263 | # instead of the = operator. 1264 | 1265 | PREDEFINED = 1266 | 1267 | # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 1268 | # this tag can be used to specify a list of macro names that should be expanded. 1269 | # The macro definition that is found in the sources will be used. 1270 | # Use the PREDEFINED tag if you want to use a different macro definition. 1271 | 1272 | EXPAND_AS_DEFINED = 1273 | 1274 | # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 1275 | # doxygen's preprocessor will remove all function-like macros that are alone 1276 | # on a line, have an all uppercase name, and do not end with a semicolon. Such 1277 | # function macros are typically used for boiler-plate code, and will confuse 1278 | # the parser if not removed. 1279 | 1280 | SKIP_FUNCTION_MACROS = YES 1281 | 1282 | #--------------------------------------------------------------------------- 1283 | # Configuration::additions related to external references 1284 | #--------------------------------------------------------------------------- 1285 | 1286 | # The TAGFILES option can be used to specify one or more tagfiles. 1287 | # Optionally an initial location of the external documentation 1288 | # can be added for each tagfile. The format of a tag file without 1289 | # this location is as follows: 1290 | # 1291 | # TAGFILES = file1 file2 ... 1292 | # Adding location for the tag files is done as follows: 1293 | # 1294 | # TAGFILES = file1=loc1 "file2 = loc2" ... 1295 | # where "loc1" and "loc2" can be relative or absolute paths or 1296 | # URLs. If a location is present for each tag, the installdox tool 1297 | # does not have to be run to correct the links. 1298 | # Note that each tag file must have a unique name 1299 | # (where the name does NOT include the path) 1300 | # If a tag file is not located in the directory in which doxygen 1301 | # is run, you must also specify the path to the tagfile here. 1302 | 1303 | TAGFILES = 1304 | 1305 | # When a file name is specified after GENERATE_TAGFILE, doxygen will create 1306 | # a tag file that is based on the input files it reads. 1307 | 1308 | GENERATE_TAGFILE = 1309 | 1310 | # If the ALLEXTERNALS tag is set to YES all external classes will be listed 1311 | # in the class index. If set to NO only the inherited external classes 1312 | # will be listed. 1313 | 1314 | ALLEXTERNALS = NO 1315 | 1316 | # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 1317 | # in the modules index. If set to NO, only the current project's groups will 1318 | # be listed. 1319 | 1320 | EXTERNAL_GROUPS = YES 1321 | 1322 | # The PERL_PATH should be the absolute path and name of the perl script 1323 | # interpreter (i.e. the result of `which perl'). 1324 | 1325 | PERL_PATH = /usr/bin/perl 1326 | 1327 | #--------------------------------------------------------------------------- 1328 | # Configuration options related to the dot tool 1329 | #--------------------------------------------------------------------------- 1330 | 1331 | # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 1332 | # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 1333 | # or super classes. Setting the tag to NO turns the diagrams off. Note that 1334 | # this option is superseded by the HAVE_DOT option below. This is only a 1335 | # fallback. It is recommended to install and use dot, since it yields more 1336 | # powerful graphs. 1337 | 1338 | CLASS_DIAGRAMS = YES 1339 | 1340 | # You can define message sequence charts within doxygen comments using the \msc 1341 | # command. Doxygen will then run the mscgen tool (see 1342 | # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 1343 | # documentation. The MSCGEN_PATH tag allows you to specify the directory where 1344 | # the mscgen tool resides. If left empty the tool is assumed to be found in the 1345 | # default search path. 1346 | 1347 | MSCGEN_PATH = 1348 | 1349 | # If set to YES, the inheritance and collaboration graphs will hide 1350 | # inheritance and usage relations if the target is undocumented 1351 | # or is not a class. 1352 | 1353 | HIDE_UNDOC_RELATIONS = YES 1354 | 1355 | # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 1356 | # available from the path. This tool is part of Graphviz, a graph visualization 1357 | # toolkit from AT&T and Lucent Bell Labs. The other options in this section 1358 | # have no effect if this option is set to NO (the default) 1359 | 1360 | HAVE_DOT = NO 1361 | 1362 | # By default doxygen will write a font called FreeSans.ttf to the output 1363 | # directory and reference it in all dot files that doxygen generates. This 1364 | # font does not include all possible unicode characters however, so when you need 1365 | # these (or just want a differently looking font) you can specify the font name 1366 | # using DOT_FONTNAME. You need need to make sure dot is able to find the font, 1367 | # which can be done by putting it in a standard location or by setting the 1368 | # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 1369 | # containing the font. 1370 | 1371 | DOT_FONTNAME = FreeSans 1372 | 1373 | # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 1374 | # The default size is 10pt. 1375 | 1376 | DOT_FONTSIZE = 10 1377 | 1378 | # By default doxygen will tell dot to use the output directory to look for the 1379 | # FreeSans.ttf font (which doxygen will put there itself). If you specify a 1380 | # different font using DOT_FONTNAME you can set the path where dot 1381 | # can find it using this tag. 1382 | 1383 | DOT_FONTPATH = 1384 | 1385 | # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 1386 | # will generate a graph for each documented class showing the direct and 1387 | # indirect inheritance relations. Setting this tag to YES will force the 1388 | # the CLASS_DIAGRAMS tag to NO. 1389 | 1390 | CLASS_GRAPH = YES 1391 | 1392 | # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 1393 | # will generate a graph for each documented class showing the direct and 1394 | # indirect implementation dependencies (inheritance, containment, and 1395 | # class references variables) of the class with other documented classes. 1396 | 1397 | COLLABORATION_GRAPH = YES 1398 | 1399 | # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 1400 | # will generate a graph for groups, showing the direct groups dependencies 1401 | 1402 | GROUP_GRAPHS = YES 1403 | 1404 | # If the UML_LOOK tag is set to YES doxygen will generate inheritance and 1405 | # collaboration diagrams in a style similar to the OMG's Unified Modeling 1406 | # Language. 1407 | 1408 | UML_LOOK = NO 1409 | 1410 | # If set to YES, the inheritance and collaboration graphs will show the 1411 | # relations between templates and their instances. 1412 | 1413 | TEMPLATE_RELATIONS = NO 1414 | 1415 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 1416 | # tags are set to YES then doxygen will generate a graph for each documented 1417 | # file showing the direct and indirect include dependencies of the file with 1418 | # other documented files. 1419 | 1420 | INCLUDE_GRAPH = YES 1421 | 1422 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 1423 | # HAVE_DOT tags are set to YES then doxygen will generate a graph for each 1424 | # documented header file showing the documented files that directly or 1425 | # indirectly include this file. 1426 | 1427 | INCLUDED_BY_GRAPH = YES 1428 | 1429 | # If the CALL_GRAPH and HAVE_DOT options are set to YES then 1430 | # doxygen will generate a call dependency graph for every global function 1431 | # or class method. Note that enabling this option will significantly increase 1432 | # the time of a run. So in most cases it will be better to enable call graphs 1433 | # for selected functions only using the \callgraph command. 1434 | 1435 | CALL_GRAPH = NO 1436 | 1437 | # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 1438 | # doxygen will generate a caller dependency graph for every global function 1439 | # or class method. Note that enabling this option will significantly increase 1440 | # the time of a run. So in most cases it will be better to enable caller 1441 | # graphs for selected functions only using the \callergraph command. 1442 | 1443 | CALLER_GRAPH = NO 1444 | 1445 | # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 1446 | # will graphical hierarchy of all classes instead of a textual one. 1447 | 1448 | GRAPHICAL_HIERARCHY = YES 1449 | 1450 | # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 1451 | # then doxygen will show the dependencies a directory has on other directories 1452 | # in a graphical way. The dependency relations are determined by the #include 1453 | # relations between the files in the directories. 1454 | 1455 | DIRECTORY_GRAPH = YES 1456 | 1457 | # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 1458 | # generated by dot. Possible values are png, jpg, or gif 1459 | # If left blank png will be used. 1460 | 1461 | DOT_IMAGE_FORMAT = png 1462 | 1463 | # The tag DOT_PATH can be used to specify the path where the dot tool can be 1464 | # found. If left blank, it is assumed the dot tool can be found in the path. 1465 | 1466 | DOT_PATH = 1467 | 1468 | # The DOTFILE_DIRS tag can be used to specify one or more directories that 1469 | # contain dot files that are included in the documentation (see the 1470 | # \dotfile command). 1471 | 1472 | DOTFILE_DIRS = 1473 | 1474 | # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 1475 | # nodes that will be shown in the graph. If the number of nodes in a graph 1476 | # becomes larger than this value, doxygen will truncate the graph, which is 1477 | # visualized by representing a node as a red box. Note that doxygen if the 1478 | # number of direct children of the root node in a graph is already larger than 1479 | # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 1480 | # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. 1481 | 1482 | DOT_GRAPH_MAX_NODES = 50 1483 | 1484 | # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 1485 | # graphs generated by dot. A depth value of 3 means that only nodes reachable 1486 | # from the root by following a path via at most 3 edges will be shown. Nodes 1487 | # that lay further from the root node will be omitted. Note that setting this 1488 | # option to 1 or 2 may greatly reduce the computation time needed for large 1489 | # code bases. Also note that the size of a graph can be further restricted by 1490 | # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. 1491 | 1492 | MAX_DOT_GRAPH_DEPTH = 0 1493 | 1494 | # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 1495 | # background. This is disabled by default, because dot on Windows does not 1496 | # seem to support this out of the box. Warning: Depending on the platform used, 1497 | # enabling this option may lead to badly anti-aliased labels on the edges of 1498 | # a graph (i.e. they become hard to read). 1499 | 1500 | DOT_TRANSPARENT = NO 1501 | 1502 | # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 1503 | # files in one run (i.e. multiple -o and -T options on the command line). This 1504 | # makes dot run faster, but since only newer versions of dot (>1.8.10) 1505 | # support this, this feature is disabled by default. 1506 | 1507 | DOT_MULTI_TARGETS = NO 1508 | 1509 | # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 1510 | # generate a legend page explaining the meaning of the various boxes and 1511 | # arrows in the dot generated graphs. 1512 | 1513 | GENERATE_LEGEND = YES 1514 | 1515 | # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 1516 | # remove the intermediate dot files that are used to generate 1517 | # the various graphs. 1518 | 1519 | DOT_CLEANUP = YES 1520 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Verilog parser makefile 2 | 3 | verilog-parser: verilog-parser.o functions.o 4 | gcc -o verilog-parser verilog-parser.o functions.o 5 | 6 | verilog-parser.o: functions.h verilog-parser.c 7 | gcc -O -c verilog-parser.c 8 | 9 | functions.o: functions.h functions.c 10 | gcc -O -c functions.c 11 | 12 | clean: 13 | rm -f verilog-parser verilog-parser.o functions.o 14 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | A verilog parser for multi-level combinational logic circuits 2 | 3 | What is it? 4 | ----------- 5 | This tool is A verilog parser for multi-level combinational logic circuits 6 | 7 | 8 | How to compile the program? 9 | ------------------ 10 | Enter the directory verilog-parser 11 | Run the 'make' command 12 | 13 | 14 | How to run the program? 15 | ------------------ 16 | Usage: ./verilog-parser 17 | verilog-parser: the executable file 18 | filename.v: the verilog file to parse 19 | 20 | * A sample verilog files is located in the directory 'verilog' 21 | 22 | 23 | For further information, contact: 24 | -------- 25 | David Kebo Houngninou 26 | dhoungninou@smu.edu 27 | 28 | 29 | -------------------------------------------------------------------------------- /functions.c: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------------- 2 | ** This software is in the public domain, furnished "as is", without technical 3 | ** support, and with no warranty, express or implied, as to its usefulness for 4 | ** any purpose. 5 | ** 6 | ** functions.c 7 | ** A library of helper functions for the verilog parser 8 | ** 9 | ** Author: David Kebo Houngninou 10 | ** -------------------------------------------------------------------------*/ 11 | #ifdef IDENT_C 12 | static const char* const functions_c_Id = 13 | "$Id$"; 14 | #endif 15 | 16 | #include "keywords.h" 17 | #include "functions.h" 18 | 19 | /** 20 | * Determines if a string is reserved keyword 21 | * @param the string to compare 22 | * @return whether the string is reserved or not 23 | */ 24 | bool reserved (char* word) 25 | { 26 | int i; 27 | for (i = 0; i < RESERVEDNUM; i++) 28 | if (strcmp(word, reserved_word[i])==0 || strstr(word, "endmodule")!= NULL) 29 | return true; 30 | return false; 31 | } 32 | 33 | /** 34 | * Determines if a string is gate 35 | * @param the string to check 36 | * @return whether the string is a gate or not 37 | */ 38 | bool gate (char* word) 39 | { 40 | int i; 41 | for (i = 0; i < GATESNUM; i++) 42 | if (strcmp(word, gate_name[i])==0) 43 | return true; 44 | return false; 45 | } 46 | 47 | /** 48 | * Determines if a wire is an output 49 | * @param the string to check 50 | * @return whether the string is a an ouput or not 51 | */ 52 | bool isFinalOutput (wire w, circuit c) 53 | { 54 | int i; 55 | for(i = 0; i < c->outputcount; i++) 56 | if (strcmp(w->name, c->outputs[i])==0) 57 | return true; 58 | return false; 59 | } 60 | 61 | /** 62 | * Parses a string and removes all character after a numeric character 63 | * @param the source string 64 | */ 65 | char* trim (char* source) 66 | { 67 | int i=0, index=0; 68 | int sr_length = strlen(source); 69 | for(i=0; iname); 158 | printf("Number of inputs: %d\n", m->inputcount); 159 | for(i = 0; i < m->inputcount; i++) 160 | printf("%s ", m->inputs[i]); 161 | 162 | printf("\n\nNumber of outputs: %d\n", m->outputcount); 163 | for(i = 0; i < m->outputcount; i++) 164 | printf("%s ", m->outputs[i]); 165 | 166 | printf("\n\nNumber of gates: %d\n", m->gatecount); 167 | for(i = 0; i < m->gatecount; i++) 168 | printf("%s ", m->gates[i]); 169 | 170 | printf("\n\nNumber of wires: %d\n", m->wirecount); 171 | for(i = 0; i < m->wirecount; i++) 172 | printf("%s ", m->wires[i]); 173 | 174 | printf("\n\nNumber of regs: %d\n", m->regcount); 175 | for(i = 0; i < m->regcount; i++) 176 | printf("%s ", m->regs[i]); 177 | printf("*************************** END **************************\n"); 178 | } 179 | 180 | /** 181 | * Prints the summary of a circuit - Statistical information 182 | * @param the circuit object 183 | */ 184 | void print_circuit_summary (circuit c) 185 | { 186 | int i,j,row,col; 187 | printf("\n************** Circuit %s statistical results *************\n", c->name); 188 | printf("Circuit size: %d\n", c->size); 189 | printf("Number of primary inputs: %d\n", c->inputcount); 190 | for(i = 0; i < c->inputcount; i++) 191 | printf("%s ", c->inputs[i]); 192 | 193 | printf("\n\nNumber of outputs: %d\n", c->outputcount); 194 | for(i = 0; i < c->outputcount; i++) 195 | printf("%s ", c->outputs[i]); 196 | 197 | printf("\n\nNumber of gates: %d\n", c->gatecount); 198 | 199 | printf("\n\n"); 200 | i=0; 201 | 202 | while (iwirecount && c->wires[i] != NULL) { 203 | printf ("c->wire[%d]->type: %s, ",i, c->wires[i]->type); 204 | printf ("ID: %d, ", c->wires[i]->id); 205 | printf ("name: %s, ", c->wires[i]->name); 206 | 207 | printf ("\nInputs (%d): ", c->wires[i]->inputcount);/*Wire inputs*/ 208 | for(j=0; jwires[i]->inputcount; j++) 209 | printf ("%d ",c->wires[i]->inputs[j]); 210 | 211 | printf ("\nOutputs (%d): ", c->wires[i]->outputcount);/*Wire outputs*/ 212 | for(j=0; jwires[i]->outputcount; j++) 213 | printf ("%d ",c->wires[i]->outputs[j]); 214 | 215 | i++; 216 | printf ("\n"); 217 | } 218 | printf("*************************** END **************************\n"); 219 | } 220 | 221 | /** 222 | * Get the id of a wire 223 | * @param the signal name, the circuit's name 224 | * The id of the wire 225 | */ 226 | int getID (char* name, circuit c) 227 | { 228 | int i; 229 | for(i=0; isize; i++) { 230 | if (strcmp(name, c->nodes[i]->name)==0) { // If node is found in the circuit, get its index 231 | return c->nodes[i]->id; 232 | } 233 | } 234 | return 0; 235 | } 236 | 237 | /** 238 | * Get a wire by id 239 | * @param the signal name, the circuit's name 240 | */ 241 | wire getWire (int id, circuit c) 242 | { 243 | int i=0; 244 | while (iwirecount && c->wires[i] != NULL) { 245 | if (c->wires[i]->id == id) // If node is found in the circuit 246 | return c->wires[i]; 247 | i++; 248 | } 249 | return 0; 250 | } 251 | 252 | /** 253 | * Get a wire by name 254 | * @param the signal name, the circuit's name 255 | */ 256 | wire getWireByName (char* name, circuit c) 257 | { 258 | int i=0; 259 | while (c->wires[i] != NULL) { 260 | if (strcmp(name, c->wires[i]->name)==0) // If node is found in the circuit 261 | return c->wires[i]; 262 | i++; 263 | } 264 | return 0; 265 | } 266 | 267 | 268 | /** 269 | * Set values of a node 270 | * @param the node object, the type of node, the name of the node, the node id 271 | */ 272 | void setNode ( node n, char* type, char* name, int id) 273 | { 274 | strcpy(n->type, type); 275 | strcpy(n->name, name); 276 | n->id = id; /*Store node id*/ 277 | } 278 | 279 | 280 | /** 281 | * Create a wire 282 | * @param the circuit object, the wire object, the wire type, the wire name 283 | */ 284 | void build_wire (circuit c, wire w, char* type, char* name) 285 | { 286 | int i; 287 | w->id = getID (name, c); /*Wire ID*/ 288 | w->type = strdup(type); /*Wire type*/ 289 | w->name = strdup(name); /*Wire name*/ 290 | w->inputcount = 0; /*Initial number of inputs*/ 291 | w->outputcount = 0; /*Initial number of outputs*/ 292 | 293 | for(i = 0; i < c->inputcount; i++) { /*Circuit primary inputs*/ 294 | if (strcmp(w->name, c->inputs[i])==0) { 295 | w->primary = true; 296 | } 297 | } 298 | 299 | printf("Creating wire: %s, id: %d\n", w->name, w->id); 300 | } 301 | 302 | /** 303 | * Determines if a wire is already created 304 | * @param the circuit object, the wire name 305 | * @return whether the wire is already created or not 306 | */ 307 | bool defined (circuit c, char* name) 308 | { 309 | int i=0; 310 | while (c->wires[i] != NULL) { 311 | if (strcmp(c->wires[i]->name, name)==0) 312 | return true; 313 | i++; 314 | } 315 | return false; 316 | } 317 | -------------------------------------------------------------------------------- /functions.h: -------------------------------------------------------------------------------- 1 | // --------------------------------------------------------------------------- 2 | // This software is in the public domain, furnished "as is", without technical 3 | // support, and with no warranty, express or implied, as to its usefulness for 4 | // any purpose. 5 | // 6 | // functions.H 7 | // A library of helper functions for the verilog parser 8 | // 9 | // Author: David Kebo Houngninou 10 | // --------------------------------------------------------------------------- 11 | #ifndef _functions_H 12 | #define _functions_H 13 | 14 | #ifdef IDENT_H 15 | static const char* const functions_H_Id = 16 | "$Id$"; 17 | #endif 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #define TOKENSIZE 999 /* Maximum length of a token.*/ 26 | #define LINESIZE 9999 /* Maximum length of each input line read.*/ 27 | #define BUFSIZE 99999 /* Maximum length of a buffer.*/ 28 | #define SIZE 9999 29 | #define INPUT 0 30 | #define AND 1 31 | #define NAND 2 32 | #define OR 3 33 | #define NOR 4 34 | #define XOR 5 35 | #define XNOR 6 36 | #define BUF 7 37 | #define NOT 8 38 | #define INV 8 39 | #define I 9 40 | #define RESERVEDNUM 107 41 | #define NO_OUT 0 42 | 43 | typedef enum { false, true } bool; 44 | typedef char * string; 45 | 46 | struct wire_ { 47 | int id; /*Wire ID number*/ 48 | char *name; /*Name of this wire*/ 49 | char *type; /*Type of gate driving this wire*/ 50 | int inputcount; /*Number of wire inputs*/ 51 | int inputs[LINESIZE]; /*Array of inputs*/ 52 | int outputcount; 53 | int outputs[LINESIZE]; /*Array of outputs.*/ 54 | bool primary; /*Primary input flag*/ 55 | }; 56 | typedef struct wire_ *wire; 57 | 58 | struct node_ { 59 | char type[99]; /*input, output, wire, regs*/ 60 | char name[99]; /*node name*/ 61 | int id; /*node number*/ 62 | }; 63 | typedef struct node_ *node; 64 | 65 | struct circuit_ { 66 | wire *wires; /*Array of all wires */ 67 | node *nodes; /*Array of nodes*/ 68 | char *name; /*Name of the circuit. */ 69 | int inputcount, outputcount; /*Count of primary inputs and primary outputs. */ 70 | int gatecount, wirecount, nodecount; /*Number of wires, (gates)*/ 71 | char *inputs[LINESIZE], *outputs[LINESIZE]; /*List of inputs and outputs in the netlist*/ 72 | int size, id; /*Circuit size and identifier*/ 73 | }; 74 | typedef struct circuit_ *circuit; 75 | 76 | struct module_ { 77 | char *name; /*Name of the module*/ 78 | int inputcount, outputcount; /*Count of primary inputs and primary outputs. */ 79 | int wirecount, regcount, gatecount; /*Count of wires ,regs, gates*/ 80 | char *inputs [LINESIZE], *outputs [LINESIZE]; /*List of inputs and outputs in the netlist*/ 81 | char *wires [LINESIZE], *regs [LINESIZE]; /*List of wires, regs, gates in the netlist*/ 82 | char *gates [LINESIZE]; 83 | int id; 84 | }; 85 | typedef struct module_ *module; 86 | 87 | /*PROTOTYPES*/ 88 | bool reserved (char* word); 89 | bool gate (char* word); 90 | char* trim (char* source); 91 | bool isFinalOutput (wire w, circuit c); 92 | bool signal_vector (char* word); 93 | bool end_of_module (char* word); 94 | bool end_of_line(char* source); 95 | int convert (char* gate); 96 | void print_module_summary (module m); 97 | void print_circuit_summary (circuit c); 98 | int getID(char* name, circuit c); 99 | void setNode ( node n, char* type, char* name, int number); 100 | void build_wire (circuit c, wire w, char* type, char* name); 101 | wire getWire (int id, circuit c); 102 | wire getWireByName (char* name, circuit c); 103 | bool defined (circuit c, char* name); 104 | int get_max (int value1, int value2); 105 | bool defined (circuit c, char* name); 106 | /*END PROTOTYPES*/ 107 | 108 | #endif 109 | 110 | -------------------------------------------------------------------------------- /keywords.h: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------------- 2 | ** This software is in the public domain, furnished "as is", without technical 3 | ** support, and with no warranty, express or implied, as to its usefulness for 4 | ** any purpose. 5 | ** 6 | ** keywords.h 7 | ** Verilog keywords 8 | ** 9 | ** Author: David Kebo Houngninou 10 | ** -------------------------------------------------------------------------*/ 11 | #ifndef _keywords_h 12 | #define _keywords_h 13 | 14 | #ifdef IDENT_H 15 | static const char* const keywords_h_Id = 16 | "$Id$"; 17 | #endif 18 | 19 | #define GATESNUM 18 20 | char* gate_name[] = { 21 | "and", 22 | "nand", 23 | "or", 24 | "nor", 25 | "xor", 26 | "xnor", 27 | "buf", 28 | "bufif0", 29 | "bufif1", 30 | "cmos", 31 | "nmos", 32 | "nor", 33 | "not", 34 | "fo", 35 | "fo3", 36 | "fo4", 37 | "fi", 38 | "inv" 39 | }; 40 | 41 | char* reserved_word[] = { /*Reserved Verilog keywords*/ 42 | "always", 43 | "and", 44 | "assign", 45 | "begin", 46 | "buf", 47 | "bufif0", 48 | "bufif1", 49 | "case", 50 | "casex", 51 | "casez", 52 | "cmos", 53 | "deassign", 54 | "default", 55 | "defparam", 56 | "disable", 57 | "edge", 58 | "else", 59 | "end", 60 | "endcase", 61 | "endfunction", 62 | "endmodule", 63 | "endprimitive", 64 | "endspecify", 65 | "endtable", 66 | "endtask", 67 | "event", 68 | "for", 69 | "for", 70 | "force", 71 | "forever", 72 | "function", 73 | "highz0", 74 | "highz1", 75 | "if", 76 | "ifnone", 77 | "initial", 78 | "inout", 79 | "input", 80 | "integer", 81 | "join", 82 | "large", 83 | "macromodule", 84 | "medium", 85 | "module", 86 | "nand", 87 | "negedge", 88 | "nmos", 89 | "nor", 90 | "not", 91 | "notif0", 92 | "notif1", 93 | "or", 94 | "output", 95 | "parameter", 96 | "pmos", 97 | "posedge", 98 | "primitive", 99 | "pull0", 100 | "pull1", 101 | "pulldown", 102 | "pullup", 103 | "rcmos", 104 | "real", 105 | "realtime", 106 | "reg", 107 | "release", 108 | "repeat", 109 | "rnmos", 110 | "rpmos", 111 | "rtran", 112 | "rtranif0", 113 | "rtranif1", 114 | "scalared", 115 | "small", 116 | "specify", 117 | "specparam", 118 | "strong0", 119 | "strong1", 120 | "supply0", 121 | "supply1", 122 | "table", 123 | "task", 124 | "time", 125 | "tran", 126 | "tranif0", 127 | "tranif1", 128 | "tri", 129 | "tri0", 130 | "tri1", 131 | "triand", 132 | "trior", 133 | "trireg", 134 | "vectored", 135 | "wait", 136 | "wand", 137 | "weak0", 138 | "weak1", 139 | "while", 140 | "wire", 141 | "wor", 142 | "xnor", 143 | "xor", 144 | "fo", 145 | "fo3", 146 | "fo4", 147 | "fi", 148 | "inv" 149 | }; 150 | 151 | #define NUM_PUNCTUATIONS 4 152 | char* punctuations[] = { 153 | ";", 154 | ".", 155 | " ", 156 | "\n", 157 | }; 158 | 159 | 160 | #endif 161 | -------------------------------------------------------------------------------- /verilog-parser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidkebo/verilog-parser/a059bb6742e6c1a82d026fc35083e21437c90108/verilog-parser -------------------------------------------------------------------------------- /verilog-parser.c: -------------------------------------------------------------------------------- 1 | /* --------------------------------------------------------------------------- 2 | ** This software is in the public domain, furnished "as is", without technical 3 | ** support, and with no warranty, express or implied, as to its usefulness for 4 | ** any purpose. 5 | ** 6 | ** verilog-parser.c 7 | ** A verilog parser for multi-level combinational logic circuits 8 | ** 9 | ** Author: David Kebo Houngninou 10 | ** -------------------------------------------------------------------------*/ 11 | #ifdef IDENT_C 12 | static const char* const _c_Id = 13 | "$Id$"; 14 | #endif 15 | 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include "functions.h" 25 | 26 | /** 27 | * Build a circuit from a verilog module object 28 | * @param a pointer to the verilog file, a verilog module object, a circuit object 29 | */ 30 | void build_module_circuit (FILE *verilog, module m, circuit c) 31 | { 32 | int i=0, j=0, in=0, out=0, id=0, index=0; /*Indexes*/ 33 | char linebuf[LINESIZE], tmpbuf[LINESIZE], buffer[BUFSIZE]; /*Buffer for lines of the verilog code*/ 34 | char *token[TOKENSIZE]; /*Array to hold tokens for the line*/ 35 | 36 | memset(linebuf, 0, sizeof(char) * LINESIZE); 37 | memset(tmpbuf, 0, sizeof(char) * LINESIZE); 38 | memset(buffer, 0, sizeof(char) * BUFSIZE); 39 | memset(token, 0, sizeof(char*) * TOKENSIZE); 40 | 41 | /*Initialization of the circuit*/ 42 | c->inputcount = m->inputcount; /*Set the number of inputs for the ciruit*/ 43 | c->outputcount = m->outputcount; /*Set the number of outputs for the circuit*/ 44 | c->wirecount = m->wirecount; /*Set the number of wires for the circuit*/ 45 | c->gatecount = m->gatecount; /*Set the number of gates for the circuit*/ 46 | c->size = c->inputcount+c->outputcount+c->wirecount+c->gatecount;/*Number of inputs, outputs and wires*/ 47 | c->wires = (wire *)calloc((c->wirecount) * 10,sizeof(wire)); /*Allocate a contiguous array to index for every wire*/ 48 | c->nodes = (node *)calloc((c->size) * 5,sizeof(node)); /*Allocate a contiguous array to index for every nodes*/ 49 | 50 | for (i=0; i < c->inputcount; i++) { /*Store the names of inputs*/ 51 | c->inputs[i] = calloc (strlen(m->inputs [i]) + 1, sizeof (char)); 52 | strcpy (c->inputs[i], m->inputs [i]); 53 | c->nodes[id] = calloc (1,sizeof(struct node_)); 54 | setNode (c->nodes[id], "input", m->inputs [i], id); /*Set values of a node (type, name, id)*/ 55 | id++; 56 | } 57 | for (i=0; i < c->outputcount; i++) { /*Store the names of outputs*/ 58 | c->outputs[i] = calloc (strlen(m->outputs [i]) + 1, sizeof(char)); 59 | strcpy (c->outputs[i], m->outputs [i]); 60 | c->nodes[id] = calloc (1,sizeof(struct node_)); 61 | setNode (c->nodes[id], "output", m->outputs [i], id); /*Set values of a node (type, name, id)*/ 62 | id++; 63 | } 64 | for (i=0; i < c->wirecount; i++) { /*Store the names of wires*/ 65 | c->nodes[id] = calloc (1,sizeof(struct node_)); 66 | setNode (c->nodes[id], "wire", m->wires [i], id); /*Set values of a node (type, name, id)*/ 67 | id++; 68 | } 69 | for (i=0; i < c->gatecount; i++) { /*Store the names of gates*/ 70 | c->nodes[id] = calloc (1,sizeof(struct node_)); 71 | setNode (c->nodes[id], "gate", m->gates [i], id); /*Set values of a node (type, name, id)*/ 72 | id++; 73 | } 74 | 75 | c->nodecount = id; 76 | 77 | while (fgets(linebuf,LINESIZE-1,verilog) != NULL) { /*Create wires: gate_type [gate_name](out_port, in_port...)*/ 78 | char *keyword = NULL; /*Keyword from verilog line*/ 79 | 80 | i=0; 81 | in=0; 82 | memset (buffer,0,sizeof(char) * BUFSIZE); /*Clear the buffer*/ 83 | strcpy (tmpbuf,linebuf); 84 | token[0] = strtok(tmpbuf, " [()],;"); /*Get 1st keyword from the line*/ 85 | keyword = trim(token[0]); 86 | 87 | if (!reserved (keyword)) continue; /*Skip any comment lines, empty lines or spaces*/ 88 | if (end_of_module (linebuf)) break; /*If end of module is reached then break*/ 89 | if (!gate (keyword)) continue; /*Skip everything but gates*/ 90 | 91 | strcat (buffer,linebuf); 92 | 93 | while (!end_of_line(linebuf)) { /*Check if the line ends with a ';' character (Multiple lines statement)*/ 94 | if (fgets(linebuf,LINESIZE,verilog) != NULL) /*Otherwise, append all the following lines until ';' is found*/ 95 | strcat (buffer,linebuf); 96 | } 97 | 98 | token[0] = strtok(buffer, " [()],;"); /*Tokenize the line to extract data*/ 99 | while(token[i]!= NULL) { 100 | i++; 101 | token[i] = strtok(NULL, " [()],;\r\n"); 102 | } 103 | 104 | 105 | /*A. Create wires for all the gate inputs*/ 106 | for(j = 2; j < i-1; j++) { 107 | if (!defined (c,token[j])) { /*If wire is not already defined*/ 108 | c->wires[index] = (wire)calloc(1,sizeof(struct wire_)); 109 | build_wire (c, c->wires[index], "I", token[j]); 110 | c->wires[index]->outputs[0] = getID (token[1], c);/*1/29/15 assign out to I wires*/ 111 | c->wires[index]->outputcount = 1; 112 | index++; 113 | } 114 | } 115 | 116 | /*B. Create a wire for the gate*/ 117 | c->wires[index] = (wire)calloc(1,sizeof(struct wire_)); 118 | build_wire (c, c->wires[index], keyword, token[1]); 119 | /*B1. Assign the gate inputs*/ 120 | in = 0; 121 | for(j = 2; j < i-1; j++) { 122 | c->wires[index]->inputs[in] = getID (token[j], c); 123 | c->wires[index]->inputcount++; 124 | in++; 125 | } 126 | /*B2. Assign the gate output*/ 127 | c->wires[index]->outputs[0] = getID (token[i-1], c); 128 | c->wires[index]->outputcount = 1; 129 | index++; 130 | 131 | /*C. Create wires for the gate output*/ 132 | if (!defined (c,token[i-1])) { /*If wire is not already defined*/ 133 | c->wires[index] = (wire)calloc(1,sizeof(struct wire_)); 134 | build_wire (c, c->wires[index], "I", token[i-1]); 135 | c->wires[index]->inputs[0] = getID (token[1], c);/*1/29/15 assign in to I wires*/ 136 | c->wires[index]->inputcount = 1; 137 | index++; 138 | } 139 | 140 | else { /*If wire is already defined*/ 141 | getWireByName(token[i-1],c)->inputs[0] = getID (token[1], c);/*Find the wire and attach an input to it (10/30/2015) */ 142 | getWireByName(token[i-1],c)->inputcount = 1; 143 | } 144 | 145 | memset(linebuf, 0, sizeof(char) * LINESIZE); 146 | memset(tmpbuf, 0, sizeof(char) * LINESIZE); 147 | memset(buffer, 0, sizeof(char) * BUFSIZE); 148 | memset(token, 0, sizeof(char*) * TOKENSIZE); 149 | 150 | }//End while 151 | 152 | c->wirecount = index; 153 | 154 | } /*End build_module_circuit*/ 155 | 156 | 157 | 158 | /** 159 | * Parse a signal vector 160 | * @param a collection of signals, a collection of tokens, a pointer to the index, a pointer to the number of counts 161 | */ 162 | void parse_signal_vector (char *signal_arr[], char *token[], int *index, int *count) 163 | { 164 | int v,v1,v2; 165 | char *sig_vector; /*Array to hold tokens for the line*/ 166 | sig_vector = strtok (token[*index],":"); /*Tokenize the vector to extract vector width*/ 167 | v1 = atoi(sig_vector); /*Starting index for the vector*/ 168 | sig_vector = strtok (NULL, ":"); 169 | v2 = atoi(sig_vector); /*Ending index for the vector*/ 170 | (*index)++; /*Get vector name from the next token*/ 171 | for(v = v2; v <= v1; v++) { /*Add the vector signals to the array of signals*/ 172 | int wordsize = strlen(token[*index]); /*Size of the string read from the line*/ 173 | signal_arr [*count] = calloc (wordsize + 1, sizeof(char)); /*Allocating memory for signal string*/ 174 | strcpy (signal_arr [*count], token[*index]); /*Add the signal name to the array of signals*/ 175 | (*count)++; /*Update the number of signals in the circuit*/ 176 | } 177 | } 178 | 179 | /** 180 | * Parses a verilog file and extract modules statistical data 181 | * @param the name of the verilog file, the module object 182 | */ 183 | void build_module (FILE *verilog, module m) 184 | { 185 | int i=0, j=0; /*Indexes*/ 186 | char linebuf[LINESIZE], tmpbuf[LINESIZE], buffer[BUFSIZE]; /*Buffer for lines of the verilog code*/ 187 | char *token[TOKENSIZE]; /*Array to hold tokens for the line*/ 188 | char *keyword; /*Keyword from verilog line*/ 189 | 190 | /*Make first pass to count primary inputs, primary outputs, and wires.*/ 191 | while (fgets(linebuf,LINESIZE,verilog) != NULL) { 192 | i=0; 193 | strcpy (buffer,""); /*Clear the buffer*/ 194 | strcpy (tmpbuf,linebuf); 195 | token[0] = strtok(tmpbuf, " [()],;"); /*Get 1st keyword from the line*/ 196 | keyword = trim(token[0]); 197 | if (!reserved (keyword)) continue; /*skip comment lines, empty lines or spaces*/ 198 | 199 | strcat (buffer,linebuf); 200 | while (!end_of_line(linebuf)) { /*Check if the line ends with a ';' character (Multiple lines statement)*/ 201 | if (end_of_module (linebuf)) break; /*If end of module*/ 202 | if (fgets(linebuf,LINESIZE,verilog) != NULL) /*Otherwise, append all the following lines*/ 203 | strcat (buffer,linebuf); 204 | } 205 | 206 | token[0] = strtok(buffer, " [()],;"); /*Tokenize the line to extract data*/ 207 | while(token[i]!= NULL) { 208 | i++; 209 | token[i] = strtok(NULL, " [()],;\r\n"); 210 | } 211 | 212 | if (strcmp(keyword, "module")==0) { /*MODULES*/ 213 | m->name = calloc (strlen(token[1]) + 1, sizeof(char)); /*Allocating memory for module name string*/ 214 | strcpy (m->name,token[1]); /*Set module name*/ 215 | } 216 | 217 | else if (strcmp(keyword, "input")==0) { /*INPUTS*/ 218 | for(j = 1; j < i; j++) { /*Parse all the words in the line*/ 219 | if (signal_vector(token[j])) /*Handle a vector of signals*/ 220 | parse_signal_vector (m->inputs, token, &j, &m->inputcount); 221 | else { /*Not a vector of signal*/ 222 | m->inputs [m->inputcount] = calloc (strlen(token[j]) + 1, sizeof(char)); /*Allocating memory for input string*/ 223 | strcpy (m->inputs [m->inputcount],token[j]); /*Add the input name to the array of inputs*/ 224 | m->inputcount ++; /*Update the number of inputs in the circuit*/ 225 | } 226 | } 227 | } 228 | 229 | else if (strcmp(keyword, "output")==0) { /*OUTPUTS*/ 230 | for(j = 1; j < i; j++) { /*Parse all the words in the line*/ 231 | if (signal_vector(token[j])) /*Handle a vector of signals*/ 232 | parse_signal_vector (m->outputs, token, &j, &m->outputcount); 233 | else { /*Not a vector of signal*/ 234 | m->outputs [m->outputcount] = calloc (strlen(token[j]) + 1, sizeof(char)); /*Allocating memory for output string*/ 235 | strcpy (m->outputs [m->outputcount],token[j]); /*Add the output name to the array of outputs*/ 236 | m->outputcount ++; /*Update the number of outputs in the circuit*/ 237 | } 238 | } 239 | } 240 | 241 | else if (strcmp(keyword, "wire")==0) { /*WIRES*/ 242 | for(j = 1; j < i; j++) { /*Parse all the words in the line*/ 243 | if (signal_vector(token[j])) /*Handle a vector of signals*/ 244 | parse_signal_vector (m->wires, token, &j, &m->wirecount); 245 | else { /*Not a vector of signal*/ 246 | m->wires [m->wirecount] = calloc (strlen(token[j]) + 1, sizeof(char)); /*Allocating memory for wire string*/ 247 | strcpy (m->wires [m->wirecount],token[j]); /*Add the wire name to the array of wires*/ 248 | m->wirecount ++; /*Update the number of wires in the circuit*/ 249 | } 250 | } 251 | } 252 | 253 | else if (strcmp(keyword, "reg")==0) { /*REGS*/ 254 | for(j = 1; j < i; j++) { /*Parse all the words in the line*/ 255 | if (signal_vector(token[j])) /*Handle a vector of signals*/ 256 | parse_signal_vector (m->regs, token, &j, &m->regcount); 257 | else { /*Not a vector of signal*/ 258 | m->regs [m->regcount] = calloc (strlen(token[j]) + 1, sizeof(char)); /*Allocating memory for reg string*/ 259 | strcpy (m->regs [m->regcount],token[j]); /*Add the reg name to the array of regs*/ 260 | m->regcount ++; /*Update the number of regs in the circuit*/ 261 | } 262 | } 263 | } 264 | 265 | else if (gate (keyword)) { /*GATES*/ 266 | m->gates[m->gatecount] = calloc (strlen(token[1]) + 1, sizeof(char)); /*Allocating memory for module name string*/ 267 | strcpy (m->gates [m->gatecount], token[1]); /*Add the module name to the array of modules*/ 268 | m->gatecount ++; /*Update the number of modules in the circuit*/ 269 | } 270 | 271 | else if (end_of_module (linebuf)) /*END OF MODULE*/ 272 | { 273 | print_module_summary(m); /*Print summary of the module*/ 274 | break; /*End of the module; break*/ 275 | } 276 | } // end while 277 | 278 | } /*end build_modules*/ 279 | 280 | /** 281 | * Parses a verilog file and create a circuit object using the module 282 | * @param the circuit object, the file name 283 | */ 284 | void parse_verilog_file (circuit c, char *filename) 285 | { 286 | FILE *verilog; /* Verilog file */ 287 | int i = 0; 288 | verilog = fopen(filename, "r"); /* Open Verilog file */ 289 | if (!verilog) { 290 | fprintf(stderr,"transfer: cannot open file \"%s\"\n",filename); 291 | exit(1); 292 | } 293 | 294 | module m = (module)calloc(1, sizeof(struct module_)); /*Declare an instance of a module*/ 295 | build_module (verilog, m); /*Create module object*/ 296 | rewind(verilog); /*Sets the stream position indicator to the beginning of verilog file.*/ 297 | build_module_circuit (verilog, m, c); /*Create circuit object using the module*/ 298 | 299 | /*Free Memory*/ 300 | 301 | for (i = 0; i < m->outputcount; i++) 302 | free (m->outputs[i]); 303 | 304 | for (i = 0; i < m->inputcount; i++) 305 | free (m->inputs[i]); 306 | 307 | for (i = 0; i < m->wirecount; i++) 308 | free (m->wires[i]); 309 | 310 | for (i = 0; i < m->gatecount; i++) 311 | free (m->gates[i]); 312 | 313 | free (m->name); 314 | free (m); /*Free module memory*/ 315 | 316 | fclose(verilog); 317 | 318 | /*End Free Memory*/ 319 | } 320 | 321 | /** 322 | * Main program 323 | * @param argc, *argv[] 324 | */ 325 | int main (int argc, char *argv[]) 326 | { 327 | int i; 328 | if (argc != 2) { 329 | printf("Usage: ./verilog-parser \n"); /* Check for a verilog input file */ 330 | exit(1); 331 | } 332 | circuit c = (circuit)calloc(1,sizeof(struct circuit_)); /*Declare an instance of a circuit */ 333 | 334 | c->name = strdup(argv[1]); /*Set circuit name*/ 335 | 336 | parse_verilog_file (c, c->name); /*Parse the verilog file */ 337 | 338 | print_circuit_summary (c); /*Print summary of the circuit */ 339 | 340 | /*Free memory*/ 341 | for (i=0; i < c->outputcount; i++) 342 | free (c->outputs[i]); 343 | 344 | for (i=0; i < c->inputcount; i++) 345 | free (c->inputs[i]); 346 | 347 | for (i=0; i < c->nodecount; i++) 348 | free (c->nodes[i]); 349 | free(c->nodes); 350 | 351 | for (i=0; i < c->wirecount; i++) { 352 | free (c->wires[i]->name); 353 | free (c->wires[i]->type); 354 | free (c->wires[i]); 355 | } 356 | free(c->wires); 357 | 358 | free (c->name); 359 | free (c); /*Deallocate memory used by the circuit*/ 360 | 361 | return 0; 362 | } 363 | -------------------------------------------------------------------------------- /verilog/c17.v: -------------------------------------------------------------------------------- 1 | // Verilog 2 | // c17 3 | // Ninputs 5 4 | // Noutputs 2 5 | // NtotalGates 6 6 | // NAND2 6 7 | 8 | module c17 (N1,N2,N3,N6,N7,N22,N23); 9 | 10 | input N1,N2,N3,N6,N7; 11 | 12 | output N22,N23; 13 | 14 | wire N10,N11,N16,N19; 15 | 16 | nand NAND2_1 (N10, N1, N3); 17 | nand NAND2_2 (N11, N3, N6); 18 | nand NAND2_3 (N16, N2, N11); 19 | nand NAND2_4 (N19, N11, N7); 20 | nand NAND2_5 (N22, N10, N16); 21 | nand NAND2_6 (N23, N16, N19); 22 | 23 | endmodule 24 | -------------------------------------------------------------------------------- /verilog/code: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | We, as contributors and maintainers, pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 4 | 5 | ## Our Standards 6 | 7 | Examples of behavior that contributes to creating a positive environment include: 8 | 9 | - Using welcoming and inclusive language 10 | - Being respectful of differing viewpoints and experiences 11 | - Gracefully accepting constructive criticism 12 | - Focusing on what is best for the community 13 | - Showing empathy towards other community members 14 | 15 | Examples of unacceptable behavior by participants include: 16 | 17 | - The use of sexualized language or imagery and unwelcome sexual attention or advances 18 | - Trolling, insulting/derogatory comments, and personal or political attacks 19 | - Public or private harassment 20 | - Publishing others' private information, such as a physical or electronic address, without explicit permission 21 | - Other conduct which could reasonably be considered inappropriate in a professional setting 22 | 23 | ## Our Responsibilities 24 | 25 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 26 | 27 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 28 | 29 | ## Scope 30 | 31 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 32 | 33 | ## Enforcement 34 | 35 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [contact@email.com](mailto:contact@email.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 36 | 37 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 38 | --------------------------------------------------------------------------------