├── .codedocs ├── .gitignore ├── .gitmodules ├── docs ├── groups.dox ├── CMakeLists.txt ├── footer.html ├── header.html ├── veridoc-configs.dox ├── file-manifests.dox ├── Doxyfile └── stylesheet.css ├── src ├── assets │ ├── veridoc.cfg │ ├── module.html │ ├── style.css │ ├── test_manifest.txt │ ├── list.html │ └── script.js ├── veridoc-types.h ├── veridoc-parsing.h ├── veridoc.h ├── veridoc-config.h ├── veridoc-manifest.h ├── veridoc-page-factory.h ├── CMakeLists.txt ├── veridoc-manifest.c ├── veridoc-parsing.c ├── veridoc-json.h ├── main.c ├── veridoc-json.c ├── veridoc-config.c └── veridoc-page-factory.c ├── CMakeLists.txt ├── bin └── project.sh ├── README.md ├── .travis.yml ├── Makefile ├── scratchpad.md └── LICENSE.txt /.codedocs: -------------------------------------------------------------------------------- 1 | DOXYFILE = ./docs/Doxyfile 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | build/ 3 | *~ 4 | *.vim 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/verilog-parser"] 2 | path = src/verilog-parser 3 | url = https://github.com/ben-marshall/verilog-parser.git 4 | -------------------------------------------------------------------------------- /docs/groups.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | @defgroup veridoc-documentation Documentation 4 | @{ 5 | 6 | @brief Top level group for all pages documenting veridoc, but which do not 7 | relate specifically to code. 8 | 9 | @} 10 | 11 | 12 | */ 13 | -------------------------------------------------------------------------------- /src/assets/veridoc.cfg: -------------------------------------------------------------------------------- 1 | project = OpenSPARC T1 Documentation 2 | author = Ben 3 | version = 1.4.1a 4 | manifest = ./build/debug/bin/assets/test_manifest.txt 5 | output = ./build/veridoc-out/ 6 | top_module = sparc 7 | assets_dir = ./build/debug/bin/assets/ 8 | include = ./ 9 | include = ./src/verilog-parser/tests/ 10 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | project(verilog-doc) 4 | 5 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 6 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 7 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 8 | 9 | enable_testing() 10 | 11 | add_subdirectory(./src) 12 | add_subdirectory(./docs) 13 | -------------------------------------------------------------------------------- /src/veridoc-types.h: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-types.h 3 | @brief Contains type definitions used globally by the program. 4 | */ 5 | 6 | #include "verilog-parser/src/verilog_parser.h" 7 | 8 | #ifndef VERIDOC_TYPES_H 9 | #define VERIDOC_TYPES_H 10 | 11 | //! A simple boolean type. 12 | typedef enum boolean_e{ 13 | BOOL_TRUE = 1, 14 | BOOL_FALSE = 0 15 | } boolean; 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | project(verilog-doc-docs) 4 | 5 | find_package(Doxygen) 6 | if(DOXYGEN_FOUND) 7 | add_custom_target(veridoc-docs 8 | ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile 9 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 10 | COMMENT "Generating API documentation with Doxygen" VERBATIM 11 | ) 12 | endif(DOXYGEN_FOUND) 13 | 14 | -------------------------------------------------------------------------------- /docs/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /bin/project.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "------------------- Setting Up Verilog-Doc Workspace -----------------" 4 | 5 | git submodule update --init --recursive 6 | 7 | rm -rf ./build 8 | 9 | mkdir -p ./build/ 10 | mkdir -p ./build/debug 11 | mkdir -p ./build/coverage 12 | mkdir -p ./build/docs 13 | 14 | cd ./build/debug 15 | cmake -DCMAKE_BUILD_TYPE=Debug ../../ 16 | cd - 17 | 18 | cd ./build/coverage 19 | cmake -DCMAKE_BUILD_TYPE=Debug -DVERIDOC_COVERAGE=YES ../../ 20 | cd - 21 | 22 | echo "----------------------- Workspace setup complete ---------------------" 23 | 24 | -------------------------------------------------------------------------------- /src/veridoc-parsing.h: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-parsing.h 3 | @brief Contains data structures and functions for parsing verilog files. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "veridoc-types.h" 11 | #include "veridoc-manifest.h" 12 | #include "veridoc-config.h" 13 | 14 | #ifndef VERIDOC_PARSING_H 15 | #define VERIDOC_PARSING_H 16 | 17 | /*! 18 | @brief Responsible for parsing each file in the manifest, and building the 19 | internal source tree. 20 | @param [in] manifest - The set of files to parse and directories to search. 21 | @returns The parsed source tree object. 22 | */ 23 | verilog_source_tree * veridoc_parse_input_source( 24 | veridoc_manifest * manifest, 25 | veridoc_config * config 26 | ); 27 | 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Verilog Doc 3 | 4 | [![Documentation](https://codedocs.xyz/ben-marshall/verilog-doc.svg)](https://codedocs.xyz/ben-marshall/verilog-doc/) 5 | [![Build Status](https://travis-ci.org/ben-marshall/verilog-doc.svg?branch=master)](https://travis-ci.org/ben-marshall/verilog-doc) 6 | [![Coverage Status](https://coveralls.io/repos/github/ben-marshall/verilog-doc/badge.svg?branch=master)](https://coveralls.io/github/ben-marshall/verilog-doc?branch=master) 7 | ![Licence: MIT](https://img.shields.io/badge/License-MIT-blue.svg) 8 | 9 | --- 10 | 11 | This project aims to provide a Doxygen-like tool for the Verilog Hardware 12 | Description Language (HDL). 13 | 14 | It is currently under heavy development, and in the early stages of 15 | construction. None the less, it can parse input source trees and spit out a 16 | module hierarchy and file list, as well as document a modules ports. 17 | 18 | --- 19 | -------------------------------------------------------------------------------- /src/veridoc.h: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-dot.h 3 | @brief Contains common data structures and functions used by the program 4 | */ 5 | 6 | #include 7 | 8 | #include "veridoc-types.h" 9 | #include "veridoc-config.h" 10 | #include "veridoc-manifest.h" 11 | #include "veridoc-parsing.h" 12 | #include "veridoc-page-factory.h" 13 | 14 | #ifndef VERIDOC_H 15 | #define VERIDOC_H 16 | 17 | /*! 18 | @brief Stores all of the command line arguments to the program 19 | @see parse_args 20 | */ 21 | typedef struct shell_args_t{ 22 | boolean verbose; //!< Be verbose with status messages? 23 | char * config_path; //!< Path to config file. 24 | char * manifest_path; //!< Path to input file list. 25 | } shell_args; 26 | 27 | /*! 28 | @brief Responsible for parsing all of the command line arguments. 29 | @returns A shell_args pointer 30 | */ 31 | shell_args * parse_args(int argc, char ** argv); 32 | 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: 2 | - cpp 3 | 4 | compiler: 5 | - gcc 6 | 7 | os: 8 | - linux 9 | 10 | install: 11 | - sudo apt-get update -qq 12 | - sudo apt-get install -qq flex build-essential lcov 13 | - wget http://mirrors.kernel.org/ubuntu/pool/main/b/bison/bison_3.0.4.dfsg-1_amd64.deb 14 | - wget http://ftp.us.debian.org/debian/pool/main/b/bison/libbison-dev_3.0.4.dfsg-1_amd64.deb 15 | - sudo dpkg -i libbison-dev_3.0.4.dfsg-1_amd64.deb 16 | - sudo dpkg -i bison_3.0.4.dfsg-1_amd64.deb 17 | - sudo pip install cpp-coveralls 18 | 19 | before_script: 20 | - cd ./src/verilog-parser/tests 21 | - source ../bin/setup-tests.sh 22 | - cd - 23 | - make setup 24 | 25 | script: 26 | - make debug 27 | - make coverage 28 | - make test-debug 29 | - make test-coverage 30 | 31 | after_success: 32 | - echo "Success" 33 | - coveralls -b ./build/coverage/src/CMakeFiles/veridoccore.dir/ 34 | - coveralls -b ./build/coverage/src/CMakeFiles/veridoc.dir/ 35 | 36 | after_failure: 37 | - echo "Failure" 38 | 39 | after_script: 40 | - echo "Script Finished." 41 | 42 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # This is a simple top-level wrapper makefile for the rest of the project. 4 | # 5 | 6 | all: docs debug coverage 7 | 8 | .PHONY: docs setup clean 9 | 10 | setup: 11 | ./bin/project.sh 12 | 13 | docs: 14 | $(MAKE) -C ./build/debug -B veridoc-docs 15 | 16 | debug: 17 | $(MAKE) -C ./build/debug veridoc parser 18 | 19 | coverage: 20 | $(MAKE) -C ./build/coverage veridoc parser 21 | 22 | clean: 23 | $(MAKE) -C ./build/coverage clean 24 | $(MAKE) -C ./build/debug clean 25 | rm -rf ./build/docs 26 | 27 | 28 | test-all: test-debug test-coverage 29 | 30 | test-debug: debug 31 | $(MAKE) -C ./build/debug test 32 | 33 | test-coverage: coverage 34 | $(MAKE) -C ./build/coverage test 35 | 36 | test-coverage-report: test-coverage 37 | cd ./build/coverage/src/CMakeFiles/veridoccore.dir/ ; \ 38 | gcov -abcf *.o ; \ 39 | lcov --directory . -c -o cov.info -t "veridoc" ; \ 40 | genhtml -o ../../../../cov-report -t "veridoc" --num-spaces 4 cov.info 41 | @echo "Coverage report available in:" 42 | @echo "./build/cov-report/index.html" 43 | -------------------------------------------------------------------------------- /scratchpad.md: -------------------------------------------------------------------------------- 1 | 2 | # Scratchpad 3 | 4 | A file of todo-lists, notes, and other useful stuff. 5 | 6 | --- 7 | 8 | ## Todo List: 9 | 10 | ### Features 11 | 12 | - [X] A `-I` flag for parser include directories. 13 | - [X] File name sourcing for each construct. 14 | - [X] Better library for JSON emission. 15 | - [ ] Module Page JSON Emission 16 | - [ ] Nets 17 | - [ ] Ports 18 | - [ ] Parameters 19 | - [ ] Functions / Tasks 20 | - [ ] Instantiations 21 | - [ ] Processes / Blocks 22 | - [X] Module Page JSON Rendering 23 | - [X] HTML "Distribution" creation 24 | 25 | ### Build / Flow 26 | 27 | - [X] Coverage Checking 28 | - [X] Travis Build Integration 29 | - [X] Proper testing framework 30 | - [X] Coveralls integration 31 | - [X] A top-level makefile for quick / easy access to stuff. 32 | 33 | --- 34 | 35 | ## Program Stages 36 | 37 | 1. Load Command Line Arguments 38 | 2. Load configuration file if any. 39 | 3. Parse input files. 40 | 4. Organise parsed data structures. 41 | 5. Generate Pages 42 | - File List 43 | - Module List 44 | - Module Hierarchy 45 | - Module Pages 46 | 6. Cleanup 47 | 48 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Ben Marshall 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | $projectname: $title 9 | $title 10 | 11 | 12 | 13 | $treeview 14 | $search 15 | $mathjax 16 | 17 | $extrastylesheet 18 | 19 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/veridoc-configs.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | @defgroup veridoc-configs Veridoc Configuration Files 4 | @ingroup veridoc-documentation 5 | 6 | @tableofcontents 7 | 8 | @brief This page describes how veridoc configuration files are structured, 9 | loaded and interpreted. 10 | 11 | @section veridoc-configs-file-format File Format 12 | 13 | Veridoc config files are simple key, value pairs, separated by linebreaks. 14 | They take the form `key = value`. Where a the 'value' supplied is a string, 15 | leading and trailing spaces will be stripped from the value, and no quote 16 | marks are needed. An example file might look like this: 17 | 18 | project = RISC-V Microarchitecture Documentation 19 | author = Ben 20 | version = 1.4.1a 21 | manifest = /work/riscv/core/design/manifest.txt 22 | output = ./veridoc-out/ 23 | top_module = sparc 24 | assets_dir = ./assets/ 25 | 26 | 27 | Comments can be added by making the *first* character of a line a hash "#". 28 | Comments are not allowed to begin part way through a line. 29 | 30 | @section veridoc-configs-representation Data Structure 31 | 32 | A config file is represented in memory by the @ref veridoc_config structure. 33 | The files are parsed into memory by the @ref veridoc_config_parse function. 34 | 35 | @section veridoc-configs-fields Data Fields 36 | 37 | @see veridoc_config 38 | 39 | */ 40 | -------------------------------------------------------------------------------- /src/veridoc-config.h: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-config.h 3 | @brief Contains data structures and functions for parsing veridoc configs. 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "verilog-parser/src/verilog_ast_common.h" 11 | 12 | #ifndef VERIDOC_CONFIG_H 13 | #define VERIDOC_CONFIG_H 14 | 15 | /*! 16 | @brief Contains all of the configuration options for a run of veridoc. 17 | */ 18 | typedef struct veridoc_config_t{ 19 | 20 | char * v_project; //!< Project / Documentation Set Title. 21 | char * v_author; //!< Documentation Authors 22 | char * v_version; //!< Version Number 23 | char * v_manifest; //!< File manifest path. 24 | char * v_output; //!< Folder to put the results in. 25 | char * v_top_module; //!< The root module of the hierarchy. 26 | char * v_assets_dir; //!< Where to look for template files. 27 | ast_list * v_includes; //!< Include folders for header files. 28 | } veridoc_config; 29 | 30 | 31 | /*! 32 | @brief Parses and returns the config file at the supplied path. 33 | @param [in] config_file_path 34 | @param [in] exe_path - the value of argv[0] 35 | @returns A pointer to the supplied config structure or NULL if the file cannot 36 | be opened or parsed. 37 | */ 38 | veridoc_config * veridoc_config_parse( 39 | char * config_file_path, 40 | char * exe_path 41 | ); 42 | 43 | /*! 44 | @brief Frees the memory allocated to the supplied config file. 45 | */ 46 | void veridoc_config_free( 47 | veridoc_config * tofree 48 | ); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /docs/file-manifests.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | @defgroup veridoc-manifests Veridoc Manifest Files 4 | @ingroup veridoc-documentation 5 | 6 | @tableofcontents 7 | 8 | @brief This page describes how veridoc manifest files are structured, 9 | loaded and interpreted. 10 | 11 | @details 12 | 13 | Manifest files specify the various input files to be parsed and documented. 14 | They also specify the directories which should be included to look for 15 | header files in. 16 | 17 | @section veridoc-manifest-file-format File Format 18 | 19 | These are very simple line-delimited file or folder paths. They can include 20 | comments, which start with a hash on the first character of a line. 21 | An example manifest might look like this: 22 | 23 | # Include file locations 24 | ./design/ 25 | ./design/alu/alu 26 | 27 | # Source files to include 28 | ./design/alu/alu_add.v 29 | ./design/alu/alu_mul.v 30 | ./design/alu/alu_div.v 31 | ./design/alu/alu_shift.v 32 | ./design/alu/alu_top.v 33 | 34 | It should be noted that files are read in the order that they are entered 35 | in the manifest file. Hence in the example above, `alu_top` is free to 36 | reference the other files, but `alu_mul` cannot depend on `alu_shift`. 37 | 38 | @section veridoc-manifest-representation Data Structure 39 | 40 | The manifest files are represented as lists of directories and files inside 41 | the @ref veridoc_manifest structure. This is created and free'd using the 42 | @ref veridoc_manifest_parse and @ref veridoc_manifest_free functions 43 | respectively. 44 | 45 | */ 46 | 47 | -------------------------------------------------------------------------------- /src/veridoc-manifest.h: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-manifest.h 3 | @brief Contains common data structures and functions used on the 4 | file manifests 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include "veridoc-types.h" 16 | 17 | #ifndef VERIDOC_MANIFEST_H 18 | #define VERIDOC_MANIFEST_H 19 | 20 | /*! 21 | @brief A description of a directory to be included in the search path for 22 | header files. 23 | */ 24 | typedef struct veridoc_manifest_directory_t{ 25 | char * path; //!< The directory path 26 | } veridoc_manifest_directory; 27 | 28 | /*! 29 | @brief A description of a single file to be included in the parsed source 30 | tree. 31 | */ 32 | typedef struct veridoc_manifest_file_t{ 33 | char * path; //!< The file path 34 | boolean parsed; //!< Was the file parsed? 35 | boolean parse_success; //!< Did the file parse without errors? 36 | } veridoc_manifest_file; 37 | 38 | /*! 39 | @brief Contains a list of files to parse and document, and folders to search 40 | for header files in. 41 | */ 42 | typedef struct veridoc_manifest_t{ 43 | veridoc_manifest_directory * directories; //!< The folders to search. 44 | veridoc_manifest_file * files; //!< The files to parse. 45 | int file_count; //!< How many files are specified. 46 | int directory_count; //!< How many directories are specified. 47 | } veridoc_manifest; 48 | 49 | /*! 50 | @brief Parses the supplied manifest file and returns a representation of it. 51 | @param [in] path - The manifest file to parse. 52 | @returns A pointer to the manifest object, or NULL if the file could not be 53 | found or parsed. 54 | */ 55 | veridoc_manifest * veridoc_manifest_parse( 56 | char * path 57 | ); 58 | 59 | /*! 60 | @brief Frees a file manifest from memory. 61 | */ 62 | void veridoc_manifest_free( 63 | veridoc_manifest * tofree 64 | ); 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /src/veridoc-page-factory.h: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-page-factory.h 3 | @brief Declares functions and structures responsible for building the 4 | documentation pages. 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "veridoc-json.h" 13 | #include "veridoc-types.h" 14 | #include "veridoc-config.h" 15 | #include "veridoc-manifest.h" 16 | 17 | #ifndef VERIDOC_PAGE_FACTORY_H 18 | #define VERIDOC_PAGE_FACTORY_H 19 | 20 | /*! 21 | @brief Responsible for exporting the list of parsed files to a json data file. 22 | @param [in] manifest - The list of files. 23 | @param [in] destination - The file path to write to. 24 | @returns Void 25 | */ 26 | void veridoc_pf_export_file_list_json( 27 | veridoc_manifest * manifest, 28 | json_file * fh 29 | ); 30 | 31 | 32 | /*! 33 | @brief Responsible for emitting the list of modules for the project. 34 | */ 35 | void veridoc_pf_export_module_list_json( 36 | verilog_source_tree * source, 37 | json_file * fh 38 | ); 39 | 40 | 41 | /*! 42 | @brief Responsible for emitting the verilog module hierarchy as JSON. 43 | @param [in] top_module - The top level module / root of the hierarchy. 44 | @param [in] source - The parsed source tree 45 | */ 46 | json_object * veridoc_pf_export_hierarchy_json( 47 | ast_module_declaration * top_module, 48 | json_file * destination, 49 | unsigned int depth 50 | ); 51 | 52 | 53 | /*! 54 | @brief Top level function for exporting the whole parsed data set to html. 55 | @param [in] manifest - The list of files parsed. 56 | @param [in] config - Configuration options for the output. 57 | @param [in] source - The parsed source tree 58 | */ 59 | void veridoc_pf_build( 60 | veridoc_manifest * manifest, 61 | veridoc_config * config, 62 | verilog_source_tree * source 63 | ); 64 | 65 | /*! 66 | @brief Responsible for copying all template asset files to the output folder. 67 | */ 68 | void veridoc_pf_copy_assets( 69 | veridoc_config * config 70 | ); 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /src/assets/module.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Verilog Doc 5 | 6 | 7 | 8 | 9 | 10 | 23 | 24 | 59 | 60 | 61 | 62 | 63 |
64 | 72 |
73 |
74 |
75 |
76 | 77 |
  
78 | 79 |
80 |
88 | 89 |
90 | 91 |

Module Title

92 | 93 |
94 |

95 | Source: Defined on line of 96 | 97 |

98 |

99 | Description: 100 |

101 |
102 | 103 |
104 | 105 |
106 | Work In Progress 107 |
108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | project(veridoc-src) 4 | 5 | set(DISABLE_VERILOG_PARSER_TESTS ON) # disable subdirectory tests. 6 | add_subdirectory(./verilog-parser) 7 | 8 | set(VERIDOC_SRC main.c) 9 | set(VERIDOC_EXE veridoc) 10 | 11 | set(VERIDOC_CORE_SRC veridoc-config.c 12 | veridoc-parsing.c 13 | veridoc-manifest.c 14 | veridoc-page-factory.c 15 | veridoc-json.c) 16 | 17 | set(VERIDOC_CORE veridoccore) 18 | 19 | # ---------------------- Add build options ------------------------------- 20 | 21 | option(VERIDOC_COVERAGE "If YES, build the debug executable with coverage." NO) 22 | 23 | SET(COV_FLAGS_C "-fprofile-arcs -ftest-coverage") 24 | SET(COV_FLAGS_LINK "-fprofile-arcs -ftest-coverage") 25 | 26 | # ---------------------- Set build flags --------------------------------- 27 | 28 | SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -Wall -W") 29 | SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_C_FLAGS_RELEASE}") 30 | 31 | if( ${VERIDOC_COVERAGE} ) 32 | 33 | message(STATUS "Building with coverage flags set.") 34 | SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COV_FLAGS_C} -DVERIDOC_COVERAGE_ON") 35 | SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${COV_FLAGS_LINK}") 36 | else() 37 | message(STATUS "NOT building with coverage.") 38 | endif() 39 | 40 | 41 | SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") 42 | SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 43 | 44 | message(STATUS "Parser Build Flags Debug: ${CMAKE_C_FLAGS_DEBUG}") 45 | message(STATUS "Parser Link Flags Debug: ${CMAKE_EXE_LINKER_FLAGS_DEBUG}") 46 | message(STATUS "Parser Build Flags Release: ${CMAKE_C_FLAGS_RELEASE}") 47 | message(STATUS "Parser Link Flags Release: ${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 48 | 49 | # ---------------------- Add output libraries and files ------------------ 50 | 51 | add_library(${VERIDOC_CORE} ${VERIDOC_CORE_SRC}) 52 | 53 | add_executable(${VERIDOC_EXE} ${VERIDOC_SRC}) 54 | 55 | target_link_libraries(${VERIDOC_EXE} verilogparser) 56 | target_link_libraries(${VERIDOC_CORE} verilogparser) 57 | 58 | target_link_libraries(${VERIDOC_EXE} ${VERIDOC_CORE}) 59 | 60 | 61 | # Copy asset files. 62 | 63 | set(BIN_DIR_ASSETS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/assets) 64 | configure_file(assets/module.html ${BIN_DIR_ASSETS}/module.html) 65 | configure_file(assets/list.html ${BIN_DIR_ASSETS}/list.html ) 66 | configure_file(assets/script.js ${BIN_DIR_ASSETS}/script.js ) 67 | configure_file(assets/style.css ${BIN_DIR_ASSETS}/style.css ) 68 | configure_file(assets/veridoc.cfg ${BIN_DIR_ASSETS}/veridoc.cfg ) 69 | configure_file(assets/test_manifest.txt ${BIN_DIR_ASSETS}/test_manifest.txt ) 70 | 71 | # ---------------------- Add Tests --------------------------------------- 72 | 73 | if( ${VERIDOC_COVERAGE} ) 74 | 75 | set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1) 76 | 77 | add_test(NAME veridoc_coverage 78 | COMMAND veridoc -c ./build/debug/bin/assets/veridoc.cfg -F ./build/debug/bin/assets/test_manifest.txt -v 79 | WORKING_DIRECTORY ../ 80 | ) 81 | 82 | else () 83 | 84 | add_test(NAME veridoc_0 85 | COMMAND veridoc -c ./build/debug/bin/assets/veridoc.cfg -F ./build/debug/bin/assets/test_manifest.txt -v 86 | WORKING_DIRECTORY ../ 87 | ) 88 | 89 | endif() 90 | 91 | -------------------------------------------------------------------------------- /src/assets/style.css: -------------------------------------------------------------------------------- 1 | 2 | body{ 3 | padding:0px; 4 | margin: 0px; 5 | font-family: Verdana,sans-serif; 6 | font-size: 12pt; 7 | background-color: #F9F9F9; 8 | } 9 | 10 | .header{ 11 | background-color: #dddddd; 12 | width: 100%; 13 | position:fixed; 14 | top:0px; 15 | left:0px; 16 | right:0px; 17 | } 18 | 19 | .work-in-progress{ 20 | position: fixed; 21 | bottom: 0px; 22 | left: 0px; 23 | right: 0px; 24 | background-color: rgba(255,100,100,0.8);; 25 | font-color: white; 26 | font-weight: bold; 27 | padding: 7px; 28 | text-align: center; 29 | border-top: 1px solid grey; 30 | } 31 | 32 | .navbar-h{ 33 | list-style-type: none; 34 | margin: 0px; 35 | padding: 0px; 36 | overflow: hidden; 37 | background-color: #333333; 38 | } 39 | 40 | ul.navbar-h li{ 41 | float: left; 42 | } 43 | 44 | ul.navbar-h li:first-child{ 45 | display:block; 46 | color: white; 47 | padding: 14px 16px; 48 | text-decoration: none; 49 | font-weight: bolder; 50 | } 51 | 52 | ul.navbar-h li:last-child{ 53 | float: right; 54 | } 55 | 56 | ul.navbar-h li a{ 57 | display:block; 58 | color: white; 59 | padding: 14px 16px; 60 | text-decoration: none; 61 | } 62 | 63 | ul.navbar-h li a.active{ 64 | background-color: #EEEEEE; 65 | color: #222222; 66 | } 67 | 68 | ul.navbar-h li a:hover{ 69 | background-color: white; 70 | color: #222222; 71 | } 72 | 73 | .left-divider{ 74 | background-color: #333333; 75 | position: fixed; 76 | top:0px; 77 | bottom:0px; 78 | left:21%; 79 | z-index: -1; 80 | } 81 | 82 | .module-list{ 83 | float: left; 84 | width:20%; 85 | padding: 0px; 86 | } 87 | 88 | .module-list ul{ 89 | list-style-type: none; 90 | margin: 0px; 91 | margin-top: 3px; 92 | padding: 0px; 93 | padding-left: 7pt; 94 | } 95 | 96 | .module-list ul:first-child{ 97 | padding-left:0pt; 98 | } 99 | 100 | .module-list ul:last-child{ 101 | border: none; 102 | } 103 | 104 | .module-list ul a{ 105 | margin-top: 2px; 106 | display: block; 107 | width: 100%; 108 | padding: 4px; 109 | background-color: #CCCCCC; 110 | border-bottom: 1px solid #555555; 111 | text-decoration: none; 112 | color: #333333; 113 | } 114 | 115 | .module-list ul a.active{ 116 | background-color: orange; 117 | font-weight: bold; 118 | } 119 | 120 | .module-list ul a:hover{ 121 | background-color: #de7a28; 122 | } 123 | 124 | 125 | .page-content{ 126 | width: 54%; 127 | color: #222222; 128 | padding: 15px; 129 | margin-left:25px; 130 | margin-right:5px; 131 | float:left; 132 | } 133 | 134 | .centred{ 135 | padding: 15px; 136 | margin: auto; 137 | float: none; 138 | } 139 | 140 | .page-content .page-section{ 141 | margin-top: 15px; 142 | margin-bottom: 3px; 143 | padding: 5px; 144 | background-color: white; 145 | border-radius: 3px; 146 | } 147 | 148 | .page-content .page-section .page-section-title{ 149 | font-size: x-large; 150 | padding: 10px; 151 | padding-left:0px; 152 | border-bottom: 1px solid #AAAAAA; 153 | } 154 | 155 | .page-content .page-section .page-section-content{ 156 | font-size: normal; 157 | padding-top:5px; 158 | padding-bottom:5px; 159 | } 160 | 161 | 162 | -------------------------------------------------------------------------------- /src/assets/test_manifest.txt: -------------------------------------------------------------------------------- 1 | ./src/verilog-parser/tests/sparc_exu_eclcomp7.v 2 | ./src/verilog-parser/tests/sparc_exu_eclccr.v 3 | ./src/verilog-parser/tests/sparc_ifu_sscan.v 4 | ./src/verilog-parser/tests/sparc_ifu_lfsr5.v 5 | ./src/verilog-parser/tests/sparc_exu_aluor32.v 6 | ./src/verilog-parser/tests/sparc_exu_ecl.v 7 | ./src/verilog-parser/tests/sparc_tlu_intctl.v 8 | ./src/verilog-parser/tests/sparc_ifu_par16.v 9 | ./src/verilog-parser/tests/sparc_exu_byp_eccgen.v 10 | ./src/verilog-parser/tests/sparc_tlu_dec64.v 11 | ./src/verilog-parser/tests/sparc_exu_aluzcmp64.v 12 | ./src/verilog-parser/tests/sparc_exu_aluadder64.v 13 | ./src/verilog-parser/tests/sparc_exu_alu.v 14 | ./src/verilog-parser/tests/sparc_ifu_ifqdp.v 15 | ./src/verilog-parser/tests/sparc_ifu_errctl.v 16 | ./src/verilog-parser/tests/sparc_exu_rml.v 17 | ./src/verilog-parser/tests/bw_clk_cl_sparc_cmp.v 18 | ./src/verilog-parser/tests/sparc_ffu_dp.v 19 | ./src/verilog-parser/tests/sparc_ifu_fdp.v 20 | ./src/verilog-parser/tests/sparc_ifu_mbist.v 21 | ./src/verilog-parser/tests/sparc_exu_eclbyplog.v 22 | ./src/verilog-parser/tests/sparc_ifu_swl.v 23 | ./src/verilog-parser/tests/sparc_exu_ecl_cnt6.v 24 | ./src/verilog-parser/tests/sparc_ifu_ctr5.v 25 | ./src/verilog-parser/tests/sparc_mul_top.v 26 | ./src/verilog-parser/tests/sparc_exu_ecl_divcntl.v 27 | ./src/verilog-parser/tests/sparc_exu_shft.v 28 | ./src/verilog-parser/tests/sparc_ifu_thrcmpl.v 29 | ./src/verilog-parser/tests/sparc_ffu_vis.v 30 | ./src/verilog-parser/tests/sparc.v 31 | ./src/verilog-parser/tests/sparc_exu_byp.v 32 | ./src/verilog-parser/tests/sparc_exu_alu_16eql.v 33 | ./src/verilog-parser/tests/sparc_ifu_invctl.v 34 | ./src/verilog-parser/tests/sparc_exu_div_32eql.v 35 | ./src/verilog-parser/tests/sparc_exu_div_yreg.v 36 | ./src/verilog-parser/tests/sparc_ffu.v 37 | ./src/verilog-parser/tests/sparc_ifu_rndrob.v 38 | ./src/verilog-parser/tests/sparc_exu_ecc_dec.v 39 | ./src/verilog-parser/tests/sparc_ffu_ctl.v 40 | ./src/verilog-parser/tests/sparc_exu_ecl_mdqctl.v 41 | ./src/verilog-parser/tests/sparc_ifu_dec.v 42 | ./src/verilog-parser/tests/sparc_ifu_par34.v 43 | ./src/verilog-parser/tests/sparc_exu_aluspr.v 44 | ./src/verilog-parser/tests/sparc_exu_reg.v 45 | ./src/verilog-parser/tests/sparc_ifu_thrfsm.v 46 | ./src/verilog-parser/tests/sparc_pipe_flow.v 47 | ./src/verilog-parser/tests/sparc_ifu_imd.v 48 | ./src/verilog-parser/tests/sparc_exu.v 49 | ./src/verilog-parser/tests/sparc_ifu_incr46.v 50 | ./src/verilog-parser/tests/sparc_ifu_cmp35.v 51 | ./src/verilog-parser/tests/sparc_exu_rml_inc3.v 52 | ./src/verilog-parser/tests/sparc_ffu_ctl_visctl.v 53 | ./src/verilog-parser/tests/sparc_exu_aluaddsub.v 54 | ./src/verilog-parser/tests/sparc_exu_rml_cwp.v 55 | ./src/verilog-parser/tests/sparc_ffu_part_add32.v 56 | ./src/verilog-parser/tests/sparc_exu_ecl_wb.v 57 | ./src/verilog-parser/tests/sparc_ifu.v 58 | ./src/verilog-parser/tests/sparc_exu_ecl_eccctl.v 59 | ./src/verilog-parser/tests/sparc_ifu_swpla.v 60 | ./src/verilog-parser/tests/sparc_exu_ecc.v 61 | ./src/verilog-parser/tests/sparc_exu_div.v 62 | ./src/verilog-parser/tests/sparc_ifu_ifqctl.v 63 | ./src/verilog-parser/tests/sparc_ifu_dcl.v 64 | ./src/verilog-parser/tests/sparc_exu_eclbyplog_rs1.v 65 | ./src/verilog-parser/tests/sparc_ifu_fcl.v 66 | ./src/verilog-parser/tests/sparc_tlu_penc64.v 67 | ./src/verilog-parser/tests/sparc_tlu_intdp.v 68 | ./src/verilog-parser/tests/sparc_ifu_lru4.v 69 | ./src/verilog-parser/tests/sparc_ifu_wseldp.v 70 | ./src/verilog-parser/tests/sparc_exu_rndrob.v 71 | ./src/verilog-parser/tests/sparc_tlu_zcmp64.v 72 | ./src/verilog-parser/tests/sparc_ifu_par32.v 73 | ./src/verilog-parser/tests/sparc_exu_alulogic.v 74 | ./src/verilog-parser/tests/sparc_mul_dp.v 75 | ./src/verilog-parser/tests/sparc_mul_cntl.v 76 | -------------------------------------------------------------------------------- /src/veridoc-manifest.c: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-manifest.c 3 | @brief Contains common data structures and functions used on the 4 | file manifests 5 | */ 6 | 7 | #include "veridoc-manifest.h" 8 | 9 | 10 | /*! 11 | @brief Parses the supplied manifest file and returns a representation of it. 12 | @param [in] path - The manifest file to parse. 13 | @returns A pointer to the manifest object, or NULL if the file could not be 14 | found or parsed. 15 | */ 16 | veridoc_manifest * veridoc_manifest_parse( 17 | char * path 18 | ){ 19 | FILE * fh = fopen(path, "r"); 20 | 21 | if(fh == NULL){ 22 | printf("ERROR: Could not open manifest file path: '%s'\n", path); 23 | return NULL; 24 | } 25 | 26 | veridoc_manifest * tr = calloc(1,sizeof(veridoc_manifest)); 27 | 28 | while(feof(fh) == 0) 29 | { 30 | char first_on_line = fgetc(fh); 31 | if(first_on_line == '#' || first_on_line == ' '){ 32 | // Read until the end of the line and then continue. 33 | while(fgetc(fh)!='\n' && !feof(fh)){ 34 | // DO Nothing 35 | } 36 | } 37 | else if(first_on_line == '\n'){ 38 | // DO nothing, this is an empty line. 39 | } 40 | else 41 | { 42 | // This is a line worth parsing! 43 | 44 | char * line = calloc(1023,sizeof(char)); 45 | int i = 0; 46 | while(i < 1023 && !feof(fh) && first_on_line != '\n'){ 47 | line[i] = first_on_line; 48 | first_on_line = fgetc(fh); 49 | i++; 50 | } 51 | 52 | if(strlen(line) <=0) 53 | { 54 | free(line); 55 | continue; 56 | } 57 | 58 | // Is this line a file or a folder? 59 | DIR * d = opendir(line); 60 | 61 | if(d) 62 | { 63 | // It is a directory. 64 | tr -> directory_count += 1; 65 | tr -> directories = realloc(tr -> directories, 66 | tr->directory_count * sizeof(veridoc_manifest_directory)); 67 | tr -> directories[tr -> directory_count-1].path = line; 68 | } 69 | else if(errno == ENOTDIR) 70 | { 71 | // The path exists, and is a file. 72 | tr -> file_count += 1; 73 | tr -> files= realloc(tr -> files, 74 | tr->file_count * sizeof(veridoc_manifest_file)); 75 | 76 | tr -> files[tr -> file_count-1].path = line; 77 | tr -> files[tr -> file_count-1].parsed = BOOL_FALSE; 78 | tr -> files[tr -> file_count-1].parse_success = BOOL_FALSE; 79 | } 80 | else if(errno == ENOENT) 81 | { 82 | printf("ERROR: no such manifest path:'%s'.\n", line); 83 | } 84 | else 85 | { 86 | // The specified file does not exist. 87 | printf("ERROR: unknown error with manifest path:'%s'.\n", line); 88 | } 89 | } 90 | } 91 | 92 | return tr; 93 | 94 | } 95 | 96 | /*! 97 | @brief Frees a file manifest from memory. 98 | */ 99 | void veridoc_manifest_free( 100 | veridoc_manifest * tofree 101 | ){ 102 | 103 | int d; 104 | for(d = 0; d < tofree -> directory_count; d++) 105 | { 106 | free(tofree -> directories[d].path); 107 | } 108 | 109 | int f; 110 | for(f = 0; f < tofree -> directory_count; f++) 111 | { 112 | free(tofree -> files[f].path); 113 | } 114 | 115 | free(tofree -> files); 116 | free(tofree -> directories); 117 | free(tofree); 118 | } 119 | -------------------------------------------------------------------------------- /src/veridoc-parsing.c: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-parsing.c 3 | @brief Contains data structures and functions for parsing verilog files. 4 | */ 5 | 6 | #include "veridoc-parsing.h" 7 | 8 | /*! 9 | @brief Responsible for setting up the verilog-parser preprocessor 10 | @param [in] manifest - The set of files to parse and directories to search. 11 | @details This function uses the yy_preproc global variable (exposed by the 12 | verilog-parser library) and adds to its internal list of directories to 13 | search for include files. 14 | */ 15 | void veridoc_parse_init_include_paths( 16 | veridoc_manifest * manifest, 17 | veridoc_config * config 18 | ){ 19 | int d; 20 | // iterate over the directories 21 | for(d = 0; d < manifest -> directory_count; d++) 22 | { 23 | // add to the search paths. 24 | ast_list_append(yy_preproc -> search_dirs, 25 | manifest -> directories[d].path); 26 | printf("Added '%s' to search path.\n", 27 | manifest -> directories[d].path); 28 | } 29 | 30 | // iterate over the paths in the config 31 | for(d = 0; d < config -> v_includes -> items ; d++) 32 | { 33 | // add to the search paths. 34 | ast_list_append(yy_preproc -> search_dirs, 35 | ast_list_get(config -> v_includes,d)); 36 | printf("Added '%s' to search path.\n", 37 | (char*)ast_list_get(config -> v_includes,d)); 38 | } 39 | } 40 | 41 | /*! 42 | @brief Responsible for iterating over the files in the manifest and adding them 43 | to the source tree. 44 | @param [in] manifest - The set of files to parse and directories to search. 45 | */ 46 | void veridoc_parse_manifest_files( 47 | veridoc_manifest * manifest 48 | ){ 49 | int f; 50 | for(f = 0; f < manifest -> file_count; f++) 51 | { 52 | veridoc_manifest_file * record = &manifest -> files[f]; 53 | 54 | FILE * fh = fopen(record -> path,"r"); 55 | 56 | if(fh) 57 | { 58 | verilog_preprocessor_set_file(yy_preproc, record -> path); 59 | int result = verilog_parse_file(fh); 60 | 61 | record -> parsed = BOOL_TRUE; 62 | if(result == 0) { 63 | record -> parse_success = BOOL_TRUE; 64 | } else { 65 | record -> parse_success = BOOL_FALSE; 66 | } 67 | 68 | fclose(fh); 69 | } 70 | else 71 | { 72 | record -> parsed = BOOL_FALSE; 73 | record -> parse_success = BOOL_FALSE; 74 | } 75 | 76 | printf("%d / %d - %d %d - %s\n", f, manifest -> file_count, 77 | record -> parsed, record -> parse_success, record -> path); 78 | 79 | } 80 | } 81 | 82 | /*! 83 | @brief Responsible for parsing each file in the manifest, and building the 84 | internal source tree. 85 | @param [in] manifest - The set of files to parse and directories to search. 86 | @returns The parsed source tree object. 87 | */ 88 | verilog_source_tree * veridoc_parse_input_source( 89 | veridoc_manifest * manifest, 90 | veridoc_config * config 91 | ){ 92 | // First, we must initialise the parser library 93 | verilog_parser_init(); 94 | 95 | // Next, we need to set up the include paths for the pre-processor. 96 | veridoc_parse_init_include_paths(manifest,config); 97 | 98 | // Now we can do the parsing! 99 | veridoc_parse_manifest_files(manifest); 100 | 101 | // The value to be returned is a global variable exposed by the 102 | // parser library. 103 | verilog_source_tree * tr = yy_verilog_source_tree; 104 | 105 | // Resolve all of the module names. 106 | printf("Resolving Modules...\n"); 107 | verilog_resolve_modules(tr); 108 | 109 | return tr; 110 | } 111 | -------------------------------------------------------------------------------- /src/assets/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Verilog Doc 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 32 | 33 | 123 | 124 | 125 | 126 | 127 |
128 | 136 |
137 |
138 |
139 |
140 | 141 |
142 | 143 |

List Title

144 | 145 |
146 |

147 | List Description 148 |

149 |
150 |
    151 |
152 | 153 |
154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /src/veridoc-json.h: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-json.h 3 | @brief Provides declarations of utility functions for writing JSON data to 4 | a file stream. 5 | @details Provides Funcions for: 6 | - Creating new output files 7 | - Creating the main variables for the files. 8 | - Adding new key,value pairs for 9 | - strings 10 | - numbers 11 | - lists 12 | - Maintaining and properly emitting lists. 13 | - Properly closing all of the constructs. 14 | */ 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | // For common data structures like linked lists etc. 22 | #include "verilog-parser/src/verilog_ast_common.h" 23 | 24 | #ifndef VERIDOC_JSON_H 25 | #define VERIDOC_JSON_H 26 | 27 | typedef struct json_object_t json_object; 28 | 29 | /*! 30 | @brief A simple structure for helping to write out JSON encoded data. 31 | */ 32 | typedef struct json_file_t{ 33 | char * file_path; //!< Output file path. 34 | FILE * fh; //!< The open file handle. 35 | } json_file; 36 | 37 | 38 | /*! 39 | @brief Creates a new json file handle. 40 | @param[in] path - File path of the file to create / overwrite. 41 | @returns a json_file construct if the output path can be opened, else NULL. 42 | */ 43 | json_file * json_new_file( 44 | char * path 45 | ); 46 | 47 | //! Frees the memory allocated to a json_file construct and closes the file. 48 | void json_close_file(json_file * tofree); 49 | 50 | // --------------------------------------------------------------------- 51 | 52 | /*! 53 | @brief A holder for a new json object or collection of properties. 54 | */ 55 | struct json_object_t{ 56 | ast_list * kvps; //!< Key value pairs. Each value is a json_kvp 57 | }; 58 | 59 | 60 | //! Creates and returns a pointer to a new json object. 61 | json_object * json_new_object(); 62 | 63 | //! Adds a string and associated key to the supplied object. 64 | void json_object_add_string( 65 | json_object * obj, 66 | char * key, 67 | char * value 68 | ); 69 | 70 | //! Adds an integer and associated key to the supplied object. 71 | void json_object_add_int( 72 | json_object * obj, 73 | char * key, 74 | int value 75 | ); 76 | 77 | //! Adds a list and associated key to the supplied object. 78 | void json_object_add_list( 79 | json_object * obj, 80 | char * key, 81 | json_object * list 82 | ); 83 | 84 | //! Adds a object and associated key to the supplied object. 85 | void json_object_add_object( 86 | json_object * obj, 87 | char * key, 88 | json_object * value 89 | ); 90 | 91 | /*! 92 | @brief emits the supplied object into the supplied file, with an optional 93 | variable name. 94 | @param[in] varName - The name of the first variable (var) in the file, which 95 | will hold the forthcoming JSON data structure. Iff NULL, no `var X=` will be 96 | emitted. 97 | */ 98 | void json_emit_object( 99 | json_file * fh, 100 | json_object * toemit, 101 | char * varName, 102 | unsigned char as_list 103 | ); 104 | 105 | // --------------------------------------------------------------------- 106 | 107 | //! Describes the type of object stored in a json_kvp. 108 | typedef enum json_kvp_type_e{ 109 | JSON_KVP_INT, //!< Value is an integer (int) 110 | JSON_KVP_STR, //!< Value is a string (char*) 111 | JSON_KVP_LIST, //!< Value is a json_list 112 | JSON_KVP_OBJ, //!< Value is a json_object 113 | } json_kvp_type; 114 | 115 | //! Stores a single pair. 116 | typedef struct json_kvp_t{ 117 | json_kvp_type type; //! What sort of data type does the key point at? 118 | char * key; // 7 | #include 8 | #include 9 | 10 | #include "veridoc.h" 11 | 12 | /*! 13 | @brief Prints the help text and exists, depending on the parameters. 14 | */ 15 | void print_help(boolean and_exit) 16 | { 17 | printf("Usage: ./veridoc \n"); 18 | printf("Options:\n"); 19 | printf("-v, --verbose - Be verbose with status information.\n"); 20 | printf("-c , --config - Set the configuration file path. \n"); 21 | printf("-F , --files - Input file manifest list. \n"); 22 | printf("\n"); 23 | 24 | if(and_exit){ 25 | exit(0); 26 | } 27 | } 28 | 29 | /*! 30 | @brief Responsible for parsing all of the command line arguments. 31 | @returns A shell_args pointer 32 | */ 33 | shell_args * parse_args(int argc, char ** argv) 34 | { 35 | if(argc == 1) 36 | { 37 | print_help(BOOL_TRUE); 38 | } 39 | 40 | shell_args * tr = calloc(1,sizeof(shell_args)); 41 | 42 | int i; // Iterate over argv 43 | for(i = 1; i < argc; i++) 44 | { 45 | if(strcmp("-v", argv[i]) == 0 || 46 | strcmp("--verbose", argv[i]) == 0) 47 | { 48 | tr -> verbose = BOOL_TRUE; 49 | } 50 | else if((strcmp("-c", argv[i]) == 0 || 51 | strcmp("--config", argv[i]) == 0) && 52 | i <= argc-1) 53 | { 54 | i++; 55 | tr -> config_path = argv[i]; 56 | } 57 | else if((strcmp("-F", argv[i]) == 0 || 58 | strcmp("--files", argv[i]) == 0) && 59 | i <= argc-1) 60 | { 61 | i++; 62 | tr -> manifest_path= argv[i]; 63 | } 64 | } 65 | 66 | return tr; 67 | } 68 | 69 | int main(int argc, char ** argv) 70 | { 71 | // Parse any command line arguments. 72 | shell_args * args = parse_args(argc,argv); 73 | 74 | if(!args -> config_path){ 75 | print_help(BOOL_TRUE); 76 | } 77 | 78 | veridoc_config * config = veridoc_config_parse( 79 | args -> config_path, 80 | argv[0] 81 | ); 82 | 83 | // Check the config file was laoded correctly. 84 | if(!config){ 85 | print_help(BOOL_TRUE); 86 | } 87 | 88 | // Has the manifest path been specified? 89 | if(args -> manifest_path) 90 | { 91 | if(config -> v_manifest){ 92 | free(config -> v_manifest); 93 | } 94 | config -> v_manifest = args -> manifest_path; 95 | } 96 | else if(!config -> v_manifest) 97 | { 98 | // If not, set it to a default value. 99 | config -> v_manifest = "Veridoc.cfg\0"; 100 | } 101 | 102 | veridoc_manifest * manifest = veridoc_manifest_parse(config -> v_manifest); 103 | 104 | // Check that the manifest was loaded correctly. 105 | if(!manifest) 106 | { 107 | printf("ERROR: Could not load or parse the manifest file: %s\n", 108 | config -> v_manifest); 109 | veridoc_config_free(config); 110 | return 0; 111 | } 112 | 113 | // Print out some status information. 114 | if(args -> verbose){ 115 | printf("Exe Path: %s\n", argv[0]); 116 | printf("Config Path: %s\n", args -> config_path); 117 | printf("File Manifest: %s\n", config -> v_manifest); 118 | printf("Project: %s\n", config -> v_project); 119 | printf("Author: %s\n", config -> v_author ); 120 | printf("Version: %s\n", config -> v_version); 121 | printf("Assets Path: %s\n", config -> v_assets_dir); 122 | printf("Input Files: %d\n", manifest -> file_count); 123 | printf("Output To: %s\n", config-> v_output); 124 | printf("Include Paths:\n"); 125 | 126 | unsigned int i; 127 | for(i = 0; i < config -> v_includes -> items; i++) 128 | { 129 | printf("\t'%s'\n", (char*)ast_list_get(config -> v_includes, i)); 130 | } 131 | 132 | printf("\n"); 133 | printf("Starting parsing...\n"); 134 | } 135 | 136 | // Read in all of the source files. 137 | verilog_source_tree * source = veridoc_parse_input_source(manifest,config); 138 | 139 | // Build the output documentation. 140 | veridoc_pf_build(manifest, config, source); 141 | 142 | // Copy the asset files from their source locations to the output dir. 143 | veridoc_pf_copy_assets(config); 144 | 145 | // Free everything 146 | veridoc_config_free(config); 147 | veridoc_manifest_free(manifest); 148 | 149 | printf("Veridoc Completed Successfully.\n"); 150 | return 0; 151 | } 152 | -------------------------------------------------------------------------------- /src/veridoc-json.c: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-json.c 3 | @brief Provides declarations of utility functions for writing JSON data to 4 | a file stream. 5 | */ 6 | 7 | #include "veridoc-json.h" 8 | 9 | /*! 10 | @brief Creates a new json file handle. 11 | @param[in] path - File path of the file to create / overwrite. 12 | @param[in] varName - The name of the first variable (var) in the file, which 13 | will hold the forthcoming JSON data structure. Iff NULL, no `var X=` will be 14 | emitted. 15 | @returns a json_file construct if the output path can be opened, else NULL. 16 | */ 17 | json_file * json_new_file( 18 | char * path 19 | ){ 20 | json_file * tr = calloc(1,sizeof(json_file)); 21 | 22 | tr -> file_path = path; 23 | tr -> fh = fopen(path, "w"); 24 | 25 | if(!tr->fh) 26 | { 27 | free(tr); 28 | return NULL; 29 | } 30 | else 31 | { 32 | return tr; 33 | } 34 | } 35 | 36 | //! Frees the memory allocated to a json_file construct. 37 | void json_close_file(json_file * tofree) 38 | { 39 | if(tofree -> fh) 40 | { 41 | fclose(tofree -> fh); 42 | } 43 | 44 | free(tofree); 45 | } 46 | 47 | //! Creates and returns a new KVP object with the supplied key and datatype. 48 | json_kvp * json_new_kvp( 49 | char * key, 50 | json_kvp_type type 51 | ){ 52 | json_kvp * tr = calloc(1,sizeof(json_kvp)); 53 | 54 | tr -> key = key; 55 | tr -> type = type; 56 | 57 | return tr; 58 | } 59 | 60 | //! Creates and returns a pointer to a new json object. 61 | json_object * json_new_object() 62 | { 63 | json_object * tr = calloc(1,sizeof(json_object)); 64 | tr -> kvps = ast_list_new(); 65 | return tr; 66 | } 67 | 68 | 69 | //! Adds a string and associated key to the supplied object. 70 | void json_object_add_string( 71 | json_object * obj, 72 | char * key, 73 | char * value 74 | ){ 75 | json_kvp * toadd = json_new_kvp(key, JSON_KVP_STR); 76 | toadd -> string = value; 77 | ast_list_append(obj -> kvps, toadd); 78 | } 79 | 80 | //! Adds an integer and associated key to the supplied object. 81 | void json_object_add_int( 82 | json_object * obj, 83 | char * key, 84 | int value 85 | ){ 86 | json_kvp * toadd = json_new_kvp(key, JSON_KVP_INT); 87 | toadd -> integer = value; 88 | ast_list_append(obj -> kvps, toadd); 89 | } 90 | 91 | //! Adds a list and associated key to the supplied object. 92 | void json_object_add_list( 93 | json_object * obj, 94 | char * key, 95 | json_object * value 96 | ){ 97 | json_kvp * toadd = json_new_kvp(key, JSON_KVP_LIST); 98 | toadd -> list = value; 99 | ast_list_append(obj -> kvps, toadd); 100 | } 101 | 102 | //! Adds a object and associated key to the supplied object. 103 | void json_object_add_object( 104 | json_object * obj, 105 | char * key, 106 | json_object * value 107 | ){ 108 | json_kvp * toadd = json_new_kvp(key, JSON_KVP_OBJ); 109 | toadd -> object = value; 110 | ast_list_append(obj -> kvps, toadd); 111 | } 112 | 113 | /*! 114 | @brief emits the supplied object into the supplied file, with an optional 115 | variable name. 116 | @param[in] varName - The name of the first variable (var) in the file, which 117 | will hold the forthcoming JSON data structure. Iff NULL, no `var X=` will be 118 | emitted. 119 | @param[in] as_list - Emit using the syntax for a list ([...]) rather than an 120 | object ({...}). 121 | */ 122 | void json_emit_object( 123 | json_file * fh, 124 | json_object * toemit, 125 | char * varName, 126 | unsigned char as_list 127 | ){ 128 | assert(fh -> fh); // Make sure the file is open! 129 | 130 | if(varName){ 131 | // Should we emit a variable to go with the JSON? 132 | fprintf(fh->fh,"var %s = \n", varName); 133 | } 134 | 135 | // Now do the actual object emission 136 | fprintf(fh->fh, as_list ? "[\n" : "{\n"); 137 | 138 | unsigned int i; 139 | for(i = 0; i < toemit -> kvps -> items; i++) 140 | { 141 | json_kvp * kvp = ast_list_get(toemit -> kvps, i); 142 | 143 | if(!as_list){ 144 | fprintf(fh->fh, "\"%s\" : ", kvp -> key); 145 | } 146 | 147 | switch(kvp -> type) 148 | { 149 | case JSON_KVP_STR: 150 | fprintf(fh->fh, "\"%s\"\n", kvp -> string); 151 | break; 152 | case JSON_KVP_INT: 153 | fprintf(fh->fh, "%d\n", kvp -> integer); 154 | break; 155 | case JSON_KVP_LIST: 156 | json_emit_object(fh, kvp -> object, NULL, 1); 157 | break; 158 | case JSON_KVP_OBJ: 159 | json_emit_object(fh, kvp -> object, NULL, 0); 160 | break; 161 | } 162 | 163 | if(i < toemit -> kvps -> items - 1){ 164 | fprintf(fh -> fh, ","); 165 | } 166 | } 167 | 168 | fprintf(fh->fh, as_list ? "]\n" : "}\n"); 169 | 170 | 171 | if(varName){ 172 | // Do we need to close off a variable declaration? 173 | fprintf(fh->fh,";\n"); 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /src/veridoc-config.c: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-config.c 3 | @brief Contains data structures and functions for parsing veridoc configs. 4 | */ 5 | 6 | #include "veridoc-config.h" 7 | 8 | /*! 9 | @brief Parses and returns the config file at the supplied path. 10 | @param [in] config_file_path 11 | @param [in] exe_path - the value of argv[0] 12 | @returns A pointer to the supplied config structure. 13 | */ 14 | veridoc_config * veridoc_config_parse( 15 | char * config_file_path, 16 | char * exe_path 17 | ){ 18 | 19 | veridoc_config * tr = calloc(1,sizeof(veridoc_config)); 20 | tr -> v_includes = ast_list_new(); 21 | 22 | FILE * fh = fopen(config_file_path, "r"); 23 | 24 | if(fh == NULL){ 25 | printf("ERROR: Could not open config file path: %s\n", 26 | config_file_path); 27 | return NULL; 28 | } 29 | 30 | char * key = calloc(255,sizeof(char)); 31 | char * value = calloc(1023,sizeof(char)); 32 | 33 | while(feof(fh) == 0) 34 | { 35 | char first_on_line = fgetc(fh); 36 | if(first_on_line == '#' || first_on_line == ' '){ 37 | // Read until the end of the line and then continue. 38 | while(fgetc(fh)!='\n' && !feof(fh)){ 39 | // DO Nothing 40 | } 41 | } 42 | else if(first_on_line == '\n'){ 43 | // DO nothing, this is an empty line. 44 | } 45 | else{ 46 | // This is a line worth parsing! 47 | ungetc(first_on_line, fh); 48 | 49 | // Read upto the equals to get the key: 50 | memset(key,'\0',255); 51 | fscanf(fh, "%s= ", key); 52 | 53 | // Now read to the end of the line. 54 | int i = 0; 55 | char toadd = fgetc(fh); 56 | while(toadd == ' ' || toadd == '='){ 57 | toadd = fgetc(fh); 58 | } 59 | 60 | while(i < 1023 && toadd != '\n' && toadd != '\0' && !feof(fh)){ 61 | value[i] = toadd; 62 | toadd = fgetc(fh); 63 | i++; 64 | } 65 | 66 | if(strcmp(key,"project") == 0 && !tr -> v_project) 67 | { 68 | tr -> v_project = value; 69 | value = calloc(1023,sizeof(char)); 70 | } 71 | else if(strcmp(key,"author") == 0 && !tr -> v_author) 72 | { 73 | tr -> v_author = value; 74 | value = calloc(1023,sizeof(char)); 75 | } 76 | else if(strcmp(key,"output") == 0 && !tr -> v_output) 77 | { 78 | tr -> v_output= value; 79 | value = calloc(1023,sizeof(char)); 80 | } 81 | else if(strcmp(key,"version") == 0 && !tr -> v_version) 82 | { 83 | tr -> v_version= value; 84 | value = calloc(1023,sizeof(char)); 85 | } 86 | else if(strcmp(key,"include") == 0) 87 | { 88 | ast_list_append(tr -> v_includes, value); 89 | value = calloc(1023,sizeof(char)); 90 | } 91 | else if(strcmp(key,"assets_dir") == 0 && !tr -> v_assets_dir) 92 | { 93 | tr -> v_assets_dir = value; 94 | value = calloc(1023,sizeof(char)); 95 | } 96 | else if(strcmp(key,"manifest") == 0 && !tr -> v_manifest) 97 | { 98 | tr -> v_manifest = value; 99 | value = calloc(1023,sizeof(char)); 100 | } 101 | else if(strcmp(key,"top_module") == 0 && !tr -> v_top_module) 102 | { 103 | tr -> v_top_module = value; 104 | value = calloc(1023,sizeof(char)); 105 | } 106 | else 107 | { 108 | if(strlen(key) > 0){ 109 | printf("Error parsing config : %s\n", config_file_path); 110 | printf("Unknown key '%s' ignored\n", key); 111 | break; 112 | } 113 | } 114 | } 115 | } 116 | 117 | // Make sure we have a proper assets source path. 118 | if(tr -> v_assets_dir == NULL) 119 | { 120 | tr -> v_assets_dir = strdup(exe_path); 121 | size_t length = strlen(tr -> v_assets_dir); 122 | while(length > 0) 123 | { 124 | if(tr -> v_assets_dir[length] == '\\' || 125 | tr -> v_assets_dir[length] == '/') 126 | { 127 | break; 128 | } 129 | else 130 | { 131 | tr -> v_assets_dir[length] = '\0'; 132 | length = length - 1; 133 | } 134 | } 135 | tr -> v_assets_dir = realloc(tr -> v_assets_dir,length+7); 136 | strcat(tr -> v_assets_dir, "assets/"); 137 | } 138 | 139 | // Make sure we have a proper output path. 140 | if(tr -> v_output == NULL) 141 | { 142 | tr -> v_output = calloc(16,sizeof(char)); 143 | strcat(tr -> v_output, "./veridoc-out/"); 144 | } 145 | 146 | free(key); 147 | free(value); 148 | 149 | return tr; 150 | } 151 | 152 | 153 | /*! 154 | @brief Frees the memory allocated to the supplied config file. 155 | */ 156 | void veridoc_config_free( 157 | veridoc_config * tofree 158 | ){ 159 | if(tofree -> v_project) 160 | free(tofree -> v_project ); //!< Project / Documentation Set Title. 161 | if(tofree -> v_author) 162 | free(tofree -> v_author ); //!< Documentation Authors 163 | if(tofree -> v_version) 164 | free(tofree -> v_version ); //!< Version Number 165 | 166 | if(tofree) 167 | free(tofree); 168 | } 169 | -------------------------------------------------------------------------------- /src/assets/script.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Contains all of the functions for the documentation pages. 4 | */ 5 | 6 | /* 7 | Gets page URL parameters by name. 8 | */ 9 | function gup( name, url ) { 10 | if (!url) url = location.href; 11 | name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 12 | var regexS = "[\\?&]"+name+"=([^&#]*)"; 13 | var regex = new RegExp( regexS ); 14 | var results = regex.exec( url ); 15 | return results == null ? null : results[1]; 16 | } 17 | 18 | 19 | function veridoc_render_file_list( 20 | listData, 21 | container 22 | ){ 23 | var toset = "" 24 | 25 | listData = listData.sort(function(a,b){ 26 | if(a.path>=b.path){return 1;} 27 | else {return -1;} }); 28 | 29 | var i; 30 | for(i = 0; i < listData.length; i++) 31 | { 32 | var item = listData[i]; 33 | 34 | toset += "
  • "; 35 | if(item.parsed == "1"){ 36 | toset += "
    Found
    "; 37 | if(item.success== "1"){ 38 | toset += "
    Parsed
    "; 39 | } else { 40 | toset += "
    Syntax Errors
    "; 41 | } 42 | } else { 43 | toset += "
    Not Found
    "; 44 | } 45 | 46 | toset += "
    "+item.path+"
    "; 47 | toset += "
  • " 48 | 49 | } 50 | 51 | container.innerHTML = toset; 52 | } 53 | 54 | 55 | function veridoc_render_module_list( 56 | listData, 57 | container 58 | ){ 59 | var toset = "" 60 | 61 | listData = listData.sort(function(a,b){ 62 | if(a.id>=b.id){return 1;} 63 | else {return -1;} 64 | }); 65 | 66 | var i; 67 | for(i = 0; i < listData.length; i++) 68 | { 69 | var item = listData[i]; 70 | 71 | toset += "
  • "; 72 | toset += ""; 74 | toset += "
  • " 75 | 76 | } 77 | 78 | container.innerHTML = toset; 79 | } 80 | 81 | function veridoc_render_module_hierarchy( 82 | rootModule, 83 | container 84 | ){ 85 | var tr = "
    "+ 86 | ""+rootModule.id+""; 87 | 88 | var i; 89 | 90 | rootModule.children = rootModule.children.sort(function(a,b){ 91 | if(a.id>=b.id){return 1;} 92 | else {return -1;} 93 | }); 94 | 95 | for(i = 0; i < rootModule.children.length; i++) 96 | { 97 | tr +=veridoc_render_module_hierarchy(rootModule.children[i],container); 98 | } 99 | 100 | tr += "
    "; 101 | return tr; 102 | } 103 | 104 | /* 105 | Responsible for taking a JSON data structure and turning it into a list 106 | on the list.html page. 107 | */ 108 | function veridoc_render_list( 109 | data 110 | ){ 111 | var listType = data.listType; 112 | var listData = data.listData; 113 | var listTitle = data.listTitle; 114 | var listNotes = data.listNotes; 115 | 116 | document.getElementById('list-title').innerText = listTitle; 117 | document.getElementById('list-notes').innerText = listNotes; 118 | 119 | // This is a
      element 120 | var container = document.getElementById('list-container'); 121 | container.innerHTML = ""; 122 | 123 | if(listType == "file-manifest"){ 124 | veridoc_render_file_list(listData, container); 125 | } else if (listType == "module-manifest") { 126 | veridoc_render_module_list(listData, container); 127 | } else if (listType == "module-hierarchy") { 128 | container.innerHTML += 129 | veridoc_render_module_hierarchy(listData[0], container); 130 | } else { 131 | container.innerText = "Error: unknown list type: "+listType; 132 | } 133 | } 134 | 135 | function veridoc_new_module_section( 136 | title, 137 | content 138 | ){ 139 | var pageCont = document.getElementById("page-content"); 140 | var section = document.createElement("div"); 141 | var sectionTitle = document.createElement("div"); 142 | var sectionContent = document.createElement("div"); 143 | section.appendChild(sectionTitle); 144 | section.appendChild(sectionContent); 145 | pageCont.appendChild(section); 146 | section.setAttribute("class", "page-section"); 147 | sectionTitle.setAttribute("class", "page-section-title"); 148 | sectionContent.setAttribute("class", "page-section-content"); 149 | sectionTitle.innerHTML = "[-] "+title; 150 | sectionContent.innerHTML = content; 151 | } 152 | 153 | 154 | /*! 155 | Responsible for rendering a module page from it's JSON attributes. 156 | */ 157 | function veridoc_render_module(){ 158 | var module = gup("m", location.href); 159 | 160 | var data = veridocModuleInformation; 161 | var hierCurr = document.getElementById("hier-current"); 162 | var hierKids = document.getElementById("child-list"); 163 | var docTitle = document.getElementById("module-title"); 164 | var docLine = document.getElementById("module-line"); 165 | var docFile = document.getElementById("source-file"); 166 | var docBrief = document.getElementById("module-description"); 167 | 168 | docTitle.innerText = data.moduleName; 169 | hierCurr.innerText = data.moduleName; 170 | docLine.innerText = data.moduleLine; 171 | docFile.innerText = data.moduleFile; 172 | docBrief.innerText = data.moduleBrief; 173 | 174 | var i; 175 | for(i = 0; i < data.children.length; i++) 176 | { 177 | var li = document.createElement("li"); 178 | var link = document.createElement("a"); 179 | link.setAttribute("href", "module.html?m="+data.children[i].moduleName); 180 | link.innerText = data.children[i].moduleName; 181 | li.appendChild(link); 182 | hierKids.appendChild(li); 183 | } 184 | 185 | 186 | var table = ""; 187 | 188 | for(i = 0; i < data.ports.length; i++) 189 | { 190 | var port = data.ports[i]; 191 | 192 | table += ""; 193 | table += ""; 194 | table += ""; 195 | table += ""; 196 | table += ""; 197 | table += ""; 198 | table += ""; 199 | } 200 | 201 | table += "
      TypeWidthDirectionNameDescription
      "+port.type+""+port.range+""+port.direction+""+port.name+"None
      "; 202 | veridoc_new_module_section("Ports", table); 203 | } 204 | -------------------------------------------------------------------------------- /docs/Doxyfile: -------------------------------------------------------------------------------- 1 | # Doxyfile 1.8.6 2 | 3 | #--------------------------------------------------------------------------- 4 | # Project related configuration options 5 | #--------------------------------------------------------------------------- 6 | DOXYFILE_ENCODING = UTF-8 7 | PROJECT_NAME = "Verilog Documentation Generator" 8 | PROJECT_NUMBER = 9 | PROJECT_BRIEF = 10 | PROJECT_LOGO = 11 | OUTPUT_DIRECTORY = ../build/docs 12 | CREATE_SUBDIRS = NO 13 | OUTPUT_LANGUAGE = English 14 | BRIEF_MEMBER_DESC = YES 15 | REPEAT_BRIEF = YES 16 | ABBREVIATE_BRIEF = 17 | ALWAYS_DETAILED_SEC = NO 18 | INLINE_INHERITED_MEMB = NO 19 | FULL_PATH_NAMES = NO 20 | STRIP_FROM_PATH = 21 | STRIP_FROM_INC_PATH = 22 | SHORT_NAMES = NO 23 | JAVADOC_AUTOBRIEF = NO 24 | QT_AUTOBRIEF = NO 25 | MULTILINE_CPP_IS_BRIEF = NO 26 | INHERIT_DOCS = YES 27 | SEPARATE_MEMBER_PAGES = NO 28 | TAB_SIZE = 4 29 | ALIASES = 30 | TCL_SUBST = 31 | OPTIMIZE_OUTPUT_FOR_C = YES 32 | OPTIMIZE_OUTPUT_JAVA = NO 33 | OPTIMIZE_FOR_FORTRAN = NO 34 | OPTIMIZE_OUTPUT_VHDL = NO 35 | EXTENSION_MAPPING = 36 | MARKDOWN_SUPPORT = YES 37 | AUTOLINK_SUPPORT = YES 38 | BUILTIN_STL_SUPPORT = NO 39 | CPP_CLI_SUPPORT = NO 40 | SIP_SUPPORT = NO 41 | IDL_PROPERTY_SUPPORT = YES 42 | DISTRIBUTE_GROUP_DOC = YES 43 | SUBGROUPING = YES 44 | INLINE_GROUPED_CLASSES = NO 45 | INLINE_SIMPLE_STRUCTS = YES 46 | TYPEDEF_HIDES_STRUCT = YES 47 | LOOKUP_CACHE_SIZE = 0 48 | #--------------------------------------------------------------------------- 49 | # Build related configuration options 50 | #--------------------------------------------------------------------------- 51 | EXTRACT_ALL = YES 52 | EXTRACT_PRIVATE = NO 53 | EXTRACT_PACKAGE = NO 54 | EXTRACT_STATIC = NO 55 | EXTRACT_LOCAL_CLASSES = YES 56 | EXTRACT_LOCAL_METHODS = NO 57 | EXTRACT_ANON_NSPACES = NO 58 | HIDE_UNDOC_MEMBERS = NO 59 | HIDE_UNDOC_CLASSES = NO 60 | HIDE_FRIEND_COMPOUNDS = NO 61 | HIDE_IN_BODY_DOCS = NO 62 | INTERNAL_DOCS = YES 63 | CASE_SENSE_NAMES = YES 64 | HIDE_SCOPE_NAMES = NO 65 | SHOW_INCLUDE_FILES = YES 66 | SHOW_GROUPED_MEMB_INC = NO 67 | FORCE_LOCAL_INCLUDES = NO 68 | INLINE_INFO = YES 69 | SORT_MEMBER_DOCS = YES 70 | SORT_BRIEF_DOCS = YES 71 | SORT_MEMBERS_CTORS_1ST = NO 72 | SORT_GROUP_NAMES = YES 73 | SORT_BY_SCOPE_NAME = YES 74 | STRICT_PROTO_MATCHING = NO 75 | GENERATE_TODOLIST = YES 76 | GENERATE_TESTLIST = YES 77 | GENERATE_BUGLIST = YES 78 | GENERATE_DEPRECATEDLIST= YES 79 | ENABLED_SECTIONS = 80 | MAX_INITIALIZER_LINES = 30 81 | SHOW_USED_FILES = YES 82 | SHOW_FILES = YES 83 | SHOW_NAMESPACES = YES 84 | FILE_VERSION_FILTER = 85 | LAYOUT_FILE = layout.xml 86 | CITE_BIB_FILES = 87 | #--------------------------------------------------------------------------- 88 | # Configuration options related to warning and progress messages 89 | #--------------------------------------------------------------------------- 90 | QUIET = NO 91 | WARNINGS = 92 | WARN_IF_UNDOCUMENTED = 93 | WARN_IF_DOC_ERROR = 94 | WARN_NO_PARAMDOC = YES 95 | WARN_FORMAT = "$file:$line: $text" 96 | WARN_LOGFILE = 97 | #--------------------------------------------------------------------------- 98 | # Configuration options related to the input files 99 | #--------------------------------------------------------------------------- 100 | INPUT = ../src/ ../README.md ../docs 101 | INPUT_ENCODING = UTF-8 102 | FILE_PATTERNS = *.c *.cpp *.h *.hpp *.y *.dox 103 | RECURSIVE = YES 104 | EXCLUDE = ../src/verilog-parser/ 105 | EXCLUDE_SYMLINKS = NO 106 | EXCLUDE_PATTERNS = 107 | EXCLUDE_SYMBOLS = 108 | EXAMPLE_PATH = 109 | EXAMPLE_PATTERNS = 110 | EXAMPLE_RECURSIVE = NO 111 | IMAGE_PATH = 112 | INPUT_FILTER = 113 | FILTER_PATTERNS = 114 | FILTER_SOURCE_FILES = NO 115 | FILTER_SOURCE_PATTERNS = 116 | USE_MDFILE_AS_MAINPAGE = ../README.md 117 | #--------------------------------------------------------------------------- 118 | # Configuration options related to source browsing 119 | #--------------------------------------------------------------------------- 120 | SOURCE_BROWSER = YES 121 | INLINE_SOURCES = NO 122 | STRIP_CODE_COMMENTS = NO 123 | REFERENCED_BY_RELATION = YES 124 | REFERENCES_RELATION = YES 125 | REFERENCES_LINK_SOURCE = YES 126 | SOURCE_TOOLTIPS = YES 127 | USE_HTAGS = NO 128 | VERBATIM_HEADERS = YES 129 | #--------------------------------------------------------------------------- 130 | # Configuration options related to the alphabetical class index 131 | #--------------------------------------------------------------------------- 132 | ALPHABETICAL_INDEX = YES 133 | COLS_IN_ALPHA_INDEX = 5 134 | IGNORE_PREFIX = 135 | #--------------------------------------------------------------------------- 136 | # Configuration options related to the HTML output 137 | #--------------------------------------------------------------------------- 138 | GENERATE_HTML = YES 139 | HTML_OUTPUT = html 140 | HTML_FILE_EXTENSION = .html 141 | HTML_HEADER = header.html 142 | HTML_FOOTER = footer.html 143 | HTML_STYLESHEET = stylesheet.css 144 | HTML_EXTRA_STYLESHEET = 145 | HTML_EXTRA_FILES = 146 | HTML_COLORSTYLE_HUE = 240 147 | HTML_COLORSTYLE_SAT = 20 148 | HTML_COLORSTYLE_GAMMA = 40 149 | HTML_TIMESTAMP = YES 150 | HTML_DYNAMIC_SECTIONS = YES 151 | HTML_INDEX_NUM_ENTRIES = 100 152 | GENERATE_DOCSET = NO 153 | DOCSET_FEEDNAME = "Doxygen generated docs" 154 | DOCSET_BUNDLE_ID = uk.org.bmarshall.verilog-parser 155 | DOCSET_PUBLISHER_ID = uk.org.bmarshall 156 | DOCSET_PUBLISHER_NAME = Ben Marshall 157 | GENERATE_HTMLHELP = NO 158 | CHM_FILE = 159 | HHC_LOCATION = 160 | GENERATE_CHI = NO 161 | CHM_INDEX_ENCODING = 162 | BINARY_TOC = YES 163 | TOC_EXPAND = YES 164 | GENERATE_QHP = NO 165 | QCH_FILE = 166 | QHP_NAMESPACE = org.doxygen.Project 167 | QHP_VIRTUAL_FOLDER = doc 168 | QHP_CUST_FILTER_NAME = 169 | QHP_CUST_FILTER_ATTRS = 170 | QHP_SECT_FILTER_ATTRS = 171 | QHG_LOCATION = 172 | GENERATE_ECLIPSEHELP = NO 173 | ECLIPSE_DOC_ID = org.doxygen.Project 174 | DISABLE_INDEX = NO 175 | GENERATE_TREEVIEW = YES 176 | ENUM_VALUES_PER_LINE = 4 177 | TREEVIEW_WIDTH = 350 178 | EXT_LINKS_IN_WINDOW = YES 179 | FORMULA_FONTSIZE = 10 180 | FORMULA_TRANSPARENT = YES 181 | USE_MATHJAX = NO 182 | MATHJAX_FORMAT = HTML-CSS 183 | MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest 184 | MATHJAX_EXTENSIONS = 185 | MATHJAX_CODEFILE = 186 | SEARCHENGINE = YES 187 | SERVER_BASED_SEARCH = NO 188 | EXTERNAL_SEARCH = NO 189 | SEARCHENGINE_URL = 190 | SEARCHDATA_FILE = searchdata.xml 191 | EXTERNAL_SEARCH_ID = 192 | EXTRA_SEARCH_MAPPINGS = 193 | #--------------------------------------------------------------------------- 194 | # Configuration options related to the LaTeX output 195 | #--------------------------------------------------------------------------- 196 | GENERATE_LATEX = NO 197 | LATEX_OUTPUT = latex 198 | LATEX_CMD_NAME = latex 199 | MAKEINDEX_CMD_NAME = makeindex 200 | COMPACT_LATEX = NO 201 | PAPER_TYPE = a4 202 | EXTRA_PACKAGES = 203 | LATEX_HEADER = 204 | LATEX_FOOTER = 205 | LATEX_EXTRA_FILES = 206 | PDF_HYPERLINKS = YES 207 | USE_PDFLATEX = YES 208 | LATEX_BATCHMODE = NO 209 | LATEX_HIDE_INDICES = NO 210 | LATEX_SOURCE_CODE = NO 211 | LATEX_BIB_STYLE = plain 212 | #--------------------------------------------------------------------------- 213 | # Configuration options related to the RTF output 214 | #--------------------------------------------------------------------------- 215 | GENERATE_RTF = NO 216 | RTF_OUTPUT = rtf 217 | COMPACT_RTF = NO 218 | RTF_HYPERLINKS = NO 219 | RTF_STYLESHEET_FILE = 220 | RTF_EXTENSIONS_FILE = 221 | #--------------------------------------------------------------------------- 222 | # Configuration options related to the man page output 223 | #--------------------------------------------------------------------------- 224 | GENERATE_MAN = NO 225 | MAN_OUTPUT = man 226 | MAN_EXTENSION = .3 227 | MAN_LINKS = NO 228 | #--------------------------------------------------------------------------- 229 | # Configuration options related to the XML output 230 | #--------------------------------------------------------------------------- 231 | GENERATE_XML = NO 232 | XML_OUTPUT = xml 233 | XML_PROGRAMLISTING = YES 234 | #--------------------------------------------------------------------------- 235 | # Configuration options related to the DOCBOOK output 236 | #--------------------------------------------------------------------------- 237 | GENERATE_DOCBOOK = NO 238 | DOCBOOK_OUTPUT = docbook 239 | #--------------------------------------------------------------------------- 240 | # Configuration options for the AutoGen Definitions output 241 | #--------------------------------------------------------------------------- 242 | GENERATE_AUTOGEN_DEF = NO 243 | #--------------------------------------------------------------------------- 244 | # Configuration options related to the Perl module output 245 | #--------------------------------------------------------------------------- 246 | GENERATE_PERLMOD = NO 247 | PERLMOD_LATEX = NO 248 | PERLMOD_PRETTY = YES 249 | PERLMOD_MAKEVAR_PREFIX = 250 | #--------------------------------------------------------------------------- 251 | # Configuration options related to the preprocessor 252 | #--------------------------------------------------------------------------- 253 | ENABLE_PREPROCESSING = YES 254 | MACRO_EXPANSION = NO 255 | EXPAND_ONLY_PREDEF = NO 256 | SEARCH_INCLUDES = YES 257 | INCLUDE_PATH = 258 | INCLUDE_FILE_PATTERNS = 259 | PREDEFINED = 260 | EXPAND_AS_DEFINED = 261 | SKIP_FUNCTION_MACROS = YES 262 | #--------------------------------------------------------------------------- 263 | # Configuration options related to external references 264 | #--------------------------------------------------------------------------- 265 | TAGFILES = 266 | GENERATE_TAGFILE = 267 | ALLEXTERNALS = NO 268 | EXTERNAL_GROUPS = YES 269 | EXTERNAL_PAGES = YES 270 | PERL_PATH = /usr/bin/perl 271 | #--------------------------------------------------------------------------- 272 | # Configuration options related to the dot tool 273 | #--------------------------------------------------------------------------- 274 | CLASS_DIAGRAMS = YES 275 | MSCGEN_PATH = 276 | DIA_PATH = 277 | HIDE_UNDOC_RELATIONS = YES 278 | HAVE_DOT = YES 279 | DOT_NUM_THREADS = 0 280 | DOT_FONTNAME = Helvetica 281 | DOT_FONTSIZE = 10 282 | DOT_FONTPATH = 283 | CLASS_GRAPH = YES 284 | COLLABORATION_GRAPH = YES 285 | GROUP_GRAPHS = YES 286 | UML_LOOK = NO 287 | UML_LIMIT_NUM_FIELDS = 10 288 | TEMPLATE_RELATIONS = NO 289 | INCLUDE_GRAPH = YES 290 | INCLUDED_BY_GRAPH = YES 291 | CALL_GRAPH = YES 292 | CALLER_GRAPH = YES 293 | GRAPHICAL_HIERARCHY = YES 294 | DIRECTORY_GRAPH = YES 295 | DOT_IMAGE_FORMAT = svg 296 | INTERACTIVE_SVG = YES 297 | DOT_PATH = 298 | DOTFILE_DIRS = 299 | MSCFILE_DIRS = 300 | DIAFILE_DIRS = 301 | DOT_GRAPH_MAX_NODES = 50 302 | MAX_DOT_GRAPH_DEPTH = 0 303 | DOT_TRANSPARENT = NO 304 | DOT_MULTI_TARGETS = YES 305 | GENERATE_LEGEND = YES 306 | DOT_CLEANUP = YES 307 | -------------------------------------------------------------------------------- /src/veridoc-page-factory.c: -------------------------------------------------------------------------------- 1 | /*! 2 | @file veridoc-page-factory.c 3 | @brief Defines functions and structures responsible for building the 4 | documentation pages. 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include "veridoc-page-factory.h" 17 | 18 | /*! 19 | @brief Responsible for copying all template asset files to the output folder. 20 | */ 21 | void veridoc_pf_copy_assets( 22 | veridoc_config * config 23 | ){ 24 | char * to_copy[4]; 25 | to_copy[0] = "module.html"; 26 | to_copy[1] = "list.html"; 27 | to_copy[2] = "script.js"; 28 | to_copy[3] = "style.css"; 29 | 30 | size_t src_len = strlen(config -> v_assets_dir); 31 | size_t tgt_len = strlen(config -> v_output); 32 | 33 | int i = 0; 34 | for(i = 0; i < 4; i++) 35 | { 36 | char * src_path = calloc(src_len + strlen(to_copy[i])+1,sizeof(char)); 37 | strcat(src_path, config -> v_assets_dir); 38 | strcat(src_path, to_copy[i]); 39 | char * tgt_path = calloc(tgt_len + strlen(to_copy[i])+1,sizeof(char)); 40 | strcat(tgt_path, config -> v_output); 41 | strcat(tgt_path, to_copy[i]); 42 | 43 | FILE * source = fopen(src_path,"r"); 44 | FILE * target = fopen(tgt_path,"w"); 45 | 46 | if(!source) 47 | { 48 | printf("ERROR: Could not source template file: '%s'\n", src_path); 49 | } 50 | else if(!target) 51 | { 52 | printf("ERROR: Could not open target file: '%s'\n", tgt_path); 53 | } 54 | else 55 | { 56 | printf("Copying '%s' -> '%s'\n", src_path, tgt_path); 57 | char ch; 58 | while((ch = fgetc(source)) != EOF){ 59 | fputc(ch,target); 60 | } 61 | } 62 | 63 | free(src_path); 64 | free(tgt_path); 65 | fclose(source); 66 | fclose(target); 67 | } 68 | } 69 | 70 | /*! 71 | @brief Sets up the output folder. 72 | @returns True if all goes well, false otherwise. 73 | */ 74 | boolean veridoc_pf_setup_output_folder( 75 | veridoc_config * config 76 | ){ 77 | struct stat status = {0}; 78 | 79 | if (stat(config -> v_output, &status) == -1) { 80 | int result = mkdir(config -> v_output, 0700); 81 | 82 | if(result == 0){ 83 | return BOOL_TRUE; 84 | } 85 | else{ 86 | return BOOL_FALSE; 87 | } 88 | } 89 | return BOOL_TRUE; 90 | } 91 | 92 | 93 | /*! 94 | @brief Responsible for exporting the list of parsed files to a json data file. 95 | @param [in] manifest - The list of files. 96 | @param [in] destination - The JSON file to write to. 97 | @returns Void 98 | */ 99 | void veridoc_pf_export_file_list_json( 100 | veridoc_manifest * manifest, 101 | json_file * fh 102 | ){ 103 | json_object * top = json_new_object(); 104 | json_object_add_string(top,"listType","file-manifest"); 105 | json_object_add_string(top,"listTitle","List of documented files."); 106 | json_object_add_string(top,"listNotes","This is the list of all files specified as input to Veridoc, along with their parse status."); 107 | 108 | json_object * list = json_new_object(); 109 | 110 | unsigned int i; 111 | for(i = 0; i < manifest -> file_count; i ++){ 112 | veridoc_manifest_file f = manifest -> files[i]; 113 | json_object * toadd = json_new_object(); 114 | 115 | json_object_add_string(toadd, "path", f.path); 116 | json_object_add_int(toadd, "parsed", f.parsed); 117 | json_object_add_int(toadd, "success", f.parse_success); 118 | 119 | json_object_add_object(list, "", toadd); 120 | } 121 | 122 | json_object_add_list(top,"listData", list); 123 | json_emit_object(fh, top, "veridocFileList", 0); 124 | } 125 | 126 | 127 | /*! 128 | @brief Responsible for emitting the list of modules for the project. 129 | */ 130 | void veridoc_pf_export_module_list_json( 131 | verilog_source_tree * source, 132 | json_file * fh 133 | ){ 134 | 135 | json_object * top = json_new_object(); 136 | json_object_add_string(top,"listType","module-manifest"); 137 | json_object_add_string(top,"listTitle","List of documented modules."); 138 | json_object_add_string(top,"listNotes","This is the list of all hardware modules declared in the source code."); 139 | 140 | json_object * list = json_new_object(); 141 | unsigned int i; 142 | 143 | for(i = 0; i < source -> modules -> items; i ++) 144 | { 145 | ast_module_declaration * module = ast_list_get(source -> modules,i); 146 | char * identifier = ast_identifier_tostring(module -> identifier); 147 | 148 | json_object * toadd = json_new_object(); 149 | 150 | json_object_add_string(toadd, "id", identifier); 151 | json_object_add_string(toadd, "brief", "None"); 152 | json_object_add_string(toadd, "file", module -> meta.file); 153 | json_object_add_int (toadd, "line", module -> meta.line); 154 | 155 | json_object_add_object(list, "", toadd); 156 | } 157 | 158 | json_object_add_list(top,"listData", list); 159 | json_emit_object(fh, top, "veridocModuleList", 0); 160 | 161 | } 162 | 163 | 164 | /*! 165 | @brief Responsible for emitting the verilog module hierarchy as JSON. 166 | @param [in] top_module - The top level module / root of the hierarchy. 167 | @param [in] source - The parsed source tree 168 | */ 169 | json_object * veridoc_pf_export_hierarchy_json( 170 | ast_module_declaration * top_module, 171 | json_file * destination, 172 | unsigned int depth 173 | ){ 174 | 175 | if(depth == 0) 176 | { 177 | json_object * top = json_new_object(); 178 | json_object_add_string(top,"listType","module-hierarchy"); 179 | json_object_add_string(top,"listTitle","Module Hierarchy."); 180 | json_object_add_string(top,"listNotes","This is the module inheritance hierarchy for the project."); 181 | 182 | json_object * listdata = json_new_object(); 183 | json_object * module = json_new_object(); 184 | 185 | char * top_id = ast_identifier_tostring(top_module->identifier); 186 | 187 | json_object_add_string(module, "id", top_id); 188 | json_object_add_string(module, "file", top_module -> meta.file); 189 | json_object_add_int (module, "line", top_module -> meta.line); 190 | json_object_add_int (module, "depth", depth); 191 | 192 | // Recurse down the list of children. 193 | json_object * children = veridoc_pf_export_hierarchy_json( 194 | top_module, destination, depth+1); 195 | json_object_add_list(module,"children", children); 196 | 197 | json_object_add_object(listdata, "", module); 198 | json_object_add_list(top,"listData",listdata); 199 | json_emit_object(destination, top, "veridocModuleHierarchy", 0); 200 | return; 201 | } 202 | else 203 | { 204 | 205 | ast_list * children = verilog_module_get_children(top_module); 206 | json_object * tr = json_new_object(); 207 | 208 | unsigned int m; 209 | for(m = 0; m < children -> items; m++) 210 | { 211 | ast_module_instantiation * child = ast_list_get(children, m); 212 | char * child_id; 213 | json_object * child_list; 214 | json_object * child_obj = json_new_object();; 215 | 216 | if(child -> resolved){ 217 | child_id = ast_identifier_tostring( 218 | child->declaration->identifier); 219 | } else { 220 | child_id = ast_identifier_tostring(child->module_identifer); 221 | } 222 | 223 | json_object_add_string(child_obj, "id", child_id); 224 | json_object_add_string(child_obj, "file", child -> meta.file); 225 | json_object_add_int (child_obj, "line", child -> meta.line); 226 | json_object_add_int (child_obj, "depth", depth); 227 | 228 | if(child -> resolved){ 229 | child_list = veridoc_pf_export_hierarchy_json( 230 | child -> declaration, destination, depth + 1); 231 | } else { 232 | child_list = json_new_object(); 233 | } 234 | 235 | json_object_add_list(child_obj,"children", child_list); 236 | json_object_add_object(tr,"",child_obj); 237 | } 238 | 239 | return tr; 240 | } 241 | } 242 | 243 | 244 | //! Creates a uniform filename for a module's JSON data structure. 245 | char * veridoc_pf_module_filename( 246 | veridoc_config * config, 247 | ast_module_declaration * module 248 | ){ 249 | char * file_name; 250 | char * module_id = ast_identifier_tostring(module -> identifier); 251 | 252 | size_t len = strlen(module_id) + strlen(config -> v_output) + 14; 253 | 254 | file_name = calloc(len, sizeof(char)); 255 | strcat(file_name, config -> v_output); 256 | strcat(file_name, "/module_"); 257 | strcat(file_name, module_id); 258 | strcat(file_name, ".json"); 259 | 260 | free(module_id); 261 | return file_name; 262 | } 263 | 264 | /*! 265 | @brief Function responsible for exporting information on a module as JSON. 266 | @param [in] config - The veridoc config being adhered to. 267 | @param [in] module - The module to document. 268 | */ 269 | void veridoc_pf_export_module_json( 270 | veridoc_config * config, 271 | ast_module_declaration * module 272 | ){ 273 | // Where are we going to put all the JSON data? 274 | char * output_file_name = veridoc_pf_module_filename(config,module); 275 | json_file * fh = json_new_file(output_file_name); 276 | json_object * top = json_new_object(); 277 | 278 | char * module_name = ast_identifier_tostring(module->identifier); 279 | 280 | // Set the standard module properties. 281 | json_object_add_string(top, "moduleName", module_name); 282 | json_object_add_string(top, "moduleFile", module -> meta.file); 283 | json_object_add_int (top, "moduleLine", module -> meta.line); 284 | json_object_add_string(top, "moduleBrief", "None"); 285 | 286 | // Add the list of ports 287 | unsigned int i_p; 288 | json_object * m_ports = json_new_object(); 289 | 290 | for(i_p = 0; i_p < module -> module_ports -> items; i_p ++){ 291 | json_object * toadd = json_new_object(); 292 | ast_port_declaration * port = ast_list_get(module -> module_ports,i_p); 293 | 294 | char * port_id = ast_identifier_tostring( 295 | ast_list_get(port -> port_names,0)); 296 | char * p_type = "?"; 297 | char * port_range = "?:?"; 298 | char * p_dir; 299 | 300 | if(port -> is_reg) p_type = "reg"; 301 | else if(port -> is_variable) p_type = "var"; 302 | else p_type = "wire"; 303 | 304 | switch(port -> direction){ 305 | case PORT_INPUT: 306 | p_dir = "Input"; break; 307 | case PORT_INOUT: 308 | p_dir = "Inout"; break; 309 | case PORT_OUTPUT: 310 | p_dir = "Output"; break; 311 | default: 312 | p_dir = "Unknown"; break; 313 | } 314 | 315 | json_object_add_string(toadd,"name", port_id); 316 | json_object_add_string(toadd,"type", p_type); 317 | json_object_add_string(toadd,"range", port_range); 318 | json_object_add_string(toadd,"direction", p_dir); 319 | 320 | json_object_add_object(m_ports,"",toadd); 321 | } 322 | json_object_add_list(top, "ports", m_ports); 323 | 324 | // Add the list of child modules. 325 | unsigned int i_m; 326 | json_object * m_children = json_new_object(); 327 | 328 | for(i_m = 0; i_m < module -> module_instantiations -> items; i_m++) 329 | { 330 | json_object * toadd = json_new_object(); 331 | ast_module_instantiation * inst = ast_list_get( 332 | module -> module_instantiations, i_m); 333 | 334 | char * child_id; 335 | if(inst -> resolved){ 336 | child_id = ast_identifier_tostring(inst->declaration->identifier); 337 | } else { 338 | child_id = ast_identifier_tostring(inst->module_identifer); 339 | } 340 | 341 | json_object_add_string(toadd, "moduleName", child_id); 342 | 343 | json_object_add_object(m_children, "", toadd); 344 | } 345 | json_object_add_list(top, "children", m_children); 346 | 347 | // Emit and finish up. 348 | json_emit_object(fh,top,"veridocModuleInformation",0); 349 | fprintf(fh->fh,"\n\nveridoc_render_module();\n"); 350 | json_close_file(fh); 351 | } 352 | 353 | 354 | /*! 355 | @brief concatenates the config->v_output and supplied filename into a single 356 | file path and returns it. 357 | */ 358 | char * veridoc_pf_jsonfilename( 359 | veridoc_config * config, 360 | char * filename 361 | ){ 362 | size_t len = strlen(config -> v_output) + strlen(filename) + 1; 363 | char * json_file = calloc(len, sizeof(char)); 364 | strcat(json_file, config -> v_output); 365 | strcat(json_file, filename); 366 | return json_file; 367 | } 368 | 369 | 370 | /*! 371 | @brief Top level function for exporting the whole parsed data set to html. 372 | @param [in] manifest - The list of files parsed. 373 | @param [in] config - Configuration options for the output. 374 | @param [in] source - The parsed source tree 375 | */ 376 | void veridoc_pf_build( 377 | veridoc_manifest * manifest, 378 | veridoc_config * config, 379 | verilog_source_tree * source 380 | ){ 381 | // Make sure we can find the module supposedly at the hierarchy root. 382 | ast_module_declaration * top_module = verilog_find_module_declaration( 383 | source, 384 | ast_new_identifier(config -> v_top_module, 0) 385 | ); 386 | 387 | 388 | // First, we need to setup the output directory. 389 | veridoc_pf_setup_output_folder(config); 390 | 391 | char * json_file_p =veridoc_pf_jsonfilename(config, "file_list.js"); 392 | char * module_file =veridoc_pf_jsonfilename(config, "module_list.js"); 393 | char * module_hier =veridoc_pf_jsonfilename(config,"module_hierarchy.js"); 394 | 395 | json_file * json_file_h = json_new_file(json_file_p); 396 | json_file * module_file_h = json_new_file(module_file); 397 | json_file * module_hier_h = json_new_file(module_hier); 398 | 399 | veridoc_pf_export_file_list_json(manifest,json_file_h); 400 | veridoc_pf_export_module_list_json(source,module_file_h); 401 | 402 | if(!top_module){ 403 | printf("ERROR: Could not find the top module '%s' in the source.\n", 404 | config -> v_top_module); 405 | printf("\tThe module hierarchy page will not work.\n"); 406 | } else { 407 | veridoc_pf_export_hierarchy_json(top_module, module_hier_h, 0); 408 | } 409 | 410 | free(json_file_p); 411 | free(module_file); 412 | free(module_hier); 413 | 414 | json_close_file(json_file_h); 415 | json_close_file(module_file_h); 416 | json_close_file(module_hier_h); 417 | 418 | // Next, export the individual module pages. 419 | printf("Exporting Module Documentation: "); 420 | int m; 421 | for(m = 0; m < source -> modules -> items; m++) 422 | { 423 | ast_module_declaration * module = ast_list_get(source->modules, m); 424 | veridoc_pf_export_module_json(config, module); 425 | } 426 | printf("\n"); 427 | } 428 | -------------------------------------------------------------------------------- /docs/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* The standard CSS for doxygen 1.8.6 */ 2 | 3 | body, table, div, p, dl { 4 | font: 400 14px/22px Roboto,sans-serif; 5 | } 6 | 7 | #navrow1{display:none;} 8 | #navrow2{display:none;} 9 | 10 | /* @group Heading Levels */ 11 | 12 | h1.groupheader { 13 | font-size: 150%; 14 | } 15 | 16 | .title { 17 | font: 400 14px/28px Roboto,sans-serif; 18 | font-size: 150%; 19 | font-weight: bold; 20 | margin: 10px 2px; 21 | } 22 | 23 | h2.groupheader { 24 | border-bottom: 1px solid #879ECB; 25 | color: #354C7B; 26 | font-size: 150%; 27 | font-weight: normal; 28 | margin-top: 1.75em; 29 | padding-top: 8px; 30 | padding-bottom: 4px; 31 | width: 100%; 32 | } 33 | 34 | h3.groupheader { 35 | font-size: 100%; 36 | } 37 | 38 | h1, h2, h3, h4, h5, h6 { 39 | -webkit-transition: text-shadow 0.5s linear; 40 | -moz-transition: text-shadow 0.5s linear; 41 | -ms-transition: text-shadow 0.5s linear; 42 | -o-transition: text-shadow 0.5s linear; 43 | transition: text-shadow 0.5s linear; 44 | margin-right: 15px; 45 | } 46 | 47 | h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { 48 | text-shadow: 0 0 15px cyan; 49 | } 50 | 51 | dt { 52 | font-weight: bold; 53 | } 54 | 55 | div.multicol { 56 | -moz-column-gap: 1em; 57 | -webkit-column-gap: 1em; 58 | -moz-column-count: 3; 59 | -webkit-column-count: 3; 60 | } 61 | 62 | p.startli, p.startdd { 63 | margin-top: 2px; 64 | } 65 | 66 | p.starttd { 67 | margin-top: 0px; 68 | } 69 | 70 | p.endli { 71 | margin-bottom: 0px; 72 | } 73 | 74 | p.enddd { 75 | margin-bottom: 4px; 76 | } 77 | 78 | p.endtd { 79 | margin-bottom: 2px; 80 | } 81 | 82 | /* @end */ 83 | 84 | caption { 85 | font-weight: bold; 86 | } 87 | 88 | span.legend { 89 | font-size: 70%; 90 | text-align: center; 91 | } 92 | 93 | h3.version { 94 | font-size: 90%; 95 | text-align: center; 96 | } 97 | 98 | div.qindex, div.navtab{ 99 | background-color: #EBEFF6; 100 | border: 1px solid #A3B4D7; 101 | text-align: center; 102 | } 103 | 104 | div.qindex, div.navpath { 105 | width: 100%; 106 | line-height: 140%; 107 | } 108 | 109 | div.navtab { 110 | margin-right: 15px; 111 | } 112 | 113 | /* @group Link Styling */ 114 | 115 | a { 116 | color: #3D578C; 117 | font-weight: normal; 118 | text-decoration: none; 119 | } 120 | 121 | .contents a:visited { 122 | color: #4665A2; 123 | } 124 | 125 | a:hover { 126 | text-decoration: underline; 127 | } 128 | 129 | a.qindex { 130 | font-weight: bold; 131 | } 132 | 133 | a.qindexHL { 134 | font-weight: bold; 135 | background-color: #9CAFD4; 136 | color: #ffffff; 137 | border: 1px double #869DCA; 138 | } 139 | 140 | .contents a.qindexHL:visited { 141 | color: #ffffff; 142 | } 143 | 144 | a.el { 145 | font-weight: bold; 146 | } 147 | 148 | a.elRef { 149 | } 150 | 151 | a.code, a.code:visited, a.line, a.line:visited { 152 | color: #4665A2; 153 | } 154 | 155 | a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { 156 | color: #4665A2; 157 | } 158 | 159 | /* @end */ 160 | 161 | dl.el { 162 | margin-left: -1cm; 163 | } 164 | 165 | pre.fragment { 166 | border: 1px solid #C4CFE5; 167 | background-color: #FBFCFD; 168 | padding: 4px 6px; 169 | margin: 4px 8px 4px 2px; 170 | overflow: auto; 171 | word-wrap: break-word; 172 | font-size: 9pt; 173 | line-height: 125%; 174 | font-family: monospace, fixed; 175 | font-size: 105%; 176 | } 177 | 178 | div.fragment { 179 | padding: 4px 6px; 180 | margin: 4px 8px 4px 2px; 181 | background-color: #FBFCFD; 182 | border: 1px solid #C4CFE5; 183 | } 184 | 185 | div.line { 186 | font-family: monospace, fixed; 187 | font-size: 13px; 188 | min-height: 13px; 189 | line-height: 1.0; 190 | text-wrap: unrestricted; 191 | white-space: -moz-pre-wrap; /* Moz */ 192 | white-space: -pre-wrap; /* Opera 4-6 */ 193 | white-space: -o-pre-wrap; /* Opera 7 */ 194 | white-space: pre-wrap; /* CSS3 */ 195 | word-wrap: break-word; /* IE 5.5+ */ 196 | text-indent: -53px; 197 | padding-left: 53px; 198 | padding-bottom: 0px; 199 | margin: 0px; 200 | -webkit-transition-property: background-color, box-shadow; 201 | -webkit-transition-duration: 0.5s; 202 | -moz-transition-property: background-color, box-shadow; 203 | -moz-transition-duration: 0.5s; 204 | -ms-transition-property: background-color, box-shadow; 205 | -ms-transition-duration: 0.5s; 206 | -o-transition-property: background-color, box-shadow; 207 | -o-transition-duration: 0.5s; 208 | transition-property: background-color, box-shadow; 209 | transition-duration: 0.5s; 210 | } 211 | 212 | div.line.glow { 213 | background-color: cyan; 214 | box-shadow: 0 0 10px cyan; 215 | } 216 | 217 | 218 | span.lineno { 219 | padding-right: 4px; 220 | text-align: right; 221 | border-right: 2px solid #0F0; 222 | background-color: #E8E8E8; 223 | white-space: pre; 224 | } 225 | span.lineno a { 226 | background-color: #D8D8D8; 227 | } 228 | 229 | span.lineno a:hover { 230 | background-color: #C8C8C8; 231 | } 232 | 233 | div.ah { 234 | background-color: black; 235 | font-weight: bold; 236 | color: #ffffff; 237 | margin-bottom: 3px; 238 | margin-top: 3px; 239 | padding: 0.2em; 240 | border: solid thin #333; 241 | border-radius: 0.5em; 242 | -webkit-border-radius: .5em; 243 | -moz-border-radius: .5em; 244 | box-shadow: 2px 2px 3px #999; 245 | -webkit-box-shadow: 2px 2px 3px #999; 246 | -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; 247 | background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); 248 | background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); 249 | } 250 | 251 | div.groupHeader { 252 | margin-left: 16px; 253 | margin-top: 12px; 254 | font-weight: bold; 255 | } 256 | 257 | div.groupText { 258 | margin-left: 16px; 259 | font-style: italic; 260 | } 261 | 262 | body { 263 | background-color: white; 264 | color: black; 265 | margin: 0; 266 | } 267 | 268 | div.contents { 269 | margin-top: 10px; 270 | margin-left: auto; 271 | margin-right: auto; 272 | max-width: 830px; 273 | background-color: white; 274 | padding: 5px; 275 | padding-left: 10px; 276 | padding-right: 10px; 277 | border-radius: 5px; 278 | } 279 | 280 | td.indexkey { 281 | background-color: #EBEFF6; 282 | font-weight: bold; 283 | border: 1px solid #C4CFE5; 284 | margin: 2px 0px 2px 0; 285 | padding: 2px 10px; 286 | white-space: nowrap; 287 | vertical-align: top; 288 | } 289 | 290 | td.indexvalue { 291 | background-color: #EBEFF6; 292 | border: 1px solid #C4CFE5; 293 | padding: 2px 10px; 294 | margin: 2px 0px; 295 | } 296 | 297 | tr.memlist { 298 | background-color: #EEF1F7; 299 | } 300 | 301 | p.formulaDsp { 302 | text-align: center; 303 | } 304 | 305 | img.formulaDsp { 306 | 307 | } 308 | 309 | img.formulaInl { 310 | vertical-align: middle; 311 | } 312 | 313 | div.center { 314 | text-align: center; 315 | margin-top: 0px; 316 | margin-bottom: 0px; 317 | padding: 0px; 318 | } 319 | 320 | div.center img { 321 | border: 0px; 322 | } 323 | 324 | address.footer { 325 | text-align: right; 326 | padding-right: 12px; 327 | } 328 | 329 | img.footer { 330 | border: 0px; 331 | vertical-align: middle; 332 | } 333 | 334 | /* @group Code Colorization */ 335 | 336 | span.keyword { 337 | color: #008000 338 | } 339 | 340 | span.keywordtype { 341 | color: #604020 342 | } 343 | 344 | span.keywordflow { 345 | color: #e08000 346 | } 347 | 348 | span.comment { 349 | color: #800000 350 | } 351 | 352 | span.preprocessor { 353 | color: #806020 354 | } 355 | 356 | span.stringliteral { 357 | color: #002080 358 | } 359 | 360 | span.charliteral { 361 | color: #008080 362 | } 363 | 364 | span.vhdldigit { 365 | color: #ff00ff 366 | } 367 | 368 | span.vhdlchar { 369 | color: #000000 370 | } 371 | 372 | span.vhdlkeyword { 373 | color: #700070 374 | } 375 | 376 | span.vhdllogic { 377 | color: #ff0000 378 | } 379 | 380 | blockquote { 381 | background-color: #F7F8FB; 382 | border-left: 2px solid #9CAFD4; 383 | margin: 0 24px 0 4px; 384 | padding: 0 12px 0 16px; 385 | } 386 | 387 | /* @end */ 388 | 389 | /* 390 | .search { 391 | color: #003399; 392 | font-weight: bold; 393 | } 394 | 395 | form.search { 396 | margin-bottom: 0px; 397 | margin-top: 0px; 398 | } 399 | 400 | input.search { 401 | font-size: 75%; 402 | color: #000080; 403 | font-weight: normal; 404 | background-color: #e8eef2; 405 | } 406 | */ 407 | 408 | td.tiny { 409 | font-size: 75%; 410 | } 411 | 412 | .dirtab { 413 | padding: 4px; 414 | border-collapse: collapse; 415 | border: 1px solid #A3B4D7; 416 | } 417 | 418 | th.dirtab { 419 | background: #EBEFF6; 420 | font-weight: bold; 421 | } 422 | 423 | hr { 424 | height: 0px; 425 | border: none; 426 | border-top: 1px solid #4A6AAA; 427 | } 428 | 429 | hr.footer { 430 | height: 1px; 431 | } 432 | 433 | /* @group Member Descriptions */ 434 | 435 | table.memberdecls { 436 | border-spacing: 0px; 437 | padding: 0px; 438 | } 439 | 440 | .memberdecls td, .fieldtable tr { 441 | -webkit-transition-property: background-color, box-shadow; 442 | -webkit-transition-duration: 0.5s; 443 | -moz-transition-property: background-color, box-shadow; 444 | -moz-transition-duration: 0.5s; 445 | -ms-transition-property: background-color, box-shadow; 446 | -ms-transition-duration: 0.5s; 447 | -o-transition-property: background-color, box-shadow; 448 | -o-transition-duration: 0.5s; 449 | transition-property: background-color, box-shadow; 450 | transition-duration: 0.5s; 451 | } 452 | 453 | .memberdecls td.glow, .fieldtable tr.glow { 454 | background-color: cyan; 455 | box-shadow: 0 0 15px cyan; 456 | } 457 | 458 | .mdescLeft, .mdescRight, 459 | .memItemLeft, .memItemRight, 460 | .memTemplItemLeft, .memTemplItemRight, .memTemplParams { 461 | background-color: #F9FAFC; 462 | border: none; 463 | margin: 4px; 464 | padding: 1px 0 0 8px; 465 | } 466 | 467 | .mdescLeft, .mdescRight { 468 | padding: 0px 8px 4px 8px; 469 | color: #555; 470 | } 471 | 472 | .memSeparator { 473 | border-bottom: 1px solid #DEE4F0; 474 | line-height: 1px; 475 | margin: 0px; 476 | padding: 0px; 477 | } 478 | 479 | .memItemLeft, .memTemplItemLeft { 480 | white-space: nowrap; 481 | } 482 | 483 | .memItemRight { 484 | width: 100%; 485 | } 486 | 487 | .memTemplParams { 488 | color: #4665A2; 489 | white-space: nowrap; 490 | font-size: 80%; 491 | } 492 | 493 | /* @end */ 494 | 495 | /* @group Member Details */ 496 | 497 | /* Styles for detailed member documentation */ 498 | 499 | .memtemplate { 500 | font-size: 80%; 501 | color: #4665A2; 502 | font-weight: normal; 503 | margin-left: 9px; 504 | } 505 | 506 | .memnav { 507 | background-color: #EBEFF6; 508 | border: 1px solid #A3B4D7; 509 | text-align: center; 510 | margin: 2px; 511 | margin-right: 15px; 512 | padding: 2px; 513 | } 514 | 515 | .mempage { 516 | width: 100%; 517 | } 518 | 519 | .memitem { 520 | padding: 0; 521 | margin-bottom: 10px; 522 | margin-right: 5px; 523 | -webkit-transition: box-shadow 0.5s linear; 524 | -moz-transition: box-shadow 0.5s linear; 525 | -ms-transition: box-shadow 0.5s linear; 526 | -o-transition: box-shadow 0.5s linear; 527 | transition: box-shadow 0.5s linear; 528 | display: table !important; 529 | width: 100%; 530 | } 531 | 532 | .memitem.glow { 533 | box-shadow: 0 0 15px cyan; 534 | } 535 | 536 | .memname { 537 | font-weight: bold; 538 | margin-left: 6px; 539 | } 540 | 541 | .memname td { 542 | vertical-align: bottom; 543 | } 544 | 545 | .memproto, dl.reflist dt { 546 | border-top: 1px solid #A8B8D9; 547 | border-left: 1px solid #A8B8D9; 548 | border-right: 1px solid #A8B8D9; 549 | padding: 6px 0px 6px 0px; 550 | color: #253555; 551 | font-weight: bold; 552 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 553 | background-image:url('nav_f.png'); 554 | background-repeat:repeat-x; 555 | background-color: #E2E8F2; 556 | /* opera specific markup */ 557 | box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); 558 | border-top-right-radius: 4px; 559 | border-top-left-radius: 4px; 560 | /* firefox specific markup */ 561 | -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; 562 | -moz-border-radius-topright: 4px; 563 | -moz-border-radius-topleft: 4px; 564 | /* webkit specific markup */ 565 | -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); 566 | -webkit-border-top-right-radius: 4px; 567 | -webkit-border-top-left-radius: 4px; 568 | 569 | } 570 | 571 | .memdoc, dl.reflist dd { 572 | border-bottom: 1px solid #A8B8D9; 573 | border-left: 1px solid #A8B8D9; 574 | border-right: 1px solid #A8B8D9; 575 | padding: 6px 10px 2px 10px; 576 | background-color: #FBFCFD; 577 | border-top-width: 0; 578 | background-image:url('nav_g.png'); 579 | background-repeat:repeat-x; 580 | background-color: #FFFFFF; 581 | /* opera specific markup */ 582 | border-bottom-left-radius: 4px; 583 | border-bottom-right-radius: 4px; 584 | box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); 585 | /* firefox specific markup */ 586 | -moz-border-radius-bottomleft: 4px; 587 | -moz-border-radius-bottomright: 4px; 588 | -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; 589 | /* webkit specific markup */ 590 | -webkit-border-bottom-left-radius: 4px; 591 | -webkit-border-bottom-right-radius: 4px; 592 | -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); 593 | } 594 | 595 | dl.reflist dt { 596 | padding: 5px; 597 | } 598 | 599 | dl.reflist dd { 600 | margin: 0px 0px 10px 0px; 601 | padding: 5px; 602 | } 603 | 604 | .paramkey { 605 | text-align: right; 606 | } 607 | 608 | .paramtype { 609 | white-space: nowrap; 610 | } 611 | 612 | .paramname { 613 | color: #602020; 614 | white-space: nowrap; 615 | } 616 | .paramname em { 617 | font-style: normal; 618 | } 619 | .paramname code { 620 | line-height: 14px; 621 | } 622 | 623 | .params, .retval, .exception, .tparams { 624 | margin-left: 0px; 625 | padding-left: 0px; 626 | } 627 | 628 | .params .paramname, .retval .paramname { 629 | font-weight: bold; 630 | vertical-align: top; 631 | } 632 | 633 | .params .paramtype { 634 | font-style: italic; 635 | vertical-align: top; 636 | } 637 | 638 | .params .paramdir { 639 | font-family: "courier new",courier,monospace; 640 | vertical-align: top; 641 | } 642 | 643 | table.mlabels { 644 | border-spacing: 0px; 645 | } 646 | 647 | td.mlabels-left { 648 | width: 100%; 649 | padding: 0px; 650 | } 651 | 652 | td.mlabels-right { 653 | vertical-align: bottom; 654 | padding: 0px; 655 | white-space: nowrap; 656 | } 657 | 658 | span.mlabels { 659 | margin-left: 8px; 660 | } 661 | 662 | span.mlabel { 663 | background-color: #728DC1; 664 | border-top:1px solid #5373B4; 665 | border-left:1px solid #5373B4; 666 | border-right:1px solid #C4CFE5; 667 | border-bottom:1px solid #C4CFE5; 668 | text-shadow: none; 669 | color: white; 670 | margin-right: 4px; 671 | padding: 2px 3px; 672 | border-radius: 3px; 673 | font-size: 7pt; 674 | white-space: nowrap; 675 | vertical-align: middle; 676 | } 677 | 678 | 679 | 680 | /* @end */ 681 | 682 | /* these are for tree view when not used as main index */ 683 | 684 | div.directory { 685 | margin: 10px 0px; 686 | border-top: 1px solid #A8B8D9; 687 | border-bottom: 1px solid #A8B8D9; 688 | width: 100%; 689 | } 690 | 691 | .directory table { 692 | border-collapse:collapse; 693 | } 694 | 695 | .directory td { 696 | margin: 0px; 697 | padding: 0px; 698 | vertical-align: top; 699 | } 700 | 701 | .directory td.entry { 702 | white-space: nowrap; 703 | padding-right: 6px; 704 | padding-top: 3px; 705 | } 706 | 707 | .directory td.entry a { 708 | outline:none; 709 | } 710 | 711 | .directory td.entry a img { 712 | border: none; 713 | } 714 | 715 | .directory td.desc { 716 | width: 100%; 717 | padding-left: 6px; 718 | padding-right: 6px; 719 | padding-top: 3px; 720 | border-left: 1px solid rgba(0,0,0,0.05); 721 | } 722 | 723 | .directory tr.even { 724 | padding-left: 6px; 725 | background-color: #F7F8FB; 726 | } 727 | 728 | .directory img { 729 | vertical-align: -30%; 730 | } 731 | 732 | .directory .levels { 733 | white-space: nowrap; 734 | width: 100%; 735 | text-align: right; 736 | font-size: 9pt; 737 | } 738 | 739 | .directory .levels span { 740 | cursor: pointer; 741 | padding-left: 2px; 742 | padding-right: 2px; 743 | color: #3D578C; 744 | } 745 | 746 | div.dynheader { 747 | margin-top: 8px; 748 | -webkit-touch-callout: none; 749 | -webkit-user-select: none; 750 | -khtml-user-select: none; 751 | -moz-user-select: none; 752 | -ms-user-select: none; 753 | user-select: none; 754 | } 755 | 756 | address { 757 | font-style: normal; 758 | color: #2A3D61; 759 | } 760 | 761 | table.doxtable { 762 | border-collapse:collapse; 763 | margin-top: 4px; 764 | margin-bottom: 4px; 765 | } 766 | 767 | table.doxtable td, table.doxtable th { 768 | border: 1px solid #2D4068; 769 | padding: 3px 7px 2px; 770 | } 771 | 772 | table.doxtable th { 773 | background-color: #374F7F; 774 | color: #FFFFFF; 775 | font-size: 110%; 776 | padding-bottom: 4px; 777 | padding-top: 5px; 778 | } 779 | 780 | table.fieldtable { 781 | /*width: 100%;*/ 782 | margin-bottom: 10px; 783 | border: 1px solid #A8B8D9; 784 | border-spacing: 0px; 785 | -moz-border-radius: 4px; 786 | -webkit-border-radius: 4px; 787 | border-radius: 4px; 788 | -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; 789 | -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); 790 | box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); 791 | } 792 | 793 | .fieldtable td, .fieldtable th { 794 | padding: 3px 7px 2px; 795 | } 796 | 797 | .fieldtable td.fieldtype, .fieldtable td.fieldname { 798 | white-space: nowrap; 799 | border-right: 1px solid #A8B8D9; 800 | border-bottom: 1px solid #A8B8D9; 801 | vertical-align: top; 802 | } 803 | 804 | .fieldtable td.fieldname { 805 | padding-top: 3px; 806 | } 807 | 808 | .fieldtable td.fielddoc { 809 | border-bottom: 1px solid #A8B8D9; 810 | /*width: 100%;*/ 811 | } 812 | 813 | .fieldtable td.fielddoc p:first-child { 814 | margin-top: 0px; 815 | } 816 | 817 | .fieldtable td.fielddoc p:last-child { 818 | margin-bottom: 2px; 819 | } 820 | 821 | .fieldtable tr:last-child td { 822 | border-bottom: none; 823 | } 824 | 825 | .fieldtable th { 826 | background-image:url('nav_f.png'); 827 | background-repeat:repeat-x; 828 | background-color: #E2E8F2; 829 | font-size: 90%; 830 | color: #253555; 831 | padding-bottom: 4px; 832 | padding-top: 5px; 833 | text-align:left; 834 | -moz-border-radius-topleft: 4px; 835 | -moz-border-radius-topright: 4px; 836 | -webkit-border-top-left-radius: 4px; 837 | -webkit-border-top-right-radius: 4px; 838 | border-top-left-radius: 4px; 839 | border-top-right-radius: 4px; 840 | border-bottom: 1px solid #A8B8D9; 841 | } 842 | 843 | 844 | .tabsearch { 845 | top: 0px; 846 | left: 10px; 847 | height: 36px; 848 | background-image: url('tab_b.png'); 849 | z-index: 101; 850 | overflow: hidden; 851 | font-size: 13px; 852 | } 853 | 854 | .navpath ul 855 | { 856 | font-size: 11px; 857 | background-image:url('tab_b.png'); 858 | background-repeat:repeat-x; 859 | background-position: 0 -5px; 860 | height:30px; 861 | line-height:30px; 862 | color:#8AA0CC; 863 | border:solid 1px #C2CDE4; 864 | overflow:hidden; 865 | margin:0px; 866 | padding:0px; 867 | } 868 | 869 | .navpath li 870 | { 871 | list-style-type:none; 872 | float:left; 873 | padding-left:10px; 874 | padding-right:15px; 875 | background-image:url('bc_s.png'); 876 | background-repeat:no-repeat; 877 | background-position:right; 878 | color:#364D7C; 879 | } 880 | 881 | .navpath li.navelem a 882 | { 883 | height:32px; 884 | display:block; 885 | text-decoration: none; 886 | outline: none; 887 | color: #283A5D; 888 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 889 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 890 | text-decoration: none; 891 | } 892 | 893 | .navpath li.navelem a:hover 894 | { 895 | color:#6884BD; 896 | } 897 | 898 | .navpath li.footer 899 | { 900 | list-style-type:none; 901 | float:right; 902 | padding-left:10px; 903 | padding-right:15px; 904 | background-image:none; 905 | background-repeat:no-repeat; 906 | background-position:right; 907 | color:#364D7C; 908 | font-size: 8pt; 909 | } 910 | 911 | 912 | div.summary 913 | { 914 | float: right; 915 | font-size: 8pt; 916 | padding-right: 5px; 917 | width: 50%; 918 | text-align: right; 919 | } 920 | 921 | div.summary a 922 | { 923 | white-space: nowrap; 924 | } 925 | 926 | div.ingroups 927 | { 928 | font-size: 8pt; 929 | width: 50%; 930 | text-align: left; 931 | } 932 | 933 | div.ingroups a 934 | { 935 | white-space: nowrap; 936 | } 937 | 938 | div.header 939 | { 940 | background-image:url('nav_h.png'); 941 | background-repeat:repeat-x; 942 | background-color: #F9FAFC; 943 | margin: 0px; 944 | border-bottom: 1px solid #C4CFE5; 945 | } 946 | 947 | div.headertitle 948 | { 949 | padding: 5px 5px 5px 10px; 950 | } 951 | 952 | dl 953 | { 954 | padding: 0 0 0 10px; 955 | } 956 | 957 | /* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ 958 | dl.section 959 | { 960 | margin-left: 0px; 961 | padding-left: 0px; 962 | } 963 | 964 | dl.note 965 | { 966 | margin-left:-7px; 967 | padding-left: 3px; 968 | border-left:4px solid; 969 | border-color: #D0C000; 970 | } 971 | 972 | dl.warning, dl.attention 973 | { 974 | margin-left:-7px; 975 | padding-left: 3px; 976 | border-left:4px solid; 977 | border-color: #FF0000; 978 | } 979 | 980 | dl.pre, dl.post, dl.invariant 981 | { 982 | margin-left:-7px; 983 | padding-left: 3px; 984 | border-left:4px solid; 985 | border-color: #00D000; 986 | } 987 | 988 | dl.deprecated 989 | { 990 | margin-left:-7px; 991 | padding-left: 3px; 992 | border-left:4px solid; 993 | border-color: #505050; 994 | } 995 | 996 | dl.todo 997 | { 998 | margin-left:-7px; 999 | padding-left: 3px; 1000 | border-left:4px solid; 1001 | border-color: #00C0E0; 1002 | } 1003 | 1004 | dl.test 1005 | { 1006 | margin-left:-7px; 1007 | padding-left: 3px; 1008 | border-left:4px solid; 1009 | border-color: #3030E0; 1010 | } 1011 | 1012 | dl.bug 1013 | { 1014 | margin-left:-7px; 1015 | padding-left: 3px; 1016 | border-left:4px solid; 1017 | border-color: #C08050; 1018 | } 1019 | 1020 | dl.section dd { 1021 | margin-bottom: 6px; 1022 | } 1023 | 1024 | 1025 | #projectlogo 1026 | { 1027 | text-align: center; 1028 | vertical-align: bottom; 1029 | border-collapse: separate; 1030 | } 1031 | 1032 | #projectlogo img 1033 | { 1034 | border: 0px none; 1035 | } 1036 | 1037 | #projectname 1038 | { 1039 | font: 300% Tahoma, Arial,sans-serif; 1040 | margin: 0px; 1041 | padding: 2px 0px; 1042 | } 1043 | 1044 | #projectbrief 1045 | { 1046 | font: 120% Tahoma, Arial,sans-serif; 1047 | margin: 0px; 1048 | padding: 0px; 1049 | } 1050 | 1051 | #projectnumber 1052 | { 1053 | font: 50% Tahoma, Arial,sans-serif; 1054 | margin: 0px; 1055 | padding: 0px; 1056 | } 1057 | 1058 | #titlearea 1059 | { 1060 | padding: 0px; 1061 | margin: 0px; 1062 | width: 100%; 1063 | border-bottom: 1px solid #5373B4; 1064 | } 1065 | 1066 | #doc-content 1067 | { 1068 | background-color: #F0F0F0; 1069 | } 1070 | 1071 | .image 1072 | { 1073 | text-align: center; 1074 | } 1075 | 1076 | .dotgraph 1077 | { 1078 | text-align: center; 1079 | } 1080 | 1081 | .mscgraph 1082 | { 1083 | text-align: center; 1084 | } 1085 | 1086 | .diagraph 1087 | { 1088 | text-align: center; 1089 | } 1090 | 1091 | .caption 1092 | { 1093 | font-weight: bold; 1094 | } 1095 | 1096 | div.zoom 1097 | { 1098 | border: 1px solid #90A5CE; 1099 | } 1100 | 1101 | dl.citelist { 1102 | margin-bottom:50px; 1103 | } 1104 | 1105 | dl.citelist dt { 1106 | color:#334975; 1107 | float:left; 1108 | font-weight:bold; 1109 | margin-right:10px; 1110 | padding:5px; 1111 | } 1112 | 1113 | dl.citelist dd { 1114 | margin:2px 0; 1115 | padding:5px 0; 1116 | } 1117 | 1118 | div.toc { 1119 | padding: 14px 25px; 1120 | background-color: #F4F6FA; 1121 | border: 1px solid #D8DFEE; 1122 | border-radius: 7px 7px 7px 7px; 1123 | float: right; 1124 | height: auto; 1125 | margin: 0 20px 10px 10px; 1126 | width: 200px; 1127 | } 1128 | 1129 | div.toc li { 1130 | background: url("bdwn.png") no-repeat scroll 0 5px transparent; 1131 | font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; 1132 | margin-top: 5px; 1133 | padding-left: 10px; 1134 | padding-top: 2px; 1135 | } 1136 | 1137 | div.toc h3 { 1138 | font: bold 12px/1.2 Arial,FreeSans,sans-serif; 1139 | color: #4665A2; 1140 | border-bottom: 0 none; 1141 | margin: 0; 1142 | } 1143 | 1144 | div.toc ul { 1145 | list-style: none outside none; 1146 | border: medium none; 1147 | padding: 0px; 1148 | } 1149 | 1150 | div.toc li.level1 { 1151 | margin-left: 0px; 1152 | } 1153 | 1154 | div.toc li.level2 { 1155 | margin-left: 15px; 1156 | } 1157 | 1158 | div.toc li.level3 { 1159 | margin-left: 30px; 1160 | } 1161 | 1162 | div.toc li.level4 { 1163 | margin-left: 45px; 1164 | } 1165 | 1166 | .inherit_header { 1167 | font-weight: bold; 1168 | color: gray; 1169 | cursor: pointer; 1170 | -webkit-touch-callout: none; 1171 | -webkit-user-select: none; 1172 | -khtml-user-select: none; 1173 | -moz-user-select: none; 1174 | -ms-user-select: none; 1175 | user-select: none; 1176 | } 1177 | 1178 | .inherit_header td { 1179 | padding: 6px 0px 2px 5px; 1180 | } 1181 | 1182 | .inherit { 1183 | display: none; 1184 | } 1185 | 1186 | tr.heading h2 { 1187 | margin-top: 12px; 1188 | margin-bottom: 4px; 1189 | } 1190 | 1191 | /* tooltip related style info */ 1192 | 1193 | .ttc { 1194 | position: absolute; 1195 | display: none; 1196 | } 1197 | 1198 | #powerTip { 1199 | cursor: default; 1200 | white-space: nowrap; 1201 | background-color: white; 1202 | border: 1px solid gray; 1203 | border-radius: 4px 4px 4px 4px; 1204 | box-shadow: 1px 1px 7px gray; 1205 | display: none; 1206 | font-size: smaller; 1207 | max-width: 80%; 1208 | opacity: 0.9; 1209 | padding: 1ex 1em 1em; 1210 | position: absolute; 1211 | z-index: 2147483647; 1212 | } 1213 | 1214 | #powerTip div.ttdoc { 1215 | color: grey; 1216 | font-style: italic; 1217 | } 1218 | 1219 | #powerTip div.ttname a { 1220 | font-weight: bold; 1221 | } 1222 | 1223 | #powerTip div.ttname { 1224 | font-weight: bold; 1225 | } 1226 | 1227 | #powerTip div.ttdeci { 1228 | color: #006318; 1229 | } 1230 | 1231 | #powerTip div { 1232 | margin: 0px; 1233 | padding: 0px; 1234 | font: 12px/16px Roboto,sans-serif; 1235 | } 1236 | 1237 | #powerTip:before, #powerTip:after { 1238 | content: ""; 1239 | position: absolute; 1240 | margin: 0px; 1241 | } 1242 | 1243 | #powerTip.n:after, #powerTip.n:before, 1244 | #powerTip.s:after, #powerTip.s:before, 1245 | #powerTip.w:after, #powerTip.w:before, 1246 | #powerTip.e:after, #powerTip.e:before, 1247 | #powerTip.ne:after, #powerTip.ne:before, 1248 | #powerTip.se:after, #powerTip.se:before, 1249 | #powerTip.nw:after, #powerTip.nw:before, 1250 | #powerTip.sw:after, #powerTip.sw:before { 1251 | border: solid transparent; 1252 | content: " "; 1253 | height: 0; 1254 | width: 0; 1255 | position: absolute; 1256 | } 1257 | 1258 | #powerTip.n:after, #powerTip.s:after, 1259 | #powerTip.w:after, #powerTip.e:after, 1260 | #powerTip.nw:after, #powerTip.ne:after, 1261 | #powerTip.sw:after, #powerTip.se:after { 1262 | border-color: rgba(255, 255, 255, 0); 1263 | } 1264 | 1265 | #powerTip.n:before, #powerTip.s:before, 1266 | #powerTip.w:before, #powerTip.e:before, 1267 | #powerTip.nw:before, #powerTip.ne:before, 1268 | #powerTip.sw:before, #powerTip.se:before { 1269 | border-color: rgba(128, 128, 128, 0); 1270 | } 1271 | 1272 | #powerTip.n:after, #powerTip.n:before, 1273 | #powerTip.ne:after, #powerTip.ne:before, 1274 | #powerTip.nw:after, #powerTip.nw:before { 1275 | top: 100%; 1276 | } 1277 | 1278 | #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { 1279 | border-top-color: #ffffff; 1280 | border-width: 10px; 1281 | margin: 0px -10px; 1282 | } 1283 | #powerTip.n:before { 1284 | border-top-color: #808080; 1285 | border-width: 11px; 1286 | margin: 0px -11px; 1287 | } 1288 | #powerTip.n:after, #powerTip.n:before { 1289 | left: 50%; 1290 | } 1291 | 1292 | #powerTip.nw:after, #powerTip.nw:before { 1293 | right: 14px; 1294 | } 1295 | 1296 | #powerTip.ne:after, #powerTip.ne:before { 1297 | left: 14px; 1298 | } 1299 | 1300 | #powerTip.s:after, #powerTip.s:before, 1301 | #powerTip.se:after, #powerTip.se:before, 1302 | #powerTip.sw:after, #powerTip.sw:before { 1303 | bottom: 100%; 1304 | } 1305 | 1306 | #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { 1307 | border-bottom-color: #ffffff; 1308 | border-width: 10px; 1309 | margin: 0px -10px; 1310 | } 1311 | 1312 | #powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { 1313 | border-bottom-color: #808080; 1314 | border-width: 11px; 1315 | margin: 0px -11px; 1316 | } 1317 | 1318 | #powerTip.s:after, #powerTip.s:before { 1319 | left: 50%; 1320 | } 1321 | 1322 | #powerTip.sw:after, #powerTip.sw:before { 1323 | right: 14px; 1324 | } 1325 | 1326 | #powerTip.se:after, #powerTip.se:before { 1327 | left: 14px; 1328 | } 1329 | 1330 | #powerTip.e:after, #powerTip.e:before { 1331 | left: 100%; 1332 | } 1333 | #powerTip.e:after { 1334 | border-left-color: #ffffff; 1335 | border-width: 10px; 1336 | top: 50%; 1337 | margin-top: -10px; 1338 | } 1339 | #powerTip.e:before { 1340 | border-left-color: #808080; 1341 | border-width: 11px; 1342 | top: 50%; 1343 | margin-top: -11px; 1344 | } 1345 | 1346 | #powerTip.w:after, #powerTip.w:before { 1347 | right: 100%; 1348 | } 1349 | #powerTip.w:after { 1350 | border-right-color: #ffffff; 1351 | border-width: 10px; 1352 | top: 50%; 1353 | margin-top: -10px; 1354 | } 1355 | #powerTip.w:before { 1356 | border-right-color: #808080; 1357 | border-width: 11px; 1358 | top: 50%; 1359 | margin-top: -11px; 1360 | } 1361 | 1362 | @media print 1363 | { 1364 | #top { display: none; } 1365 | #side-nav { display: none; } 1366 | #nav-path { display: none; } 1367 | body { overflow:visible; } 1368 | h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } 1369 | .summary { display: none; } 1370 | .memitem { page-break-inside: avoid; } 1371 | #doc-content 1372 | { 1373 | margin-left:0 !important; 1374 | height:auto !important; 1375 | width:auto !important; 1376 | overflow:inherit; 1377 | display:inline; 1378 | } 1379 | } 1380 | 1381 | --------------------------------------------------------------------------------