{ "info": { "author": "Keyi Zhang", "author_email": "keyi@cs.stanford.edu", "bugtrack_url": null, "classifiers": [], "description": "# Kratos Debugger Runtime\nThis is the runtime library required to debug Kratos hardware designs. You\nneed a C++17 compatible compiler, such as `g++-8` to compile the library.\n\n## How to use Kratos-Runtime\nThe following instruction is based on Linux and tested against Verilator and\nncsim.\n\n```Bash\n$ git clone https://github.com/Kuree/kratos-runtime\n$ cd kratos-runtime\n$ git submodule update --init --recursive\n$ mkdir build\n$ cd ./build\n$ cmake ..\n$ make -j\n```\n\nAfter that, you can find the library as `build/src/libkratos-runtime.so`. You\ncan either copy that library to any place you like or simply use symbolic\nlink.\n\n### Generate Kratos-Runtime debug database for your design\nWhen calling `verilog()` function, you can supply another argument called \n`debug_db_filename` to specify the location where kratos can output the\ndebug files,\n```Python\nverilog(design, debug_db_filename=\"debug.db\")\n```\n\n### Using Kratos-runtime with Verilator\nOnce you have compiled the shared library, you can ask\n`verialtor` to link your test bench with `kratos-runtime`. Before you do that,\nsince we need to read the internal signals, we need to inject `verilator`\nspecific info via a pass:\n```Python\n_kratos.passes.insert_verilator_public(design.internal_generator)\n```\n`_kratos` is the namespace for native C++ binding, you can use it via\n`import _kratos`.\n\nWhen invoking the `verilator` command, you need to specify the kratos runtime\nname as well as `--vpi` switch, for instance:\n```Bash\nverilator --cc design.sv test_tb.sv libkratos-runtime.so --vpi --exe\n```\n\nYou can symbolic link `libkratos-runtime.so` inside `obj_dir` so that the linker\nand find it easily.\n\nOnce the test bench is compiled, you need to use `LD_LIBRARY_PATH` to let the\nsystem to load, such as\n```\n$ LD_LIBRARY_PATH=./obj_dir/ ./obj_dir/Vtest\n```\nOr you can let the linker to fix the shared library path in the `verilator`,\nwhich is beyond the scope of this tutorial.\n\n### Using kratos-runtime with Ncsim\nNcsim is much easier to use than `verilator`. Once you have the design, simply\ntell the simulator that you want to load the vpi and dpi library, such as\n\n```\nirun test_tb.sv test.sv -sv_lib libkratos-runtime.so -loadvpi libkratos-runtime.so:initialize_runtime_vpi -access +r\n```\n\n`-access +r` is necessary to allow the runtime to read out simulation variables.\n\n### What to do after launch the simulation\nYou can now use any debugger that's compatible with the Kratos debug protocol.\nKratos has provide an open-source version of debugger extension inside VS Code.\nYou can install it\n[here](https://marketplace.visualstudio.com/items?itemName=keyiz.kratos-vscode)\nand use it to debug your design.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Kuree/kratos-runtime", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "kratos-runtime", "package_url": "https://pypi.org/project/kratos-runtime/", "platform": "", "project_url": "https://pypi.org/project/kratos-runtime/", "project_urls": { "Homepage": "https://github.com/Kuree/kratos-runtime" }, "release_url": "https://pypi.org/project/kratos-runtime/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Kratos runtime for debugging", "version": "0.0.1" }, "last_serial": 6004793, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ebdb067d07d905a50a740853810f9a7b", "sha256": "c116e4c70025ca50e3e356c215f72d7a35c55ae5929bb66690b33da1c6f40663" }, "downloads": -1, "filename": "kratos_runtime-0.0.1-cp35-cp35m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "ebdb067d07d905a50a740853810f9a7b", "packagetype": "bdist_wheel", "python_version": "cp35", "requires_python": null, "size": 3643688, "upload_time": "2019-10-20T22:03:45", "url": "https://files.pythonhosted.org/packages/d2/ef/c31dbd1bb3aa1e554b6aefb93466ce67c1aee0668c168a55415fa003e9a9/kratos_runtime-0.0.1-cp35-cp35m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "ae4016cfca8f3a90d017d518a9f6a255", "sha256": "45bab65c14cd5bc7dd4692627acd7436dbc2d39148893e1970b4faed7ff85de5" }, "downloads": -1, "filename": "kratos_runtime-0.0.1-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "ae4016cfca8f3a90d017d518a9f6a255", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 3643684, "upload_time": "2019-10-20T22:03:49", "url": "https://files.pythonhosted.org/packages/aa/32/dacb9cb464a790a5ff4fe492685fc4080936edf33710758a0ebe3782d584/kratos_runtime-0.0.1-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "ea3c8920b06e9d647fab1b64df16d63a", "sha256": "08b91b3cfcf8abdb4790e678e67a5dea66b1b68f5916b55e74c8fd777ed0deae" }, "downloads": -1, "filename": "kratos_runtime-0.0.1-cp37-cp37m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "ea3c8920b06e9d647fab1b64df16d63a", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 3643704, "upload_time": "2019-10-20T22:03:52", "url": "https://files.pythonhosted.org/packages/64/93/4db5792d79e517f4ec6bca276f70e9356837cda1a11dba89cfc11ef1fba8/kratos_runtime-0.0.1-cp37-cp37m-manylinux1_x86_64.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ebdb067d07d905a50a740853810f9a7b", "sha256": "c116e4c70025ca50e3e356c215f72d7a35c55ae5929bb66690b33da1c6f40663" }, "downloads": -1, "filename": "kratos_runtime-0.0.1-cp35-cp35m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "ebdb067d07d905a50a740853810f9a7b", "packagetype": "bdist_wheel", "python_version": "cp35", "requires_python": null, "size": 3643688, "upload_time": "2019-10-20T22:03:45", "url": "https://files.pythonhosted.org/packages/d2/ef/c31dbd1bb3aa1e554b6aefb93466ce67c1aee0668c168a55415fa003e9a9/kratos_runtime-0.0.1-cp35-cp35m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "ae4016cfca8f3a90d017d518a9f6a255", "sha256": "45bab65c14cd5bc7dd4692627acd7436dbc2d39148893e1970b4faed7ff85de5" }, "downloads": -1, "filename": "kratos_runtime-0.0.1-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "ae4016cfca8f3a90d017d518a9f6a255", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 3643684, "upload_time": "2019-10-20T22:03:49", "url": "https://files.pythonhosted.org/packages/aa/32/dacb9cb464a790a5ff4fe492685fc4080936edf33710758a0ebe3782d584/kratos_runtime-0.0.1-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "ea3c8920b06e9d647fab1b64df16d63a", "sha256": "08b91b3cfcf8abdb4790e678e67a5dea66b1b68f5916b55e74c8fd777ed0deae" }, "downloads": -1, "filename": "kratos_runtime-0.0.1-cp37-cp37m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "ea3c8920b06e9d647fab1b64df16d63a", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 3643704, "upload_time": "2019-10-20T22:03:52", "url": "https://files.pythonhosted.org/packages/64/93/4db5792d79e517f4ec6bca276f70e9356837cda1a11dba89cfc11ef1fba8/kratos_runtime-0.0.1-cp37-cp37m-manylinux1_x86_64.whl" } ] }