ocapi maged attia([email protected]) ee213aspring 2000 prof. ingrid verbauwhede

19
OCAPI Maged Attia([email protected]) EE213A Spring 2000 http://www.imec.be/ ocpai/ Prof. Ingrid Verbauwhede

Upload: samantha-logan

Post on 17-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

OCAPI

Maged Attia([email protected])

EE213A Spring 2000

http://www.imec.be/ocpai/

Prof. Ingrid Verbauwhede

Page 2: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Agenda Introduction to OCAPI

Case Study: Complete Design Flow of FIR

Homework: Design of LFSR

(Wednesday)

(Friday)

(Friday)

Page 3: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Introduction to OCAPI

OCAPI vs. ART Designer How does OCAPI work? OCAPI Classes Design Cycle in OCAPI Compiling C++/OCAPI Introduction to the case study.

Outline

Page 4: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

OCAPI vs. ART DesignerOCAPI Art

Designer

csh> g++ file.cxx …

csh>

4) More flexible

1) C++ based 1) C/C++ based

2) Bit Parallel Arch.

2) Bit Parallel

4) More friendly

3) 3)

Page 5: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

How does OCAPI Work?

C++ CompilerAddMult

SubRam

qlib.h

OCAPIClasses

C++Description

include

Link

libqlib.a

Run

Page 6: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

OCAPI Classes: 1- Fixed Point

dfix a;

dfix a(0.25);

dfix a(0.25, 10 ,8);

dfix a(0.25, 10, 8, tc, st, rd);

tc: two’s complement ns: unsigned

wp: for wrap-around st: saturation

fl: for truncation rd: rounding

Default

Page 7: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

OCAPI Classes: 2- IN/OUT

TXa bqueue queue out.datin.dat

I O

dfix a;

FB I(“I”);

src a(“a”, I, “in.dat”);

dfix b;

FB O(“O”);

snk b(“b”, O, “out.dat”);

Page 8: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

OCAPI Classes: 3- Internal Signal

_sig a(“a”); plain signal with fl-p inside it

_sig b(“b”, dfix(0, 10, 8) plain signal with fx-p inside it

_sig k(0.5);

Clk ck; Registered signal C with initial

_sig c(“c”, ck , k); value k

Page 9: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

OCAPI Classes: 4- FSMctlfsm f; Creat FSM

F << “my_fsm” Give it a name

State rst;

State active;

Rst << “my_rst”;

Active << “my_active”

F << deflt(rst); Tell which one is the default

Active << allways << active;

Active << _cnd(a) << rst

Creat 2 states

Give them name

Transitions

Page 10: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Design Cycle in OCAPI1) Un-Timed Design

- Easy and fast to design

- Non implementable

- Real description

2) Timed Design

- Implementable

TX RXChannel

Timed TimedUn-Timed

Page 11: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Design cycle in OCAPI

C++

C++/OCAPI

C++/OCAPI

Refine

Refine

Non implementable

Fixed point EASY Description

!!!!!!

1) Un-timed Design

Word-length

Function Description

Page 12: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Design cycle in OCAPI

C++ Void add::add( int & in1

int & in2

int & out )

{ out = in1 + in2

return 0;

}

Void main()

{

Add Add(a, b, c);

}

Page 13: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Design cycle in OCAPI

C++/OCAPIRefine

Void add::add( dfix & in1 dfix & in2

dfix & out ){ if ( ( in1.getsize() <1) || (…..) ) { return 0;} out = in1.get() + in2.get() return 1;}

Void main()

{

Add Add(a, b, c);

}

Void main (){FB a(“a); …………….Src src1(“src1”, a, “src1”) ……..systgen S1(“S1”); S1 << src1; S1 << src2; S1.next << Add; ………..

Page 14: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Design cycle in OCAPI

C++/OCAPI

Everything is the same but:

instead of:

dfix

Use:

dfix ( , w, l, …)

Page 15: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Design cycle in OCAPI

C++

C++/OCAPI

C++/OCAPI

Refine

Refine

2) Timed Design

Word-length

Function Description

Auto

Page 16: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Design cycle in OCAPIFSM and FG

Void add::add( dfix & _in1 dfix & _in2

dfix & _out ){ ctrlfsm _fsm;Sfg _add;State _go;

_fsm << deflt(_go)_go << allways<< _add<<_go}

Void main (){FB a(“a”); …………….Src src1(“src1”, a, “src1”) ……..systgen S1(“S1”); S1 << src1; S1 << src2; S1.next << Add; ………..

Clk ck;

Int I;

For (I=0; I<3; I++) S1.run(clk)

Page 17: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Compiling C++/OCAPIC++

Page 18: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Compiling C++/OCAPI

C++

VHDL

C++/OCAPI

Page 19: OCAPI Maged Attia(mattia@ucla.edu) EE213ASpring 2000  Prof. Ingrid Verbauwhede

Introduction to the case study

Step 1: Specifications -> Coefficients

Step 2: Create floating point description for the whole system.

Step 3: Create fixed point description for the UPS and the FIR and refine for best word length

Step 4: Use that WL to create fx-p FSM description and run timed simulation to generate the VHDL code.