{"id":13648898,"url":"https://github.com/SpinalHDL/SpinalTemplateSbt","last_synced_at":"2025-04-22T11:33:23.683Z","repository":{"id":28917074,"uuid":"114657136","full_name":"SpinalHDL/SpinalTemplateSbt","owner":"SpinalHDL","description":"A basic SpinalHDL project","archived":false,"fork":false,"pushed_at":"2025-03-19T06:53:26.000Z","size":61,"stargazers_count":83,"open_issues_count":10,"forks_count":67,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-05T17:03:30.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpinalHDL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-18T15:30:18.000Z","updated_at":"2025-03-19T06:53:30.000Z","dependencies_parsed_at":"2024-06-13T11:56:38.947Z","dependency_job_id":"ad4e2779-b735-4fcf-99c3-dcf074fafb4f","html_url":"https://github.com/SpinalHDL/SpinalTemplateSbt","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FSpinalTemplateSbt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FSpinalTemplateSbt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FSpinalTemplateSbt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FSpinalTemplateSbt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpinalHDL","download_url":"https://codeload.github.com/SpinalHDL/SpinalTemplateSbt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250232582,"owners_count":21396664,"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":[],"created_at":"2024-08-02T01:04:37.937Z","updated_at":"2025-04-22T11:33:23.454Z","avatar_url":"https://github.com/SpinalHDL.png","language":"Scala","funding_links":[],"categories":["Scala"],"sub_categories":[],"readme":"# SpinalHDL Base Project\n\nThis repository is a base project to help Spinal users set-up project without knowledge about Scala and SBT.\n\n\n## If it is your are learning SpinalHDL\n\nYou can follow the tutorial on the [Getting Started](https://spinalhdl.github.io/SpinalDoc-RTD/master/SpinalHDL/Getting%20Started/index.html) page.\n\nMore specifically:\n\n* instructions to install tools can be found on the [Install and setup](https://spinalhdl.github.io/SpinalDoc-RTD/master/SpinalHDL/Getting%20Started/Install%20and%20setup.html#install-and-setup) page\n* instructions to get this repository locally are available in the [Create a SpinalHDL project](https://spinalhdl.github.io/SpinalDoc-RTD/master/SpinalHDL/Getting%20Started/Install%20and%20setup.html#create-a-spinalhdl-project) section.\n\n\n### TL;DR Things have already been set up in my environment, how do I run things to try SpinalHDL?\n\nOnce in the `SpinalTemplateSbt` directory, when tools are installed, the commands below can be run to use `sbt`.\n\n```sh\n// To generate the Verilog from the example\nsbt \"runMain projectname.MyTopLevelVerilog\"\n\n// To generate the VHDL from the example\nsbt \"runMain projectname.MyTopLevelVhdl\"\n\n// To run the testbench\nsbt \"runMain projectname.MyTopLevelSim\"\n```\n\n* The example hardware description is into `hw/spinal/projectname/MyTopLevel.scala`\n* The testbench is into `hw/spinal/projectname/MyTopLevelSim.scala`\n\nWhen you really start working with SpinalHDL, it is recommended (both for comfort and efficiency) to use an IDE, see the [Getting started](https://spinalhdl.github.io/SpinalDoc-RTD/master/SpinalHDL/Getting%20Started/index.html).\n\n\n## If you want to create a new project from this template\n\n### Change project name\n\nYou might want to change the project name, which is currently `projectname`. To do so (let's say your actual project name is `myproject`; it must be all lowercase with no separators):\n\n* Update `build.sbt` and/or `build.sc` by replacing `projectname` by the name of your project `myproject` (1 occurrence in each file). The better is to replace in both (it will always work), but in some contexts you can keep only one of these two files:\n    * If you are sure all people only use `sbt`, you can replace only in `build.sbt` and remove `build.sc`\n    * If you are sure all people only use `mill`, you can replace only in `build.sc` and remove `build.sbt`\n    * Replace in both files for open-source project.\n* Put all your scala files into `hw/spinal/myproject/` (remove the unused `hw/spinal/projectname/` folder)\n* Start all your scala files with `package myproject`\n\n\n### Change project structure\n\nYou can change the project structure as you want. The only restrictions (from Scala environment) are (let's say your actual project name is `myproject`):\n\n* you must have a `myproject` folder and files in it must start with `package myproject`\n* if you have a file in a subfolder `myproject/somepackage/MyElement.scala` it must start with `package myproject.somepackage`.\n* `sbt` and `mill` must be run right in the folder containing their configurations (recommended to not move these files)\n\nOnce the project structure is modified, update configurations:\n\n* In `build.sbt` and/or `build.sc` (see above) replace `/ \"hw\" / \"spinal\"` by the new path to the folder containing the `myproject` folder.\n* In the spinal configuration file (if you kept it, by default it is in `projectname/Config.scala`) change the path in `targetDirectory = \"hw/gen\"` to the directory where you want generated files to be written. If you don't use a config or if it doesn't contain this element, generated files will be written in the root directory.\n\n\n### Update this README\n\nOf course you can replace/modify this file to help people with your own project!\n\n\n## Mill Support (Experimental)\n\nThe [Mill build tool](https://com-lihaoyi.github.io/mill) can be installed and used instead of `sbt`.\n\n```sh\n// To generate the Verilog from the example\nmill projectname.runMain projectname.MyTopLevelVerilog\n\n// To generate the VHDL from the example\nmill projectname.runMain projectname.MyTopLevelVhdl\n\n// To run the testbench\nmill projectname.runMain projectname.MyTopLevelSim\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSpinalHDL%2FSpinalTemplateSbt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSpinalHDL%2FSpinalTemplateSbt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSpinalHDL%2FSpinalTemplateSbt/lists"}