Giter Site home page Giter Site logo

b0nefish / poprc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hackerfoo/poprc

0.0 1.0 0.0 4.24 MB

A Compiler for the Popr Language

Home Page: https://popr.dev

License: GNU General Public License v3.0

Python 0.77% C 89.29% CSS 0.14% HTML 0.22% Emacs Lisp 0.61% Makefile 2.06% Shell 0.37% GDB 0.10% TeX 0.49% C++ 0.10% Nix 0.12% Verilog 5.69% SmPL 0.03%

poprc's Introduction

Popr Compiler Build Status

This project implements a compiler for the Popr language.

Please see this presentation for more information, and the tutorial to understand the language semantics.

More examples can be found in lib.ppr and tests.ppr.

You can try the compiler online using the PoprC web version.

PoprC targets both C and Verilog. For example, the familiar Fibonacci function:

fib: [dup 1 <= !] [dup 1- dup 1- fib swap fib + swap 1 > !] | pushl head

can be compiled to Verilog and synthesized or simulated:

fib wave

Note the stack pointer (sp). Recursion is fully supported, but must be bounded.

Here's a working AXI4-Lite slave:

stream_read_array: swap [swap read_array swap] map_with

stream_write_array: swap2 [-swap2 swap write_array dup True swap seq swap] zip_with

stream_read_write_array:
  swap3 dup_array [-swap2 swap stream_write_array] dip31 swap
    [swap stream_read_array] dip21

when wrapped with a bit of Verilog to map the signals properly.

License

The license for the Popr Compiler is GPL3. See LICENSE for more information.

poprc's People

Contributors

hackerfoo avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.