{"id":48178030,"url":"https://github.com/logigator/logigator-simulation","last_synced_at":"2026-04-04T17:40:15.025Z","repository":{"id":45648060,"uuid":"213618631","full_name":"logigator/logigator-simulation","owner":"logigator","description":"Multi-Threaded Simulator for Logic Circuits as Node.JS Native C++ or WebAssembly Module.","archived":false,"fork":false,"pushed_at":"2023-02-04T03:16:37.000Z","size":213,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-14T14:56:13.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://logigator.com","language":"C++","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/logigator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-08T10:57:09.000Z","updated_at":"2021-12-02T19:50:35.000Z","dependencies_parsed_at":"2022-09-15T13:10:29.095Z","dependency_job_id":null,"html_url":"https://github.com/logigator/logigator-simulation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/logigator/logigator-simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logigator%2Flogigator-simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logigator%2Flogigator-simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logigator%2Flogigator-simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logigator%2Flogigator-simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logigator","download_url":"https://codeload.github.com/logigator/logigator-simulation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logigator%2Flogigator-simulation/sbom","scorecard":{"id":597324,"data":{"date":"2025-08-11","repo":{"name":"github.com/logigator/logigator-simulation","commit":"cfc5bb444ddaf9c190b378ab54f4e046aed2cb0f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/tests.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":7,"reason":"Found 3/4 approved changesets -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yaml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/logigator/logigator-simulation/tests.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/logigator/logigator-simulation/tests.yaml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/tests.yaml:25","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T23:27:55.931Z","repository_id":45648060,"created_at":"2025-08-20T23:27:55.931Z","updated_at":"2025-08-20T23:27:55.931Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31407648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-04-04T17:40:14.955Z","updated_at":"2026-04-04T17:40:15.015Z","avatar_url":"https://github.com/logigator.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logigator - Simulation Code Base\n[![Build Status](https://travis-ci.org/logigator/logigator-simulation.svg?branch=master)](https://travis-ci.org/logigator/logigator-simulation)\n[![Build Status](https://travis-ci.org/logigator/logigator-simulation.svg?branch=development)](https://travis-ci.org/logigator/logigator-simulation)\n\nMulti-Threaded Simulator for Logic Circuits as Node.JS Native C++ Module, alternatively compilable to WebAssembly.\n## Getting Started\n### Prerequisites\nYou need to have node and npm installed to use this module. We recommend installing it via [nvm](https://github.com/nvm-sh/nvm):\n#### Debian\n```shell\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash\nexport NVM_DIR=\"$([ -z \"${XDG_CONFIG_HOME-}\" ] \u0026\u0026 printf %s \"${HOME}/.nvm\" || printf %s \"${XDG_CONFIG_HOME}/nvm\")\"\n[ -s \"$NVM_DIR/nvm.sh\" ] \u0026\u0026 \\. \"$NVM_DIR/nvm.sh\" # This loads nvm\nnvm install lts/*\n```\nFurthermore, python2 is required for compiling:\n```shell\napt install python2\n```\n### Installation\nDownload the contents of the repository, open the command line in that directory and install it using ```npm install```.\n#### Linux / Unix\n```shell\ngit clone 'http://github.com/logigator/logigator-simulation.git' \u0026\u0026 cd ./logigator-simulation \u0026\u0026 npm install\n```\nalternatively, you can install it using npm:\n```shell\nnpm install @logigator/logigator-simulation\n```\n\nTo compile to WASM, use this command:\n```shell\nnpm run wasm-install\n```\nthis will download emscripten and compile into ```webAssembly/dist/```\n## Usage (Node.JS)\nImport the module in your Node.JS Script:\n```javascript\nconst logicsim = require('./index').logicsim;\n```\nAlternatively, if you installed the package using npm, import it with:\n```javascript\nconst logicsim = require('@logigator/logigator-simulation').logicsim;\n```\nYou can also import it using typescript:\n```javascript\nimport {BoardObject, logicsim} from \"@logigator/logigator-simulation\";\n```\n### Functions\n| Function | Description |\n| --- | --- |\n| `logicsim.init(board);` | Creates a new Board. A sample board object can be found below. |\n| `logicsim.start(threads, ticks, ms);` | Runs the simulation until either the ticks were simulated or the simulation time was reached. |\n| `logicsim.stop();` | Stops the simulation if running. |\n| `logicsim.getStatus();` | Gets the current Status of a Board, like simulated ticks, current execution state or current simulation speed |\n| `logicsim.getLinks();` | Gets states of all links |\n| `logicsim.getBoard();` | Gets all components and links and their current state |\n| `logicsim.triggerInput(/*index of component*/, /*0 = set, 1 = pulse*/, /*array of states for input*/);` | Triggers an input element on a board |\n| `logicsim.destroy();` | Destroys current board. This is required before initializing a new board. |\n### Sample Board Object:\n```json\n{\n  \"links\": 4,\n  \"components\": [\n  \t{\n  \t\t\"type\": 200,\n  \t\t\"inputs\": [\n  \t\t],\n  \t\t\"outputs\": [\n  \t\t\t0\n  \t\t]\n  \t},\n  \t{\n  \t\t\"type\": 4,\n  \t\t\"inputs\": [\n  \t\t\t0, 1\n  \t\t],\n  \t\t\"outputs\": [\n  \t\t\t2\n  \t\t]\n  \t},\n  \t{\n  \t\t\"type\": 2,\n  \t\t\"inputs\": [\n  \t\t\t0, 2\n  \t\t],\n  \t\t\"outputs\": [\n  \t\t\t3\n  \t\t]\n  \t}\n  ]\n}\n```\n## Usage (WebAssembly)\nCopy the .wasm and .js file to an appropriate location on your web server. Then, import the JS file and initialize WebAssembly:\n```HTML\n\u003cscript src=\"/path/to/this/file/logigator-simulation.js\"\u003e\u003c/script\u003e\n```\n```javascript\nModule.onRuntimeInitialized = () =\u003e {\n\tconsole.log('Yay, it worked!');\n};\n```\nTo initialize a board, you can do as follows:\n```javascript\nModule.initLinks(2); // Number of links on that board.\nModule.initComponents(4); // Number of components on that board.\nfor (let i = 0; i \u003c 4; i++) {\n  // Allocate arrays for inputs and outputs in heap - further described below\n  // ...\n  \n  Module.initComponent\n  (\n    i, // index of component to initialize\n    1, // type id, determines which component to initialize - a list of all type ids can be found further below\n    0x00000001, // pointer to array in heap holding indexes of the links going into the component - how to get an array into the heap is further documented down below\n    0x00000010, // pointer to array in heap holding indexes of the links going out of the component\n    1, // length of array located in 0x00000001\n    1, // length of array located in 0x00000010\n    0, // op1 - used for certain component types, ignored otherwise\n    0 // op2 - used for certain component types, ignored otherwise\n  );\n  \n  // release memory from allocated arrays to avoid memory leaks\n  Module._free(0x00000001);\n  Module._free(0x00000010);\n}\n\nModule.initBoard(); // finally, finish initialisation\n```\n\nTo copy an array to heap, you can do:\n```javascript\nfunction _arrayToHeap(typedArray) {\n\tconst numBytes = typedArray.length * typedArray.BYTES_PER_ELEMENT;\n\tconst ptr = Module._malloc(numBytes);\n\tconst heapBytes = new Uint8Array(Module.HEAPU8.buffer, ptr, numBytes);\n\theapBytes.set(new Uint8Array(typedArray.buffer));\n\treturn ptr;\n}\n```\nto retrieve data from heap (e.g. current state of links from board):\n```javascript\nModule.HEAP8.slice(0x00000001 /*address of first byte*/, 0x00000010 /*address of last byte*/);\n```\n### Functions\n| Function | Description |\n| --- | --- |\n| `Module.start(ticks, ms);` | Runs the simulation until either the ticks were simulated or the simulation time was reached. |\n| `Module.stop();` | Stops the simulation if running. (Probably useless in webAssembly as active simulation locks current thread anyway.) |\n| `Module.getStatus();` | Returns object with data for current state of the simulation |\n| `Module.getLinks();` | Returns pointer with the states of all links (1 byte per element, Array length equals number of links on board) |\n| `Module.getComponents();` | Return pointer with the states of all inputs and outputs of all components. Format: (component\\[0\\] inputs)(component\\[0\\] outputs)(component\\[1\\] inputs)(component\\[1\\] outputs)...(component\\[n\\] inputs)(component\\[n\\] outputs)  |\n| `Module.triggerInput(/*index of component*/, /*0 = set, 1 = pulse*/, /*pointer to array of states for inputs*/);` | Triggers a user input |\n| `Module.destroy();` | Destroys current board. This is required before initializing a new board. |\n## Component Types\n| Type ID | Name | Inputs | Outputs | Ops |\n| --- | --- | --- | --- | --- |\n| 1 | NOT | 1 | 1 | x |\n| 2 | AND | 2 - 2^32 | 1 | x |\n| 3 | OR | 2 - 2^32 | 1 | x |\n| 4 | XOR | 2 - 2^32 | 1 | x |\n| 5 | DELAY | 1 | 1 | x |\n| 6 | CLOCK | 1 | 1 | [0] =\u003e Ticks between clock pulses |\n| 10 | Half Adder | 2 | 2 | x |\n| 11 | Full Adder | 3 | 2 | x |\n| 12 | ROM | 1 - 16 | 1 - 64 | [0..n] =\u003e Data for ROM (1 Byte per element) |\n| 13 | D Flip-Flop | 2 | 2 | x |\n| 14 | JK Flip-Flop | 3 | 2 | x |\n| 15 | SR Flip-Flop | 3 | 2 | x |\n| 16 | Random Number Generator | 1 | 1 - 2^32 | x |\n| 17 | RAM | 1 - 16 | 1 - 64 | x |\n| 18 | Decoder | 1 - 32 | 1 - 2^32 | x |\n| 19 | Encoder | 1 - 2^32 | 1 - 32 | x |\n| 20 | Multiplexer | 3 - (31 + 2^31) | 1 | [0] =\u003e select address size |\n| 21 | Demultiplexer | 2 - 32 | 2 - 2^31 | x |\n| 200 | User Input | 0 | 1 - 2^32 | x |\n## License\nThis Project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogigator%2Flogigator-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogigator%2Flogigator-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogigator%2Flogigator-simulation/lists"}