Home

Awesome

PyCoRAM

Python-based Portable IP-core Synthesis Framework for FPGA-based Computing

Copyright (C) 2013, Shinya Takamaeda-Yamazaki

E-mail: takamaeda_at_ist.hokudai.ac.jp

License

Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)

Publication

If you use PyCoRAM in your research, please cite our paper.

@inproceedings{Takamaeda:2013:CARL:PyCoRAM,
author = {Takamaeda-Yamazaki, Shinya and Kise, Kenji and Hoe, James C.},
title = {{PyCoRAM: Yet Another Implementation of CoRAM Memory Architecture for Modern FPGA-based Computing}},
booktitle={Intersections of Computer Architecture and Reconfigurable Logic (CARL 2013)},
month={Dec},
year = {2013},
location = {Davis, CA},
} 

What's PyCoRAM?

PyCoRAM is a Python-based portable IP-core synthesis framework with CoRAM (Connected RAM) memory architecture.

PyCoRAM framework generates a portable IP-core package from computing logic descriptions in Verilog HDL and memory access pattern descriptions in Python. Designers can easily build an FPGA-based custom accelerator using a generated IP-core with any common IP-cores on vendor-provided EDA tools. PyCoRAM framework includes (1) the Verilog-to-Verilog design translation compiler and (2) the Python-to-Verilog high-level synthesis (HLS) compiler for generating control circuits of memory operations.

There are some major differences between PyCoRAM and the original soft-logic implementation of CoRAM.

Installation

Requirements

Python3 is recommended.

Install on your platform. For exmple, on Ubuntu:

sudo apt-get install iverilog

Install on your python environment by using pip.

pip install jinja2

Install from pip:

pip install pyverilog

Install

Install PyCoRAM.

python setup.py install

On Docker

Dockerfile is available, so that you can try PyCoRAM on Docker without any installation on your host platform.

cd docker
sudo docker build -t user/pycoram .
sudo docker run --name pycoram -i -t user/pycoram /bin/bash
cd PyCoRAM/tests/single_memory/
make build
make sim

Getting Started

You can use the pycoram command from your console.

pycoram

You can find some examples in 'PyCoRAM/examples/' and 'PyCoRAM/tests'.

Let's begin PyCoRAM by an example in 'tests/single_memory'. You will find two source files.

Type 'make' to build a PyCoRAM IP-core from the source files. Then type 'make run' to simulate sample system.

make build
make sim

Instead, you can type commands as below directly at 'PyCoRAM' directory.

pycoram default.config -t userlogic -I include tests/single_memory/ctrl_thread.py tests/single_memory/userlogic.v
iverilog -I pycoram_userlogic_v1_00_a/hdl/verilog/ pycoram_userlogic_v1_00_a/test/test_pycoram_userlogic.v 
./a.out

PyCoRAM compiler generates a directory for IP-core (pycoram_userlogic_v1_00_a, in this example).

'pycoram_userlogic_v1_00_a.v' includes

A bit-stream can be synthesized by using Xilinx Platform Studio, Xilinx Vivado, and Altera Qsys. In case of XPS, please copy the generated IP-core into 'pcores' directory of XPS project.

This project has some examples in 'PyCoRAM/examples/' and 'PyCoRAM/tests'. To build them, please modify 'Makefile', so that the corresponding files and parameters are selected (especially INPUT, MEMIMG and USERTEST).

PyCoRAM Command Options

Command

pycoram [config] [-t topmodule] [-I includepath]+ [--memimg=filename] [--usertest=filename] [file]+

Description

Related Project

Pyverilog

CoRAM