0%

AXI4 Protocol

A detour to learn the interface generation phase of HLS (Adapt to Xilinx FPGA)

The AXI protocol is burst-based and defines the following independent transaction channels

  • read address
  • read data
  • write address
  • write data
  • write response.
image-20210410102209585
Read more »

Verilog in a NutShell

This is a detour to better understand the GenerateRTL phase of LegUp HLS

语言基础

电路结构的三种描述方法

  • 数据流描述: 采用assign 语句,该语句被称为连续赋值语句。
  • 行为描述:使用always 或initial 语句块,其中出现的语句被称为过程赋值语句。
  • 结构化描述:实例化已有的功能模块。
Read more »

Modulo Scheduling In HLS (Loop Pipeline synthesis)

Instruction Scheduling Introduction

Instruction Scheduling can be broken into three categories: Local Scheduling, Global Scheduling, and Cyclic Scheduling:

  • Local Scheduling handles single basic blocks which are regions of straight line code that have a single entry and exit (List scheduling).
  • Global Scheduling can handle multiple basic blocks with acyclic control flow (Trace Scheduling, Superblock Scheduling, Hyperblock Scheduling).
  • Cyclic Scheduling handles single or multiple basic blocks with cyclic control flow. (Modulo Scheduling)

There exist many Global Scheduling algorithms that can also be used in cyclic scheduling

  • Trace Scheduling It identifies frequently executed traces in the program and treats the path as an extended basic block which is scheduled using a list scheduling approach.
  • Superblock Scheduling Superblocks are a subset of traces which have a single entry and multiple exit attributes (therefore they are traces without side exits). List scheduling is typically used to schedule the superblock.
  • Hyperblock Scheduling Excessive control flow can complicate scheduling, so this approach uses a technique called If-Conversion to remove conditional branches.
Read more »

LLVM IR notes

Basic constructs

Global variable
int variable = 21;
@variable = global i32 21

Globals are prefixed with the @ character. You can see that also functions, such as main, are also global variables in LLVM. LLVM views global variables as pointers; so you must explicitly dereference the global variable using the load instruction when accessing its value, likewise you must explicitly store the value of a global variable using the store instruction.

Read more »

Lpsolve tutorial

Problem formulation

Suppose a farmer has 75 acres on which to plant two crops: wheat and barley. To produce these crops, it costs the farmer (for seed, fertilizer, etc.) $120 per acre for the wheat and $210 per acre for the barley. The farmer has $15000 available for expenses. But after the harvest, the farmer must store the crops while awaiting favourable market conditions. The farmer has storage space for 4000 bushels. Each acre yields an average of 110 bushels of wheat or 30 bushels of barley. If the net profit per bushel of wheat (after all expenses have been subtracted) is $1.30 and for barley is $2.00, how should the farmer plant the 75 acres to maximize profit?

Mathmatically, we can formulate this as :

Maximize P = (110)(1.30)x + (30)(2.00)y = 143x + 60y
s.t.            
				120x + 210y <= 15000
                110x + 30y <= 4000
                x + y <= 75
                x >= 0, y >= 0
Read more »