Skip to content

CyberFlameGO/poprc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Compiler for the Popr Language

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages

  • C 89.5%
  • Verilog 5.6%
  • Makefile 2.0%
  • Python 0.8%
  • Emacs Lisp 0.6%
  • TeX 0.5%
  • Other 1.0%