Git Product home page Git Product logo

block-pio-sifive-bidirport's Introduction

Overview

This branch represents the Parallel IO (PIO) block and loopback Verification IP (VIP) in their completed state. This README describes the commands for running tests, creating an FPGA bitstream, and generating documentation.

The earlier preonboarded branch has step-by-step instructions detailing how the PIO block was created and integrated into the test socket framework.

The PIO block communicates to the CPU through an AXI4 interface. This interface is used to read from and drive the odata, oenable, and idata control registers that map to top-level ports. To integrate this block we need make the odata, oenable, and idata ports available at the top-level of design and connect the AXI4 interface to the Test Socket's periphery bus.

There is also an accompanying VIP for testing our block. The loopback VIP needs to be instantiated in the test harness and be connected to the odata, oenable, and idata pads. The loopback block outputs the xor of oenable and odata to idata.

Getting Started

Dependencies

wit

  • Wit is a workspace manager
  • Use version 0.11.0
  • Please see instructions on the wit README

wake

duh

Other dependencies

  • riscv-gnu-toolchain
  • device-tree-compiler
    • Available via most package managers:
    • eg. Ubuntu sudo apt-get install device-tree-compiler
  • libfdt-dev
    • Available via most package managers:
    • eg. Ubuntu sudo apt-get install libfdt-dev
  • Verilog simulator
  • python3 and pip3
  • ruby v2.3.7 or later

Environment package

In order for wake to be able to provide the correct environments for jobs that need to run the above tools, you will need an environment package that provides wake job runners that can fulfill those environments for your particular system. An example is environment-example-sifive.

Initialize the workspace

# Create a workspace, this will also fetch all dependencies
wit init workspace -a [email protected]:sifive/block-pio-sifive.git
cd workspace/

# Add an environment package to provide runners for the required tools
wit add-pkg $MY_ENVIRONMENT_PACKAGE

# Resolve and fetch all transitive dependencies
wit update

# Initialize the workspace for building with wake
wake --init .

Running tests

We can run PIO simulation tests with the following command.

wake 'runSim ${dut plan}'

The run function uses the default output directory and simulator. ${workspace root}/build is the default output directory, and VCS is the default simulator.

The available simulators are VCS, VCS_Waves, Verilator, Verilator_Waves, Xcelium, and Xcelium_Waves. To run tests with a different simulator use

wake 'runSimWith ${dut plan} ${VCS|VCS_Waves|Verilator|Verilator_Waves|Xcelium|Xcelium_Waves}'

Running tests will invoke the RocketChip generator and Firrtl to generate verilog files for the selected DUT plan, gcc to compile the selected programs, and the selected simulator to run each program on its respective DUT.

Each test will create a simulation output directory with the name ${build_dir}/${dut_name}/sim/${simulator}/results/${program_name}. This directory contains sim.err and sim.out files containing the contents of stderr and stdout respectively. There is also a console.log file which is where printf prints to by default. Waveform files and any other simulation files can also be found in this directory.

Verilog files can be found in ${build_dir}/${dut_name}/verilog.

Firrtl files can be found in ${build_dir}/${dut_name}/firrtl.

bin, elf, and hex files of the test program can be found in ${build_dir}/${dut_name}/program/${program_name}.

Creating a Bitstream

We can also map our test-socket and pio block to a VC707 fpga using makeVC707TestSocketDUT. To create the bitstream, run

wake 'runBitstream "vc707" pioVC707DUT'

The bitstream will be placed at build/api-generator-sifive/pioVC707DUT/mcs/obj/VC707Shell.bit

Creating Documentation

The earlier onboarding process created text describing the PIO block and how it is used. The following command generates a test "Onboarding" document which includes that text.

wake makeOnboardingDocument pioDUT

The command creates two files, pioDUT.html and pioDut.adoc, both in the directory build/api-generator-sifive/pioDUT/documentation. The .html file can be viewed directly in a web browser, and the .adoc file contains AsciiDoc which can be used for further processing, See the AsciiDoctor PDF project for information on converting AsciiDoc to PDF.

Wrap up

Checkout branch preonboarded if you would like to go back to the beginning and see the steps used for onboarding this PIO block.

block-pio-sifive-bidirport's People

Contributors

ryansangdeokpark avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.