{"id":17275438,"url":"https://github.com/UW-PHARM/BitSAD","last_synced_at":"2025-02-25T02:31:48.659Z","repository":{"id":57723801,"uuid":"192224271","full_name":"UW-PHARM/BitSAD","owner":"UW-PHARM","description":"A domain-specific language for bitstream computing","archived":false,"fork":false,"pushed_at":"2021-12-05T21:08:01.000Z","size":122,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-03-19T17:07:29.737Z","etag":null,"topics":["bitstream","code-generation","compiler-plugin","scala","stochastic-computing","verilog"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UW-PHARM.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":"2019-06-16T18:33:55.000Z","updated_at":"2023-07-04T17:35:14.000Z","dependencies_parsed_at":"2022-08-25T11:51:36.382Z","dependency_job_id":null,"html_url":"https://github.com/UW-PHARM/BitSAD","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UW-PHARM%2FBitSAD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UW-PHARM%2FBitSAD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UW-PHARM%2FBitSAD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UW-PHARM%2FBitSAD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UW-PHARM","download_url":"https://codeload.github.com/UW-PHARM/BitSAD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219844657,"owners_count":16556483,"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":["bitstream","code-generation","compiler-plugin","scala","stochastic-computing","verilog"],"created_at":"2024-10-15T08:56:14.752Z","updated_at":"2024-10-15T08:56:16.913Z","avatar_url":"https://github.com/UW-PHARM.png","language":"Scala","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# BitSAD\n[![Build Status](https://travis-ci.com/UW-PHARM/BitSAD.svg?branch=master)](https://travis-ci.com/UW-PHARM/BitSAD)\n\n_**⚠️⚠️⚠️ WARNING: ⚠️⚠️⚠️**_\n\n_**This package has been re-written in Julia. Please see https://github.com/UW-PHARM/BitSAD.jl.\nThe Scala version is no longer maintained (or as feature-rich as the Julia package).**_\n\n----\n\nA domain-specific language for bitstream computing.\n\n### Citation\n\nIf you use BitSAD in your work, please cite this paper:\n```\n@INPROCEEDINGS {BitSAD2019,\n\tauthor = {Kyle Daruwalla and Heng Zhuo and Mikko Lipasti},\n\ttitle = {{BitSAD}: A Domain-Specific Language for Bitstream Computing},\n\tbooktitle = {Unary Computing Workshop},\n\tyear = {2019},\n\tmonth = {June}\n}\n```\n\n## Summary\n\nBitSAD is a domain-specific language for bitstream computing delivered in two parts: a library API and a compiler plugin. The library API provides the `SBitstream` and `DBitstream` classes, `Matrix[A]` class, and corresponding useful functions and classes. The compiler plugin is developed alongside the library API to deliver automated hardware (Verilog) generation for BitSAD programs.\n\n## Installation\n\nThe library can be installed by adding the following line to your `build.sbt`:\n```scala\nlibraryDependencies += \"com.github.uw-pharm\" % \"bitsad-libraries_2.12\" % \"0.5.2\",\n```\n\nTo install the plugin, first add the library. Then, add the following to your `build.sbt`:\n```scala\nlibraryDependencies += \"com.github.uw-pharm\" % \"bitsad-plugin_2.12\" % \"v0.5.2\",\nlibraryDependencies += compilerPlugin(\"com.github.uw-pharm\" % \"bitsad-plugin_2.12\" % \"v0.5.2\"),\nscalacOptions += s\"-Xplugin:bitsad-plugin_2.12.jar:bitsad-libraries_2.12.jar\",\nscalacOptions += s\"-P:bitsad-plugin:top:\u003cyour top level file\u003e.scala\"\n```\n\nIf you want working examples of installation, please refer to `BitBench/build.sbt`.\n\n### Verilog Submodules\n\nThe generated Verilog requires submodules that implement each operator. These modules are packaged separately in `verilog-lib.tar.gz`. Download the compressed file, then uncompress it into the directory containing your Verilog project source code.\n\n## A Sample BitSAD Program\n\nBelow is a sample BitSAD module. The names of traits, objects, classes, and functions must be as specified (e.g. `Parameters`, `Module`, `loop`, etc.). Please refer to `BitBench` for working example programs.\n\n```scala\npackage \u003cyour module name\u003e\n\n// Import libraries as you need them\nimport bitstream.types._\nimport bitstream.simulator.units._\nimport math._\n\ntrait Parameters {\n  // Declare values that parameterize your module\n  // (e.g. constants, matrix sizes, etc.)\n}\n\nobject DefaultParams extends Parameters {\n  // Set values for each of the parameters listed above\n}\n\n// The class that defines your module\n// Must accept Parameters argument as input to constructor\ncase class Module (params: Parameters) {\n\n  // Define outputs\n  // A List() of 3-tuples\n  // Each tuple is (\u003cstring with name of var\u003e, \u003cnum of rows\u003e, \u003cnum of cols\u003e)\n  val outputList = List((\"v\", 2, 2), (\"u\", 2, 2), (\"sigma\", 1, 1))\n\n  // Required function that describes the compute done in\n  //   one clock cycle of your module\n  // Arguments/return can be anything\n  // A variable that is an output but also an input must be assigned as\n  //   _\u003cvar name\u003e\n  def loop(A: Matrix[SBitstream], v: Matrix[SBitstream]):\n      (Matrix[SBitstream], Matrix[SBitstream], SBitstream) = {\n    // Update right singular vector\n    var w = A * v\n\n    // ...\n\n    (u, _v, sigma)\n  }\n\n}\n\n// BELOW IS NOT REQUIRED\n\nobject IterativeSVD {\n\n  def main(args: Array[String]) {\n\n    // Useful to instantiate your module and test it\n    // This will not affect hardware generation in any way\n\n  }\n}\n```\n\n### Note about BitBench\n\nThe BitBench folder is a Git submodule. When you clone this repo, add the `--recursive` flag to your Git command to also clone the BitBench repo.\n\n## Experimental Features\nCurrently the `simulatable` and `pop` macros that enable bit-level simulation and population coding automatically are only available on the `master` branch. There are issues related to the Scala compiler that are preventing these features from being pulled into a release. We expect to fix this in the coming weeks.\n\n## Contributing\n\nWe welcome all kinds of contributions including PRs, sample code, and issues.\n\n### Issues\n\nIf you have a feature request or an issue with BitSAD, please file an issue on GitHub. Please file issues relating to BitBench with the BitBench repository.\n\n### Pull Requests\n\nIf you would like to add to BitSAD, we welcome PRs. Submit a PR to the `staging` branch. This allows us to move around files/reorganize the repo before bringing your code into the `master` branch. *All commits to the master branch create versions on Sonatype*.\n\nIf you want to add a new operator, etc. to the project, then please email us or file an issue, and we can direct you on how to proceed. Later versions of BitSAD will likely modularize this process to make it very simple and straightforward.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUW-PHARM%2FBitSAD","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FUW-PHARM%2FBitSAD","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUW-PHARM%2FBitSAD/lists"}