{"id":22975829,"url":"https://github.com/jc-ll/synchrony","last_synced_at":"2025-04-02T08:14:33.539Z","repository":{"id":146879979,"uuid":"335996250","full_name":"JC-LL/synchrony","owner":"JC-LL","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-22T10:08:08.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-07T22:51:15.258Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JC-LL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-02-04T15:27:03.000Z","updated_at":"2021-06-22T10:08:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"c5b8294c-a52d-4167-9623-3e8b6553d545","html_url":"https://github.com/JC-LL/synchrony","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JC-LL%2Fsynchrony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JC-LL%2Fsynchrony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JC-LL%2Fsynchrony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JC-LL%2Fsynchrony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JC-LL","download_url":"https://codeload.github.com/JC-LL/synchrony/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246777833,"owners_count":20832032,"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-15T00:39:32.367Z","updated_at":"2025-04-02T08:14:33.530Z","avatar_url":"https://github.com/JC-LL.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Synchrony\n\n_**warning** : work in progress / experimental_\n\n## A simple HDL\n\nSynchrony is a tiny Hardware description DSL.\n\n```\nrequire \"ha\"\n\ncircuit Example\n  input a,b,c,d,e,f\n  output o1,o2,o3\n\n  sig s1,s2,s3\n\n  o1=(s1 and c) or (d and !d) and (e xor f)    # simple expressions\n  s1,s2=ha(a,b)                                # use library elements\n  o2=(a and b) or (c and d) or reg(s2)         # DFF named 'reg'\n  s3=reg(a and s3)\n  o3=s3\nend\n```\n\nOnce compiled, this circuit 'Example' will be available for reuse. It is stored in a 'example.lib' file (that is simply a serialized version of Example).\n\n![](./doc/example.png).\n\n## Basic functionalities\n\n- Netlist visualization (Graphiz-based)\n- Boolean simplifications\n- VHDL \u0026 Verilog code generation (WIP)\n\n## Other grammar elements\n\nSynchrony grammar is not fully stabilized yet. Here is an overview of the grammar planed so far :\n\n```\ncircuit rca{N,M}       # integer parameterized circuit\n  input a,b : uint{N}  # parameterized type\n  input d   : uint{M}  # parameterized type\n  output s  : uint{?}  # please infer\nend\n\n\ncircuit test_1\n  input  a,e   : bit\n  input  b     : uint8\n  output c     : int3[4]\n  output d     : int23\n\n  sig s1,s2,s3 : bit\n  sig s4       : byte  # equivalent to uint8\n  sig s5       : sbyte # -128 to 127, equiv int8\n  sig s6,s7,s8 : bit\n\n  s1       = a and reg(e)        # reg syntax (async init with reg(e,0))\n  s2       = s1 or e$(0)         # alternative reg syntax, with e init at 0\n  s3       = !b[0] xor s2$$$(0)  # alternative not, bit access, 3 pipes using $\n  d[21..0] = {resize(0x7,15) ,b} # concatenation {} and resizing()\n  d[22]    = and3(s1,s2,s3)      # positional arguments call\n  s6,s7    = ha(a,e)             # positional circuit returns\n  s4       = b*2                 # hummm result will be on size(b)+1\n                                 # +,-,*,/,rem,mod\n  s8 = a ? (b or c) : (b xor a)  # ternary expressions / mux\nend\n```\n\n## Install\n\n```\ngem install synchrony\n```\n\nNote that synchrony depends on rtl_circuit Ruby gem.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjc-ll%2Fsynchrony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjc-ll%2Fsynchrony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjc-ll%2Fsynchrony/lists"}