ocapi maged attia(mattia@ucla.edu) ee213aspring 2000 prof. ingrid verbauwhede

Post on 17-Jan-2016

214 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

OCAPI

Maged Attia(mattia@ucla.edu)

EE213A Spring 2000

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

Prof. Ingrid Verbauwhede

Agenda Introduction to OCAPI

Case Study: Complete Design Flow of FIR

Homework: Design of LFSR

(Wednesday)

(Friday)

(Friday)

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

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)

How does OCAPI Work?

C++ CompilerAddMult

SubRam

qlib.h

OCAPIClasses

C++Description

include

Link

libqlib.a

Run

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

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”);

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

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

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

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

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);

}

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; ………..

Design cycle in OCAPI

C++/OCAPI

Everything is the same but:

instead of:

dfix

Use:

dfix ( , w, l, …)

Design cycle in OCAPI

C++

C++/OCAPI

C++/OCAPI

Refine

Refine

2) Timed Design

Word-length

Function Description

Auto

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)

Compiling C++/OCAPIC++

Compiling C++/OCAPI

C++

VHDL

C++/OCAPI

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.

top related