Skip to content

chipmunk-project/chipmunk-tofino

Repository files navigation

Chipmunk (this version includes support for Tofino code generation)

Build status

Installation

  • Install sketch
  • Install Java. This repo uses antlr to generate parser and lexer.
  • pip3 install -r requirements-dev.txt -e . && pre-commit install (if you want to make changes to this repo),
  • pip3 install . (if you want to simply use chipmunk.).
  • Add sudo if you want to install system wide.

How to

Develop

If you have installed it as above, first re-install via following command.

pip3 install -r requirements-dev.txt -e .
pre-commit install

Note that there is -e in install command. It will install this package in development mode, and simply link actual chipc directory to your Python's site-packages directory.

  1. Make changes to python code
  2. Consider implementing tests and run tests python3 -m unittest
  3. Run your desired binary like python chipc/chipmunk.py ...

This way you don't have to keep installing and uninstalling whenever you make a change and test. However, still you have to run via python3 chipc/chipmunk.py instead of using the installed binary.

Also consider using venv, virtualenv or pipenv to create an isolated Python development environment.

Iterative solver

iterative_solver example_specs/simple.sk example_alus/stateful_alus/raw.alu example_alus/stateless_alus/stateless_alu.alu 2 2 "0,1,2,3" 10 --hole-elimination
iterative_solver example_specs/simple.sk example_alus/stateful_alus/raw.alu example_alus/stateless_alus/stateless_alu.alu 2 2 "0,1,2,3" 10 --parallel --parallel-sketch --hole-elimination

Test

Run:

You need to run setup in editable mode (with -e) to generate lexer and parser in this directory.

pip3 install -r requirements-dev.txt -e .
python3 -m unittest

If you want to add a test, add a new file in tests directory or add test cases in existing test_*.py file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages