Coding Phase 2 with Librecores CI, OpenRISC, Fusesoc & Jenkins

Nancy Chauhan
4 min readJul 29, 2019

--

This is the fourth post on GSoC with FOSSi Foundation. This blog defines my work in Coding Phase 2. Throughout this phase CI Pipelines improved, new test automation was added to the OpenRISC projects and worked on Yosys Synthesis.

Yosys Synthesis with fusesoc

  • Yosys is a framework for Verilog RTL synthesis.
  • It was required in the openrisc project for monitoring resource usages.
  • FuseSoC is a package manager and a set of build tools for HDL (Hardware Description Language) code. Its main purpose is to increase the reuse of IP (Intellectual Property) cores and be an aid for creating, building and simulating SoC solutions.
  • Fusesoc: The icestorm backend ( edalize ) uses yosys to handle synthesis, arachne-pnr for place & route and icepack for creating the bitstream.

For using fusesoc, core description is a required file that contains all the information it needs to have about the core in order to run simulations on the core, build it for an FPGA target or use it as a dependency of another core.

So for the yosys synthesis in openrisc project, the first step was to generate yosys.log file, so I did some changes in mor1kx.core file in mor1kx repository to include icestorm tool. https://github.com/openrisc/mor1kx/blob/master/mor1kx.core

Modifying mor1kx.core : fusesoc (icestorm tool build)

tinyfpga_bx:
default_tool : icestorm
filesets : [core, tinyfpga_bx]
tools:
icestorm:
nextpnr_options : [--lp8k, --pcf-allow-unconstrained, --package, cm81, --freq, 32]
pnr: next
toplevel : mor1kx
Printing Statistics of Yosys Synthesis

The command used to only run synthesis in the icestorm backend by setting pnr to none :

  • fusesoc run — target=tinyfpga_bx mor1k — pnr=none

After generating yosys.log file with help of fusesoc, I created a parser to only get printing statistics from a huge yosys.log file. I used Regular Expression to extract data from the log file.

Quick Start ( commands )fusesoc library add mor1kx ../mor1kxfusesoc run --target=tinyfpga_bx mor1kx --pnr=none./extract_stats.py < build/mor1kx_5.0-r3/tinyfpga_bx-icestorm/yosys.logResult ( After extracting printing statistics from log file )mor1kx git:(yosys-ci) ✗ ./extract_stats.py < build/mor1kx_5.0-r3/tinyfpga_bx-icestorm/yosys.log[('wires', '5578'), ('memories', '0'), ('processes', '0'), ('cells', '7310')][('SB_CARRY', '426'), ('SB_DFF', '166'), ('SB_DFFE', '885'), ('SB_DFFESR', '569'), ('SB_DFFESS', '13'), ('SB_DFFSR', '56'), ('SB_DFFSS', '2'), ('SB_LUT4', '5182'), ('SB_RAM40_4K', '11')]

After this work, it is intended to parse and visualize the test results of the openrisc project and yosys synthesis using the Jenkins plugins.

WIP: Parsing and visualizing test reports for mor1kx

Tap Plugin: To be used for test results of openrisc projects

Performance Plugin: To be used for synthesis and PNR metrics (e.g. used LUTs)

Sample images for Tap and Performance Plugin

--

--

Nancy Chauhan
Nancy Chauhan

Written by Nancy Chauhan

Hi, I am Nancy Chauhan. I like hacking through software engineering problems. I break down complicated concepts into easier tech blogs.

No responses yet