Skip to content

Paebbels/PicoBlaze-Library

Repository files navigation

The PicoBlaze-Library

The PicoBlaze-Library offers several PicoBlaze devices and code routines to extend a common PicoBlaze environment to a little System on a Chip (SoC or SoFPGA).

Table of Content:

  1. Overview
  2. Download
  3. Requirements
  4. Integrating the Library into Projects
  5. Using PicoBlaze-Library
  6. Configuring a System-on-FPGA with PicoBlaze-Library
  7. Updating PicoBlaze-Library

1 Overview

TODO TODO TODO

Related repositories: PicoBlaze-Examples

2 Download

The PicoBlaze-Library can be downloaded as a zip-file (latest 'master' branch) or cloned with git clone from GitHub. GitHub offers HTTPS and SSH as transfer protocols. See the Download wiki page for more details.

For SSH protocol use the URL ssh://git@github.com:Paebbels/PicoBlaze-Library.git or command line instruction:

cd <GitRoot>
git clone --recursive ssh://git@github.com:Paebbels/PicoBlaze-Library.git L_PicoBlaze

For HTTPS protocol use the URL https://github.com/Paebbels/PicoBlaze-Library.git or command line instruction:

cd <GitRoot>
git clone --recursive https://github.com/Paebbels/PicoBlaze-Library.git L_PicoBlaze

Note: The option --recursive performs a recursive clone operation for all linked git submodules. An additional git submodule init and git submodule update call is not needed anymore.

3 Dependencies:

The PicoBlaze-Library depends on:

Both dependencies are available as GitHub repositories and can be downloaded via git clone. See section the Dependencies and/or Integration wiki pages for more details.

4 Requirements

The PicoBlaze-Library comes with some scripts to ease most of the common tasks. We choose to use Python as a platform independent scripting environment. All Python scripts are wrapped in PowerShell or Bash scripts, to hide some platform specifics of Windows or Linux. See the Requirements wiki page for more details and download sources.

Common Requirements:
  • Programming languages and runtimes:
  • Synthesis tool chains:
    • Xilinx ISE 14.7 or
    • Xilinx Vivado ≥ 2014.1 or
    • Altera Quartus-II ≥ 13.0
  • Simulation tool chains:
    • Xilinx ISE Simulator 14.7 or
    • Xilinx Vivado Simulator ≥ 2014.1 or
    • Mentor Graphics ModelSim Altera Edition or
    • Mentor Graphics QuestaSim or
    • GHDL and GTKWave
  • Assembler tool chains:
Additional requirements on Linux:
  • m4 macro pre-processor
  • Debian specific:
    • bash is configured as /bin/sh (read more)
      dpkg-reconfigure dash
Additional requirements on Windows:

4 Integrating PicoBlaze-Library into Projects

The PicoBalze-Library is meant to be integrated into HDL projects. Therefore it's recommended to create a library folder and add the PicoBlaze-Library as a git submodule. After the repository linking is done, some short configuration steps are required to setup paths and tool chains. The following command line instructions show a short example on how to integrate the PicoBlaze-Library. A detailed list of steps can be found on the Integration wiki page.

4.1 Adding PicoBlaze-Library and it's Dependencies as git submodules

All Windows command line instructions are intended for Windows PowerShell, if not marked otherwise. So executing the following instructions in Windows Command Prompt (cmd.exe) won't function or result in errors! See the Requirements wiki page on where to download or update PowerShell.

The following command line instructions will create a library folder lib\ and clone all depenencies as git submodules into subfolders.

cd <ProjectRoot>

mkdir lib\PoC\
git submodule add ssh://git@github.com:VLSI-EDA/PoC.git lib\PoC
git add .gitmodules lib\PoC
git commit -m "Added new git submodule PoC in 'lib\PoC' (PoC-Library)."

mkdir lib\L_PicoBlaze\
git submodule add ssh://git@github.com:Paebbels/PicoBlaze-Library.git lib\L_PicoBlaze
git add .gitmodules lib\L_PicoBlaze
git commit -m "Added new git submodule L_PicoBlaze in 'lib\L_PicoBlaze' (PicoBalze-Library)."

mkdir lib\opbasm\
git submodule add ssh://git@github.com:Paebbels/opbasm.git lib\opbasm
git add .gitmodules lib\opbasm
git commit -m "Added new git submodule opbasm in 'lib\opbasm' (Open PicoBlaze Assembler)."

4.2 Configuring PoC on a Local System

The previous step cloned the PoC-Library into the folder lib\PoC\. This library needs to be configured to provide its full potential.

cd <ProjectRoot>
cd lib\PoC\
.\poc.ps1 --configure

4.3 Creating PoC's my_config and my_project Files

The PoC-Library needs two VHDL files for it's configuration. These files are used to determine the most suitable implementation depending on the provided platform information. Copy these two template files into your project's source folder. Rename these files to *.vhdl and configure the VHDL constants in these files.

cd <ProjectRoot>
cp lib\PoC\src\common\my_config.vhdl.template src\common\my_config.vhdl
cp lib\PoC\src\common\my_project.vhdl.template src\common\my_project.vhdl

my_config.vhdl defines two global constants, which need to be adjusted:

constant MY_BOARD            : string := "CHANGE THIS"; -- e.g. Custom, ML505, KC705, Atlys
constant MY_DEVICE           : string := "CHANGE THIS"; -- e.g. None, XC5VLX50T-1FF1136, EP2SGX90FF1508C3

my_project.vhdl also defines two global constants, which need to be adjusted:

constant MY_PROJECT_DIR      : string := "CHANGE THIS"; -- e.g. d:/vhdl/myproject/, /home/me/projects/myproject/"
constant MY_OPERATING_SYSTEM : string := "CHANGE THIS"; -- e.g. WINDOWS, LINUX

4.4 Compiling shipped Xilinx IPCores (*.xco files) to netlists

The PicoBlaze-Library and the PoC-Library are shipped with some pre-configured IP cores from Xilinx. These IPCores are shipped as *.xco files and need to be compiled to netlists (*.ngc files) and there auxillary files (*.ncf files; *.vhdl files; ...). This can be done by invoking PoC's Netlist.py through one of the provided wrapper scripts: netlist.[sh|ps1].

Compiling needed IP cores from PoC for a KC705 board:

cd <ProjectRoot>
cd lib\PoC\netlist
foreach ($i in 1..15) {
  .\netlist.ps1 --coregen PoC.xil.ChipScopeICON_$i --board KC705
}

Compiling needed IP cores from L_PicoBlaze for a KC705 board:

cd ....
cd lib\L_PicoBlaze\netlist\<DeviceString>\
# TODO: write a script to regenerate all IP Cores

5 Using PicoBlaze-Library

6.1 Standalone

6.1 In Xilinx ISE (XST and iSim)

6.2 In Xilinx Vivado (Synth and xSim)

6 Configuring a System-on-FPGA with PicoBlaze-Library

7 Updating PicoBlaze-Library

About

The PicoBlaze-Library offers several PicoBlaze devices and code routines to extend a common PicoBlaze environment to a little System on a Chip (SoC or SoFPGA).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published