{"id":15375117,"url":"https://github.com/ozansz/logisim-testbench","last_synced_at":"2025-04-15T15:13:17.367Z","repository":{"id":109436116,"uuid":"241459722","full_name":"ozansz/logisim-testbench","owner":"ozansz","description":"Open-source Logisim circuit black-box testing platform for Logic Design homeworks.","archived":false,"fork":false,"pushed_at":"2020-03-21T23:17:04.000Z","size":14839,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T15:13:09.438Z","etag":null,"topics":["automation","circuit","gui","homeworks","logisim-testbench","pyqt5","tester","testing"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ozansz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-18T20:24:32.000Z","updated_at":"2024-03-07T12:28:48.000Z","dependencies_parsed_at":"2023-03-31T03:36:29.250Z","dependency_job_id":null,"html_url":"https://github.com/ozansz/logisim-testbench","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozansz%2Flogisim-testbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozansz%2Flogisim-testbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozansz%2Flogisim-testbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozansz%2Flogisim-testbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ozansz","download_url":"https://codeload.github.com/ozansz/logisim-testbench/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249094933,"owners_count":21211837,"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":["automation","circuit","gui","homeworks","logisim-testbench","pyqt5","tester","testing"],"created_at":"2024-10-01T14:01:25.986Z","updated_at":"2025-04-15T15:13:17.348Z","avatar_url":"https://github.com/ozansz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CENG232 Logisim TestBench\n\nThis project aims for creating an open-source Logisim circuit black-box testing platform for CENG232 Logic Design homeworks.\n\n**Technology stack**: I used Python3 and Bash for scripts. Also JSON file type is used for circuit functionality definitions.\n\n## Contributors\n\nİlker Koşaroğlu [@ilkerkosaroglu](https://github.com/ilkerkosaroglu)\n\nYiğitcan Uçan [@ucanyiit](https://github.com/ucanyiit)\n\n## Dependencies\n\nThere is no need to install any software to use this tool if you are working in a Linux-based platform. The Logisim Evolution version is already included in the project root.\n\nThe only dependencies are:\n* Python3\n* PyQt5\n* Bash\n\nAn example GUI output for a successfull testing is as below,\n\n![](screenshots/example-ss-2.png)\n\n## Installation\n\nThe project requires only PyQt5 to be installed. To install it, just run the command below,\n\n```bash\npip3 install -r requirements.txt\n```\n\nThis will install **all** of the requirements to your local workspace.\n\n## GUI\n\nThe last version of TestBench comes with a sweet UI. To use the testbench with graphical interface, just run the command below,\n\n```bash\npython3 tester.py\n```\n\n## Usage\n\n### Test Configuration\n\nTo use the TestBench, you need to configure the circuit functionality. This is made using JSON file type.\n\nThe configuration file consists of three parst. **Input**, **output** and **variable**s. Inputs are bound to variables, then variables are used to configure outputs.\n\n```\nInput pins =\u003e Variables =\u003e Output pins\n```\n\n#### Inputs\n\nThe `inputs` part is an array of strings. The elements **must** be of the labels of inputs pins in the *.circ* file.\n\nExample,\n\n```json\n\"inputs\": [\n    \"A\",\n    \"B\"\n]\n```\n\n#### Variables\n\nThe variables are Pythonic structures that holds the value of **one or more** pins. These variables are used to define the functionality of output pins.\n\n* Only input pins can be used in variable definition.\n* Variables can hold value of one or more pins.\n* Definitions are Python expressions.\n* Pins are expressed using a dollar-sign in definitions, such as Bash scrips.\n* One-pin value variable is defined as `int($PIN)` for a pin named 'PIN'\n* Two-pin value variable is defined using pipe operator (`|`) such as `$P1 | $P0` for pins named 'P1' and 'P0'.\n* Many-pin value variable is defined as `$PA | $PB | $PC | ...`, using the pipe operator more than once.\n\nExample,\n\n```json\n\"variables\": {\n    \"a\": \"int($A)\",\n    \"b\": \"int($B)\",\n    \"c\": \"$C | $D\"\n}\n```\n\n#### Outputs\n\nThe outputs are also Pythonic structures that holds the value of output pins. The output pins are defined **using only** variables.\n\n* Only variables can be used in output pin definition.\n* Definitions are Python expressions.\n* Variables are expressed using a dollar-sign in definitions, such as Bash scrips.\n\nExample,\n\n```json\n\"outputs\": {\n    \"AND\": \"$a * $b\",\n    \"OR\": \"$a + $b\",\n    \"NOR\": \"($a + $b) != 0\"\n}\n```\n\nThere is a well done example configuration below,\n\n```json\n{\n    \"inputs\": [\n        \"A\",\n        \"B\"\n    ],\n    \"variables\": {\n        \"a\": \"int($A)\",\n        \"b\": \"int($B)\"\n    },\n    \"outputs\": {\n        \"AND\": \"$a * $b\",\n        \"OR\": \"$a + $b\",\n        \"NOR\": \"($a + $b) != 0\",\n        \"XOR\": \"($a + $b) % 2\",\n        \"XNOR\": \"($a + $b) % 2 == 0\"\n    }\n}\n```\n\nThe equivalent functions for the configuration above is,\n\n```C\nAND = A \u0026\u0026 B;\nOR = A || B;\nNOR = !(A || B);\nXOR = A ^ B;\nXNOR = !(A ^ B);\n```\n\n### The Test Runner\n\n~~When the configuration file is ready, the only thing to be done to test your circuit is to use the `runtest.sh` script. It will automatically generate truth tables and test your circuit through the test cases.~~\n\nThe test runner script is deprecated. Please use the gui (`tester.py`) instead.\n\n## Known issues\n\nYou cannot construct complex circuit definitions with the current parsing technique. Honestly, I could have designed a description language and its parser, compiler etc. for this project, but I have many projects to contribute :)\n\n## Getting help\n\nYou can get in contact with me using my e-mail addresses,\n\n* ozan.sazak@protonmail.ch\n* sazak@ieee.metu.edu.tr\n* ozan.sazak@metu.edu.tr\n\n## Getting involved\n\nIf you want to contribute to my project, there are a few features I would appreciate if someone else helps me to implement,\n\n* Custom description language and parser\n* ~~Graphical interface for the whole tool~~\n* Better code documentation\n\n----\n\n## Open source licensing info\n1. [LICENSE](LICENSE)\n2. [CFPB Source Code Policy](https://github.com/cfpb/source-code-policy/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozansz%2Flogisim-testbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fozansz%2Flogisim-testbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozansz%2Flogisim-testbench/lists"}