{"id":22123072,"url":"https://github.com/bcrist/zoink","last_synced_at":"2025-03-24T07:27:59.626Z","repository":{"id":250260961,"uuid":"833951667","full_name":"bcrist/zoink","owner":"bcrist","description":"Programmer's Digital Design \u0026 Board Layout Tool","archived":false,"fork":false,"pushed_at":"2024-07-26T05:40:32.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T12:48:09.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","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/bcrist.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":"2024-07-26T05:38:13.000Z","updated_at":"2024-07-26T05:40:35.000Z","dependencies_parsed_at":"2024-07-26T07:02:44.901Z","dependency_job_id":null,"html_url":"https://github.com/bcrist/zoink","commit_stats":null,"previous_names":["bcrist/zoink"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcrist%2Fzoink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcrist%2Fzoink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcrist%2Fzoink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcrist%2Fzoink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcrist","download_url":"https://codeload.github.com/bcrist/zoink/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245226712,"owners_count":20580734,"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-12-01T15:29:08.942Z","updated_at":"2025-03-24T07:27:59.605Z","avatar_url":"https://github.com/bcrist.png","language":"Zig","readme":"# _Zoink!_\n### Programmer's Digital Design \u0026 Board Layout Tool\n\n* Are you tired of painstakingly entering your designs in KiCAD's schematic editor before you can lay out the board?\n* Have you ever wished that putting together a board design was less like photo editing and more like programming?\n* Do you hate manually creating KiCAD symbols and footprints for every part you use, but just can't bring yourself to trust the default KiCAD component libraries?\n* Are your wracked with disappointment when you send a board off to the fab only to notice that you forgot a decoupling cap somewhere?\n* Do you wish KiCAD's ERC could check for logic level incompatibilities, bus contention, and behavioral correctness of your design?\n* Are you addicted to writing Zig code?\n\nIf you answered \"yes\" to many of the above questions, you may be interested in _Zoink!_\n\n## Usage\nFirst, create a new zig project and add _Zoink!_ as a dependency with `zig fetch --save git+https://github.com/bcrist/zoink`.  Create a source file for your board and import `zoink`.\n\n### Netlist Configuration\nCreate a function to configure your board's netlist like so:\n```zig\npub fn configure(b: *Board) !void {\n    // Define parts and nets here!\n}\nconst Board = zoink.Board;\nconst zoink = @import(\"zoink\");\n```\nYou can add parts to the board with `Board.part(type)`.  This will return a pointer to an instance of the part type that you passed in.  You can find built-in parts in `zoink.parts`, or create your own.  Part types must be able to be initialized from `.{}`.  You must assign nets to all the non-power pins of the part after adding it to the board.  Failing to do this will generate an error when trying to use the board later.\n\nYou can use `Board.net(name)` to get or create a named net.  This returns a net ID that can be saved to a variable and used by value.  You can get or create a bus with `Board.bus(name, width)`.  A bus is just `[n]Net_ID` (or `[]const Net_ID`) so you can use zig's `++` operator to concatenate buses, and the normal slicing syntax to extract part of a bus.  You can also retrieve only part of the bus from the start with.  e.g. to get the high nibble of an 8-bit bus: `b.bus(\"MY_BUS[4:7]\", 4)`.  Note that the length of the subscript must match the length parameter in this case.\n\n### Automatic Power Connection \u0026 Decoupling Caps\nParts that contain a field named `pwr` will automatically have the signals in that struct connected to the power nets of the same name if they are not manually set.  Most parts will also automatically insert a decoupling capacitor for each non-ground signal.  This uses a special decoupling cap package, which has only 2 physical terminals, but 3 logical terminals.  This allows it to use a separate anonymous net to connect to the power pin, ensuring that the decoupling capacitor is actually placed right next to its associated power pin.\n\n### Automatic Designation Assignment\nEach part added to a board has a `base` field which allows you to assign a designator/name/value for the part, or override the default package/footprint.  Any parts that you don't manually assign a designator to will automatically have the next free number assigned.\n\n### Remapping units/gates/bits\nSome parts have multiple units/gates/bits that are logically interchangeable, but physically tied to specific pins.  In this case, the part should have a `remap` field, which is an array of integers.  Swapping values in this allows you to control which set of physical pins maps to a particular logical element.\n\n### Behavior Tests\nYou can write zig tests that does a basic simulation of your circuit and assert that signals have the correct value under specific conditions.\n\nFor examples of writing behavior tests, see the various files in the `test` folder.\n\n\n## Planned Features\n* Programmatic package footprint generation\n* Definition of board edges \u0026 filled zones in Zig code\n* Board component placement in Zig code\n* Export to KiCAD/pcbnew board file\n\n## Stretch Goals / Brainstorm Area\n* Integration with [Zig-LC4k](https://github.com/bcrist/Zig-LC4k)\n* Constraint-based component placement\n* Code-assisted routing\n* Default trace widths by net\n* Configurable axes (arbitrary angle; not just orthogonal X/Y)\n* Realtime board preview (likely taking advantage of zig 0.14's `zig build --watch`)\n* Preview-assisted component placement \u0026 movement\n* Preview-assisted routing\n* Trace spacing optimization\n* Curved traces \u0026 teardrops\n* \"channels\" - autoroute a whole bus at one time by specifying the bounding polygon and entry/exit points for each signal\n\n## Non-Features\nThese are outside the scope of the project and likely will never be considered:\n* Timing simulation\n* Full analog SPICE simulation\n* Export to KiCAD/eeschema files\n* Import of KiCAD files\n* CAM Export (gerbers/drills)\n* 3D Board Rendering\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcrist%2Fzoink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcrist%2Fzoink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcrist%2Fzoink/lists"}