Code Monkey home page Code Monkey logo

fpga-workshop's Introduction

FPGA-Fabric-Design-and-Architecture-Workshop-VSDIAT

Introduction to FPGA Architecture

Day 1

4 bit Counter Implementation on Baysis 3 Board using VIVADO

The Verilog code for 4 bit counter is shown in below

d1_counter

First of all the simulation is performed to test the functionality of the counter using VIVADO.

a1

The elaborated schematic of the counter is shown below a2

Now the IO-planning is performed by mapping the ports of the design to baysis 3 board pins. clk port is mapped on W5 pin that is clock pin of 100MHz rst port is mapped on the R2 switch cnt[0] is mapped on U16 cnt[1] is mapped on E19 cnt[2] is mapped on U19 cnt[3] is mapped on V19

a3

Synthesis is performed for the counter that gives the resource utilization for the counter design

a4

Next Implementation is performed during which the design is placed and routed on the baysis 3 board architechture. After the Implementation the final timing summary is also obtained which shows a positve slack that means the design can run on 100MHz.

a5

The last step is to generate the bitstream for baysis 3 board

a6

Virtual IO (VIO) counter on VIVADO

For obtaining the VIO in VIVDO, the "VIO IP" instance is included in the deisgn

a8

After that, again synthesis to bitstream generation flow is repeated that generates the bitstream to be loaded on the baysis 3 board.

a9

Day 2

Introduction to OpenFPGA

Running VPR flow on synthesized netlist

To run VPR flow we need to provide synthesized netlist in the form .blif and archtecture file in .xml format as shown in following command

$VTR_ROOT/vpr/vpr
$VTR_ROOT/vtr_flow/arch/timing/EArch.xml
$VTR_ROOT/vtr_flow/benchmarks/blif/tseng.blif
--route_chan_width 100

image

VPR shows placement of blocks on gui

image

There are multiple options here in the GUI e.g. toggle nets

image

Toggling the block pi utilization

image

Critical path toggling

image

After clicking on the proceed VPR flow completes.

image

The VPR flow also performs the timing analsysis for the design.

image

Running VTR flow on HDL design of counter

Now we run the VTR flow, that is from HDL design.ODIN-II to VPR place&route and analysis for both timing and and power. For this we have choosen a 4bit up counter in verilog.

image

Run following command, it will generate several files in the directory image

The important one is the pre_VPR.blif that is going to be used for further analysis using VPR flow

image

VPR flow running in GUI, performs the placment and routing

image

Post sythesis simulation is performed on the counter using VIVADO. Following command is used to generate postsyhtnesis netlist

image

Timing Analysis

image

Timing anlaysis is performed by providing the SDC contraints

Day 3

RVMyth Core RTL to Synthesis on VIVADO

• This core has several modules the main module is Core which has 3 inputs called clk, reset and output that is of 8 bits. • This adds the first 9 numbers and gives an output of 45 • The code is given here in RISCV Instructions based assembly code

f1

• These instructions are saved in the instruction memory as binary format as shown in below figure. It is a five stage pipelined processor in which the fetch unit fetches these instructions one by one then the decode unit decodes them and the execution unit or ALU performs the execution of these instructions and access the memory and at the end write back is performed.

f2

• Create a simple test-bench for testing the core present in the Code folder as test.v

f3

• Now simulate the Core in VIVADO by creating a new project and selecting baysis 3 as the Board. Add the main file myth_test.v in design sources section and testbench file in sources section.

f4

• Now perform Behavioral simulation for the design as shown in the below waveform. It shows the required output as we are expecting the sum of first 9 numbers as 45.

f5

• Now elaborating the design. Once the elaboration is done open the IO planning and assign the W5 clock of 100MHz of Baysis 3 Board to "clk" of the core and also assign the "reset" to a switch R2. And also set the IO standar as LVCMOS33. Here I don’t assign “out” to LEDs rather I observe it on ILA.

f6

• For observing the output on ILA I have to remove “out” port from the module definition and perform the elaboration again and now in the IO planning only the clk and reset will appear. • Before performing the synthesis we also add the timing constraints of 100 MHz using the constraint wizard in synthesis column. Below is the utilization summary of the synthesized design

f7

• Now perform Implementation and final implemented design after place and route

image

• The final timing summary of the MYTH core is obtained as

image

Day 4

Introduction to SOFA FPGA Fabric IP

SOFA(Skywater OpenSource FPGAs) consists of a series of opensource FPGA-IPs using the opensource 130nm PDK. To run the SOFA framwork its repo is clone and installed. There are multiple FPGA IPs are present in the SOFA such as:
. FPGA1212_SOFA_CHD_PNR
. FPGA1212_QLSOFA_HD_PNR
. FPGA1212_SOFA_HD_PNR
For smaller benchmark designs such as counter, here we use FPGA1212_QLSOFA_HD_PNR IP. To include the counter design first we need to add our custom four bit counter (verilog file) in FPGA1212_QLSOFA_HD_task/Bechmark directory.

l4_2 l4_3

Then we need to modify the "FPGA1212_QLSOFA_HD_task/config/task_simulation.conf" file as shown below:

l4_1

For running the SOFA flow we need to go back to SOFA/FOGA1212_SOFA_HD_PNR/ directory and run command "make runOpenFPGA"

l4_4

This will number files in the following directory

l4_5

Resource utilization of counter

l4_6_utilization

SDC contraints for Timing analysis

l4_7

Command added used to run timing analysis for VPR flow

l4_8

Run the SOFA flow again after providing the SDC file

l4_9

Setup report for 4 bit counter

l4_10_timing

Hold report for 4 bit counter

l4_11_hold

Generated the post implementation netlist for functional simulation

l4_12

Post implenentation netlist

l4_13

Functional simulation wavform for four bit counter

l4_14_post_simulation

Day 5

RVMyth Implementation on SOFA

Use following command in generate_testbench.openfpga

d5_2

After running " make runOpenFPGA" the successful run is shown below

d5_1

The VPR_stdout.log will also show the status of run

d5_3

Area Report of RVMyth

VPR provides the area results

d5_stat_result

VPR provides the detailed resource utilization of LUTs, flipflops etc. in VPR_stdout.log

d5_utilization

VPR also provides the detail about the logic elements in VPR_stdout.log

d5_Logicelements

Timing analysis of RVMyth

Upon providing the sdc constraints to VPR it generates the step and hold reports for the RVMyth core. Following command is provided in the generate_testbench.openfpga for the timing analysis.

d5_area_timing_commands

RVMyth core design is constrained by providing a period of 200ns. The sdc constraints are given below:

d5_sdc_constraints

VPR generated the Setup report

d5_setup_p1 d5_setup_p2

The hold report for RVMyth generated by VPR in SOFA

d5_hold

RVMyth Post implementation netlist Simulation Verification on VIVADO

The post implementation netlist is generated using VPR by provinding following command:

d5_area_timing_commands

The post implementation netlist

d5_postsynthesis_netlist

A simple testbench is written to verify the RVMyth core funtionality. As it is supposed to give a sum of first 9 numbers at the output.

d5_testbench

The simulation is performed on VIVADO by providing the primitive.v file that contains primitives used in the implementation RVMyth in SOFA. The final simulated result waveform is shown below:

d5_rvmyth_simulation

fpga-workshop's People

Contributors

ayyazmayo avatar

Watchers

 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.