{"id":20309131,"url":"https://github.com/chaseruskin/legohdl","last_synced_at":"2025-04-11T15:40:29.113Z","repository":{"id":46763828,"uuid":"379796641","full_name":"chaseruskin/legoHDL","owner":"chaseruskin","description":"An experimental package manager and development tool for Hardware Description Languages (HDL).","archived":false,"fork":false,"pushed_at":"2022-04-10T01:14:36.000Z","size":4092,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T02:47:02.423Z","etag":null,"topics":["digital-design","digital-logic","fpga","hardware-description-language","hardware-design","hdl","package-manager","verilog","vhdl"],"latest_commit_sha":null,"homepage":"https://chaseruskin.github.io/legoHDL","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaseruskin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-24T03:51:45.000Z","updated_at":"2025-02-22T21:28:20.000Z","dependencies_parsed_at":"2022-09-10T17:02:23.203Z","dependency_job_id":null,"html_url":"https://github.com/chaseruskin/legoHDL","commit_stats":null,"previous_names":["cdotrus/legohdl","ujichase/legohdl","chaseruskin/legohdl","c-rus/legohdl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaseruskin%2FlegoHDL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaseruskin%2FlegoHDL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaseruskin%2FlegoHDL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaseruskin%2FlegoHDL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaseruskin","download_url":"https://codeload.github.com/chaseruskin/legoHDL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248432868,"owners_count":21102458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["digital-design","digital-logic","fpga","hardware-description-language","hardware-design","hdl","package-manager","verilog","vhdl"],"created_at":"2024-11-14T17:25:38.506Z","updated_at":"2025-04-11T15:40:29.092Z","avatar_url":"https://github.com/chaseruskin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![](./docs/src/images/title_3x.png)\n\n# legoHDL\n![ci-build](https://github.com/c-rus/legohdl/actions/workflows/build.yml/badge.svg)\n![ci-test](https://github.com/c-rus/legohdl/actions/workflows/test.yml/badge.svg)\n![CodeQL](https://github.com/c-rus/legohdl/actions/workflows/codeql-analysis.yml/badge.svg)\n### The package manager and development tool for Hardware Description Languages (HDL).\n  \n\u003cbr /\u003e  \n\nlegoHDL is a complete, robust, and flexible HDL package manager and development tool used through the command-line interface. It provides full package management capabilities and incorporates special functionality specific to HDL designs to rapidly improve development workflow.\n\n\u003e__NOTE:__ This project is considered a prototype and has neared its final major pushes. Feedback is welcome from trying out the tool. I have learned a lot and this project has grown greatly from the lessons learned. More enhancements and revisions will be applied when creating the real product. Real development is planned to be written in Rust under the test-driven-development methodology.\n\n__VHDL__ and __Verilog__ are supported as well as mixed-language.\n\nCross-platform compatibility with __macos__, __ubuntu__, and __windows__.\n\nRequires only python 3.5+, git, and your favorite text-editor.\n\n\n## __Better IP management. For all.__\n\n### __Every design at your fingertips.__\nProjects are called __blocks__ within legoHDL, and are managed under 3 levels: downloaded (D), installed (I), or available (A). See which levels blocks are at in your active workspace. Blocks contain your HDL source files and their designs, which can be referenced by any new project.\n```\nLibrary          Block                Status   Version    Vendor\n---------------- -------------------- -------- ---------- ----------------\neel4712c         lab1                   I      3.0.1\neel4712c         lab2                   I      3.0.2\neel4712c         lab3                 D I      1.1.1\neel4712c         lab4                 D I      2.0.1\neel4712c         lab5                 D I      1.0.4\neel4712c         lab6                 D\ngraphics         LED_Animation        D\ngraphics         VGA                  D\ncpu              mips                 D   A    0.0.1      uf-ece\neel4744c         lab4                 D\naudio            synthesizer          D I      2.0.2      Kazhuu\nio               motor_driver         D\nio               rotary_encoder         I      1.0.2      open-ip\nprojects         digilock             D I      0.0.1\nutil             toolbox              D I      1.0.3\nsample           mux_2x1                I A    3.0.1      uf-ece\n```\n\n### __Instantly reuse existing IP into larger projects. No really, instantly.__\nWith a single command, return relevant information collected from the IP file's initial comment block and ready-to-use compatible code for VHDL or Verilog instantiation. By instantiating a design into a project, legoHDL automatically knows to use that IP's file for building a project, even if it's located outside the current project.\n```\n--- ABOUT ---\n------------------------------------------------------------------------------\n Project: eel4712c.lab5\n Author: Chase Ruskin\n Course: Digital Design - UF EEL4712C\n Created: October 16, 2021\n Entity: bcd_encoder\n Description:\n  Converts a binary number into a binary-coded decimal number using the\n  \"double dabble\" algorithm. If at any point during the computation the input\n  number changes, the algorithm resets.\n------------------------------------------------------------------------------\n\n--- CODE ---\nconstant WIDTH  : positive := 4;\nconstant DIGITS : positive := 2;\n\nsignal clk   : std_logic;\nsignal rst_n : std_logic;\nsignal go    : std_logic;\nsignal bin   : std_logic_vector(WIDTH-1 downto 0);\nsignal bcd   : std_logic_vector((4*DIGITS) -1 downto 0);\nsignal done  : std_logic;\nsignal ovfl  : std_logic;\n\nuX : entity eel4712c.bcd_encoder generic map(\n    WIDTH  =\u003e WIDTH,\n    DIGITS =\u003e DIGITS)\nport map(\n    clk   =\u003e clk,\n    rst_n =\u003e rst_n,\n    go    =\u003e go,\n    bin   =\u003e bin,\n    bcd   =\u003e bcd,\n    done  =\u003e done,\n    ovfl  =\u003e ovfl);\n```\n\n### __Quickly see how a project takes shape.__\nlegoHDL approaches IP management by allowing the developer to solely focus on designing new hardware, not wasting time fighting with tools and rewriting code. Developers take advantage of structural modeling styles to reuse IP, and legoHDL analyzes HDL source files to determine what external designs are required based on instantiations within the source code.\n```\nINFO:   Identified top-level unit: synthesizer\nINFO:   Identified top-level testbench: tb_synthesizer\nINFO:   Generating dependency tree...\n--- DEPENDENCY TREE ---\n\\- audio.tb_synthesizer \n   +- audio.synthesizer \n   |  +- audio.wave_gen \n   |  +- audio.multi_port_adder \n   |  |  \\- audio.adder \n   |  +- audio.audio_ctrl \n   |  \\- audio.piano \n   \\- audio.audio_codec_model \n\n\n--- BLOCK ORDER ---\n[1]^-   audio.synthesizer(v2.0.2)\n```\n\n### __Export a blueprint to build your project, your way.__\nWhen a developer is ready to build their project, whether it's for linting, simulation, synthesis, or generating a bitstream, legoHDL exports a simple text file called a __blueprint__ that lists the necessary HDL files in a topologically sorted order to be read and plugged into _any_ backend tool for a completely custom workflow.\n```\n@BOARD-DESIGN /Users/chase/develop/eel4712c/synth/quartus/system_top_level.bdf\n@VHDL-SRC /Users/chase/develop/eel4712c/synth/vhd/wave_gen.vhd\n@VHDL-SRC /Users/chase/develop/eel4712c/synth/vhd/adder.vhd\n@VHDL-SRC /Users/chase/develop/eel4712c/synth/vhd/audio_ctrl.vhd\n@VHDL-SRC /Users/chase/develop/eel4712c/synth/vhd/piano.vhd\n@VHDL-SRC /Users/chase/develop/eel4712c/synth/vhd/audio_codec_model.vhd\n@VHDL-SRC /Users/chase/develop/eel4712c/synth/vhd/multi_port_adder.vhd\n@VHDL-SRC /Users/chase/develop/eel4712c/synth/vhd/synthesizer.vhd\n@VHDL-SIM /Users/chase/develop/eel4712c/synth/tb/tb_synthesizer.vhd\n@VHDL-SIM-TOP tb_synthesizer /Users/chase/develop/eel4712c/synth/tb/tb_synthesizer.vhd\n@VHDL-SRC-TOP synthesizer /Users/chase/develop/eel4712c/synth/vhd/synthesizer.vhd\n```\n\n### __Write any workflow, for any tool.__\nDevelopers set up custom workflows by writing and using __plugins__ for their backend tool to be reused with all projects. No more copying makefiles or tcl scripts into every project.\n``` python\n# --A simple plugin script to run a VHDL simulation using GHDL--\nimport os\n#blueprint file is located in 'build/' directory\nos.chdir('build') \n\ntb_entity = None\n#list of tuples storing the (library,filepath) to be analyzed in order\nsrc_list = [] \n#[!] read blueprint file to collect the necessary data to build the design\nwith open('blueprint', 'r') as blueprint:\n    for rule in blueprint.readlines():\n        #break up line into list of words\n        rule = rule.split()\n        #label is always first item, filepath is always last item\n        label,filepath = rule[0],rule[-1]\n        #collect data on non-work VHDL files and their libraries\n        if('@VHDL-LIB' == label): \n            lib = rule[1] #second item is library name\n            src_list += [(lib, filepath)]\n        #collect data on VHDL work files\n        elif('@VHDL-SRC' == label or '@VHDL-SIM' == label): \n            src_list += [('work', filepath)]\n        #collect data on VHDL testbench entity\n        elif('@VHDL-SIM-TOP' == label): \n            tb_entity = rule[1] #second item is entity name\n\n#[!] analyze all collected VHDL files\nfor src in src_list:\n    os.system('ghdl -a --std=08 --ieee=synopsys --work='+src[0]+' '+src[1])\n\n#[!] run simulation if a testbench entity is provided\nif(tb_entity != None):\n    os.system('ghdl -r --std=08 --ieee=synopsys '+tb_entity)\n```\n\n### __Roll solo or in teams.__\nlegoHDL is designed to benefit the individual developer as well as those working together. Set up a __vendor__ to centralize IPs for you or your team to use and collaborate. Easily share plugins, settings, and templates across your team by setting up __profiles__.\n\n### __Completely customizable.__\nlegoHDL has configurable aspects, such as custom labels, multiple workspaces, and vendor repositories, that can be easily changed through its integrated GUI.\n\n![legohdl settings label](./docs/src/images/settings_gui_label.png)\n\n\u003cbr /\u003e \n\n## __Documentation__\nTo learn more about the powers of legoHDL, read the [documentation](https://c-rus.github.io/legoHDL/).\n\n## __Roadmap__\nCheck out the [roadmap](https://github.com/c-rus/legoHDL/projects/1) to see what features and enhancements are currently being worked on. This project is under active development, so features may change or be added.\n\n## __Trying it out__\n\n1. Make sure python as version 3.5+ and git are installed.\n\n`python --version`\n\n`git --version`\n\n2. clone this repository\n\n`git clone https://github.com/c-rus/legoHDL.git`\n\n3. Install the program via pip\n\n`pip install ./legoHDL`\n\n4. Verify it is properly installed.\n\n`legohdl --version`\n\n5. See the documentation website for further details on [getting started](https://c-rus.github.io/legoHDL/1_0_starting.html).\n\n\u003e __Note__: Once the roadmap is complete for __v1.0.0__, users will be able to install legoHDL directly through pip from PYPI.\n\n## __Quick Start__\n1. Upon first time calling legohdl, run `legohdl` from the command line.\n\n2. When prompted to import a profile, return `y`.\n\n3. Next, return an empty response to get going with the default profile.\n\n4. Enter other prompted information such as your name, text-editor, and workspace path.\n\n5. legoHDL is now ready. Create your first block and open it in the configured text-editor with\n`legohdl new tutorials.gates -open`.\n\nCheckout the [tutorials](https://c-rus.github.io/legoHDL/tutorials/tutorials.html) for next steps.\n\n## __Commands__\nRefer to the [manual](https://github.com/c-rus/legoHDL/blob/master/src/legohdl/data/manual.txt) for complete overview and explanations on every command and their relevant flags.\n\n```\nUsage:             \n        legohdl \u003ccommand\u003e [\u003centry\u003e] [\u003cflags\u003e] [-h]          \n\nCommands:\nDevelopment\n   new          create a new legohdl block (project)\n   init         initialize existing code into a legohdl block\n   open         open a block with the configured text-editor\n   get          print instantiation code for an HDL entity\n   graph        visualize HDL dependency graph\n   export       generate a blueprint file\n   build        execute a custom configured plugin\n   release      set a newer version for the current block\n   del          delete a block from the local workspace path\n\nManagement\n   list         print list of all blocks available\n   refresh      sync local vendors with their remotes\n   install      bring a block to the cache for dependency use\n   uninstall    remove a block from the cache\n   download     bring a block to the workspace path for development\n   update       update an installed block to be its latest version\n   show         read further detail about a block\n   config       modify legohdl settings\n\nType 'legohdl help \u003ccommand\u003e' to read about that command.\n\n```\n\n\u003c/br\u003e\n\n## __Disclaimer__\nInspired by the modular building approach of LEGO® bricks, legoHDL brings modularity and management to hardware description languages by enabling designs to be built like LEGO® bricks. LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this project.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaseruskin%2Flegohdl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaseruskin%2Flegohdl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaseruskin%2Flegohdl/lists"}