Title: Introduction to VLSI Programming Lecture 6: Resource sharing
1Introduction to VLSI Programming Lecture 6
Resource sharing
- (course 2IN30)
- Prof. dr. ir.Kees van Berkel
-
2Time table 2005
3Lecture 6
- Outline
- Recapitulation of Lecture 5
- Sharing of sequentially-used resources
- commands
- auxiliary variables
- expressions and operators
- Lab work assignment GCD
4Tangram
- Purpose programming language for asynchronous
VLSI circuits. - Creator Tangram team _at_ Philips Research Labs
(proto-Tangram 1986 release 2 in 1998). - Inspiration Hoares CSP, Dijkstras GCL.
- Lectures no formal introduction manual hand-out
(learn by example, learn by doing). - Main tools compiler, analyzer, simulator, viewer.
5VLSI programming of asynchronous circuits
behavior, area, time, energy, test coverage
Tangram program
feedback
compiler
simulator
Handshake circuit
expander
Asynchronous circuit
(netlist of gates)
6VLSI programming for
- Low costs
- introduce resource sharing.
- Low delay (high throughput)
- introduce parallelism.
- Low energy (low power)
- reduce activity
7VLSI programming for low costs
- Keep it simple!!
- Introduce resource sharing commands, auxiliary
variables, expressions, operators. - Enable resource sharing, by
- reducing parallelism
- making similar commands equal
8Command sharing
P proc(). S P() P()
9Command sharing example
ax proc(). a?x ax() ax()
10Two-place wagging buffer
byte type 0..255 wag2 main
proc(a?chan byte b!chan byte).begin
x,y var byte ax proc(). a?x ax()
forever do (a?y b!x) (ax()
b!y) odend
11Procedure definition vs declaration
- Procedure definition P proc (). S
- provides a textual shorthand (expansion)
- each call generates copy of resource, i.e. no
sharing - Procedure declaration P proc (). S
- defines a sharable resource
- each call generates access to this resource
12Command sharing
- Applies only to sequentially used commands.
- Saves resources, almost always(i.e. when command
is more costly than a mixer). - Impact on delay and energy often favorable.
- Introduced by means of procedure declaration.
- Makes Tangram program less well readable.
Therefore, apply after program is
correct sound. - Should really be applied by compiler.
13Sharing of auxiliary variables
- xE is an auto assignment when E depends on x.
This is compiled as auxE x aux ,
where aux is a fresh auxiliary
variable. - With multiple auto assignments to x, as in
- xE ... xF
- auxiliary variables can be shared, as in
- auxE aux2x() ... auxF aux2x()
with aux2x() proc(). xaux
14Expression sharing
f func(). E xf() a!f()
e0
e1
15Expression sharing
- Applies only to sequentially used expressions.
- Often saves resources, (i.e. when expression is
more costly than the demultiplexer). - Introduced by means of function declarations.
- Makes Tangram program less well readable.
Therefore apply after program is
correct sound. - Should really be applied by compiler.
16Operator sharing
- Consider x0 y0z0 x1 y1z1 .
- Operator can be shared by introducing
- add func(a,b? var T) T. ab
-
- and applying it as in x0 add(y0, z0)
x1 add(y1,z1) .
17Operator sharing the costs
- Operator sharing may introduce multiplexers to
(all) inputs of the operator and a demultiplexer
to its output. - This form of sharing only reduces costs when
- operator is expensive,
- some input(s) and/or output are common.
18Operator sharing example
- Consider x yz0 x yz1 .
- Operator can be shared by introducingadd2y
proc(b? var T). xyb -
- and applying it as inadd2y(z0) add2y(z1) .
19Making similar equal example
- Consider x yz x y-z .
- Use y-z y bitwise_complement(z) 1
- condinv func (fbool xint8) int8. ?f ? x
f ? bwc(x) - begin yval x cast bool8
- ltltfy.0,fy.1,fy.2,fy.3,fy.4,fy.5,fy.6,fy
.7gtgt cast int8 - end
- addsub func (fbool xint8 yint8) int9.
?f ? xy f ? x-y - (ltltf,xgtgt cast int9 ltltf,condinv(f, y)gtgt cast
int9) cast ltltbool,int9gtgt.1
20Greatest Common Divisor
- gcd main proc (ab?chan ltltbyte,bytegtgt c!chan
byte).begin x,y var byte forever do
ab?ltltx,ygtgt do xlty then y y-x or
xgty then x x-y od c!x odend
21Assigment 3 make GCD smaller
- Both assignments (y y-x and x x-y) are auto
assignments and hence require an auxiliary
variable. - Program requires 4 arithmetic resources (twice lt
and ) . - Reduce costs of GCD by saving on auxiliary
variables and arithmetic resources. (Beware the
costs of multiplexing!) - Use of ff variables not allowed for this
exercise.
22Lab-work and report
- You are allowed to team up with a colleague.
- Report
- more than listing of functional Tangram
programs - analyze the specifications and requirements
- present design options, alternatives, trade-offs
- motivate your design choices
- explain functional correctness of your Tangram
programs - analyze explain area, time, energy of your
programs.
23Next week lecture 7
- Outline
- Introduction to the DLX processor.
- Introduction to Tangram version of a sub-set DLX
(executing a software GCD). - Lab work extend instruction set of Tangram DLX
and reduce its costs.