Skip to content

HackerFoo/poprc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6f3358c · Jan 7, 2021
Jan 7, 2021
Jul 28, 2019
Oct 1, 2020
Sep 24, 2020
Oct 10, 2020
Jan 7, 2021
Jan 7, 2021
Aug 8, 2020
Sep 12, 2020
Jul 20, 2020
Jan 7, 2021
Jan 3, 2021
May 3, 2017
Apr 17, 2020
Oct 10, 2020
Sep 6, 2020
Oct 1, 2020
Jan 7, 2021
Sep 15, 2020
Aug 26, 2017
Aug 30, 2020
Jun 22, 2020
Sep 14, 2013
Jul 20, 2020
May 5, 2013
Sep 4, 2016
Mar 23, 2015
Oct 7, 2012
Sep 15, 2020
Jan 7, 2021
Aug 25, 2020
Oct 10, 2020
Sep 5, 2020
Sep 15, 2020
Oct 1, 2020
Aug 8, 2020
Jul 23, 2020
Aug 15, 2020
Sep 5, 2020
Jan 7, 2021
Jan 7, 2021
Oct 10, 2020
Oct 10, 2020
Oct 1, 2020
Aug 14, 2020
Aug 8, 2020
Aug 2, 2020
Apr 18, 2019
Jun 18, 2020
Sep 15, 2020
Mar 25, 2015
Sep 10, 2020
Jan 7, 2021
Oct 10, 2020
Jun 22, 2020
Oct 10, 2020
Jun 29, 2017
Jan 7, 2021
Jan 3, 2021
Jan 7, 2021
Jan 7, 2021

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.