Presentation for beginners

What is PyGears ?
PyGears is a hardware description language (HDL) implemented as a Python
library focused on:
Functional programming
Module composition
Synchronization
2
Whats so functional about it ?
Function Module Gear
3
Whats so functional about it ?
ƒ
1
= A + B
ƒ
2
= A * C
ƒ
3
= ƒ
2
ƒ
1
= (A + B) * C
@gear
def add_and_mul (a, b, c):
return add(a, b) | mult(c)
@gear
def add (a, b):
return a + b
@gear
def mult (a, c):
return a * c
4
Is composition really that easy in PyGears ?
Mandatory flow control makes interfacing modules look less like signal wave
generation and more like passing data to function.
The main idea behind standardized interfaces is to provide easy composition of
the modules. Modules (gears) try to push this standardization all the way down
to the basic building blocks like: counters, MUXs and FIFOs.
@gear
def f4(input):
return input | f1 | f2 | f3
5
Why is synchronization important in PyGears ? - 1
This interface is also known as DTI (Data Transfer Interface), simple
synchronous, flow-controlled interface.
DTI connects two gears, one which sends the data and the other one which
receives it, called Producer and Consumer respectively.
Clock is implicitly defined, its globally synchronous and user don’t have to worry about
adding it, compiler will take care of it
6
Why is synchronization important in PyGears ? - 2
The main idea behind standardized interfaces is to provide easy composition of the modules. These
interfaces: AXI, Avalon, etc., have been used so far to compose large modules written in RTL called
IPs, and they are popular for developing SoCs (System on chip). Gears tries to push this
standardization all the way down to the basic building blocks like: counters, MUXs and FIFOs.
Gears proposes the use of a single interface type for gear communication, called DTI (Data Transfer
Interface), throughout the design. Interface connects two gears, one which sends the data and the
other one which receives it, called Producer and Consumer respectively. This interface DTI is a simple
synchronous, flow-controlled interface, somewhat similar to AXI4-Stream, consisting of the following
three signals:
Data - Variable width signal, driven by the Producer, which carries the actual data.
Valid - Single bit wide signal, driven by the Producer, which signals when valid data is available
on Data signal.
Ready - Single bit wide signal, driven by the Consumer, which signals when the data provided by
the Producer has been consumed.
7
Ways to create function = module = gear
8