An HDL for the gates submission to LLJam 0001

Related tags

Utilities gates-hdl
Overview

gates-hdl

An "HDL" for the https://github.com/ncatelli/gates submission to LLJam 0001

A web frontend has been made available at https://ncatelli.github.io/gates-hdl/.

Dependencies

  • rust 1.56+

if you want to run the example:

  • docker 19.03.0+
  • docker-compose latest

Testing

Tests can be run via the standard cargo test sub-command.

cargo test

Building

Locally

cargo build --release

Browser

$ wasm-pack build
$ cd www/
$ npm install
$ npm run start

Running

Locally

A two gate example can be built with the following two commands

a OF second; LINK first -> b OF second;" > example.hdl $ ./target/release/gates-hdl example.hdl -o docker-compose.yaml">
$ echo "DEFINE first AS not;
DEFINE second AS and;
LINK first -> a OF second;
LINK first -> b OF second;" > example.hdl

$ ./target/release/gates-hdl example.hdl -o docker-compose.yaml

The docker-compose environment can then be run with the following.

$ docker-compose up -d

The containers can be checked to validate they have gone healthy.

$ docker-compose ps
       Name                     Command                  State       Ports
--------------------------------------------------------------------------
gates-hdl_first_1    /opt/gates/bin/gates not - ...   Up (healthy)        
gates-hdl_second_1   /opt/gates/bin/gates and - ...   Up (healthy) 

A signal can be sent to the first gate with the following:

$ docker run --rm --network gates-hdl_default curlimages/curl:7.83.1 -X POST -sD - -d '{"state": false, "tick": 0}' http://first:8080/input/a 
HTTP/1.1 202 Accepted
Date: Thu, 23 Jun 2022 15:15:09 GMT
Content-Length: 0

And now the output from the second gate, which defaults to stdout output, can be seen in the logs.

$ docker-compose logs
Attaching to gates-hdl_second_1, gates-hdl_first_1
first_1   | 2022/06/23 15:10:45 Starting server on 0.0.0.0:8080
first_1   | 2022/06/23 15:10:45 Configured as not gate
second_1  | 2022/06/23 15:10:45 Starting server on 0.0.0.0:8080
second_1  | 2022/06/23 15:10:45 Configured as and gate
second_1  | 2022/06/23 15:15:09 tick: 0, state: true

Grammar

The grammar can be found in the following representations:

Comments
  • Add link to frontend

    Add link to frontend

    Introduction

    Small documentation PR to add a link to the gates-hdl compiler webpage to the readme.

    Linked Issues

    Dependencies

    Test

    • [x] Tested Locally
    • [x] Documented

    Review

    • [x] Ready for review
    • [x] Ready to merge

    Deployment

    opened by ncatelli 0
  • Web frontend

    Web frontend

    Introduction

    This PR introduces a web frontend, and graph renderer as an alternative to the cli-based compiler.

    Linked Issues

    Dependencies

    Test

    • [x] Tested Locally
    • [x] Documented

    Review

    • [x] Ready for review
    • [x] Ready to merge

    Deployment

    opened by ncatelli 0
  • Implement compiler

    Implement compiler

    Introduction

    This PR introduces a first pass at the compiler implementation.

    Linked Issues

    Dependencies

    Test

    • [x] Tested Locally
    • [x] Documented

    Review

    • [x] Ready for review
    • [x] Ready to merge

    Deployment

    opened by ncatelli 0
  • Implement parser

    Implement parser

    Introduction

    This PR implements the first pass at the HDL parser and ast.

    Linked Issues

    Dependencies

    Test

    • [x] Tested Locally
    • [x] Documented

    Review

    • [x] Ready for review
    • [x] Ready to merge

    Deployment

    opened by ncatelli 0
  • Initial grammar

    Initial grammar

    Introduction

    This PR introduces the first iteration of the grammar. This may change over time but will function as an initial target to implement the ast and parser against.

    Linked Issues

    Dependencies

    Test

    • [x] Tested Locally
    • [x] Documented

    Review

    • [x] Ready for review
    • [x] Ready to merge

    Deployment

    opened by ncatelli 0
Owner
Nate Catelli
SysEng with Packetfire
Nate Catelli
Game jam submission for Bevy Jam #2

Elemental Sorcerer A game made in 10 days for Bevy Jam #2. The theme was: combine. It's a mini metroidvania where the player can infuse their equipmen

Louis Tarvin 15 Dec 24, 2022
An efficient, robust, and generalized batch submission service for rollup stacks written in pure rust.

archon is an efficient, robust, and generalized batch submission service for rollup stacks written in pure rust. Note Archon is primarily tested again

refcell.eth 75 Apr 2, 2023