Neknaj Circuit Game is a simulation tool for designing and testing digital circuits. It allows users to define modules, gates, and tests for their circuits and provides tools for compiling and testing these designs.
Web Page
Web Playground (CircuitGame Web Tool)
Tutorial
- DSL for describing logic circuits
- Transpile to TypeScript
- Development using both CLI and Web
Detailed explanation of the language specification for LLM, not raw
To install the project, follow these steps:
- git
- rust, cargo
- node, npm
- Clone
git clone https://github.com/neknaj/circuitgame cd circuitgame - Build
git pull cargo build --release # The built binary is: ./target/release/circuitgame_bin
-
Clone:
git clone https://github.com/neknaj/circuitgame.git cd circuitgame -
Install dependencies:
npm install
-
Build the project:
node build.js
This software is intended for development using both CLI and a Web Browser.
The CLI tool has a file watcher and websocket communication.
cargo run -- -i spec/sample.ncg -s 8080
# or: ncg -i spec/sample.ncg -s 8080Click the link displayed in the console to view the results in your web browser.
The circuit notation grammar is defined using a BNF-like syntax.
For a detailed BNF grammar, refer to the lang.bnf file in the spec directory.
For the actual implementation, see the parser.rs file in the src/compiler directory.
For more examples, see the sample.ncg file in the spec directory.
using nor:2->1;
// This is a NOT gate module
module not (x)->(a) {
a: nor <- x x;
}
// Providing tests for the not module
test not:1->1 {
t -> f;
f -> t;
}
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License.