oascript & oadebug - si2 · 2 oascript news 6/7/13 openaccess api c++ programming interface eda...

45
1 oaScript & oaDebug Kevin Nesmith Lead Engineer, Si2 June 7, 2013

Upload: others

Post on 27-Mar-2020

150 views

Category:

Documents


9 download

TRANSCRIPT

1

oaScript & oaDebug

Kevin Nesmith Lead Engineer, Si2

June 7, 2013

2

oaScript News

6/7/13

OpenAccess API C++ Programming Interface

EDA Programmer Centric

•  Version 2.0 available under the new ESG approved license –  Allows for custom C++ extensions. –  64 bit binaries for each language.

•  Windows version in development under the Silicon Photonics TAB •  10 OA labs ported from C++ to support all 4 scripting languages

–  Provides training to design engineers who operate at the scripting interface

Perl API

Type Mapping

Ruby API

Type Mapping

Tcl API

Type Mapping

Python API

Type Mapping Common Wrapper Architecture Interface

Language-Specific Bindings

Common SWIG Framework

Chip Designer Centric

3 6/7/13

oaScript Support

OpenAccess Streams •  oa22.04 – gcc-4.2.2 64bit •  oa22.41 – gcc-4.4.3 64bit •  oa22.43 – gcc-4.4.3 64bit Linux •  RHEL 4.8 •  RHEL 5 •  SLES 10 •  SLES 11 Perl 5.8.1 – 5.10.1 Python 2.5.1 – 2.7.3 Ruby 1.8 – 1.9 Tcl 8.4 – 8.6

oaScript is currently supported on…

4 6/7/13

oasPython Example This simple scripting language demo will show how to use oasPython to open a library and create a simple design with two nets.

5 6/7/13

oasPython Example Shell environment variables need by oaScript

perl: linux> export =/opt/oaScript/perl5

ruby: linux> export =/opt/oaScript/ruby

tcl: linux> export =/opt/oaScript/tcl

python: linux> export =/opt/oaScript/python2

LD_LIBRARY_PATH specifies the path to the OA libraries: linux> export =/opt/oa22.43p004/lib/linux_rhel50_gxx44_64/opt

6 6/7/13

oasPython Example Unsupported Platforms

Often times the need arises to run OA/oaScript on an unsupported platform such as Fedora 17.

Fedora 17: The user will still need to specify the path to the OA libraries:

linux> export =/opt/oa22.43p004/lib/linux_rhel50_gcc44x_64/opt

Important The user will need to tell OA which platform to substitute:

linux> export =linux_rhel50_gcc44x

7 6/7/13

oasPython Example Using the python interpreter to create a library:

linux> export PYTHONPATH=/opt/oaScript/python2 linux> export LD_LIBRARY_PATH=/opt/oa22.43p004/…/opt linux> export OA_UNSUPPORTED_PLAT=linux_rhel50_gcc44x

linux> python ���Python 2.7.3 (default, Jul 24 2012, 10:05:38) >>> import oa >>> oa.oaLib.create("designLib", "./designLibOnDisk") <Swig Object of type 'OpenAccess_4::oaLib *' at 0x7feace8141f0> >>> quit()

linux> ls -ld designLibOnDisk drwxrwxr-x. 2 me user 4096 May 28 12:12 designLibOnDisk

8 6/7/13

oasPython Example Create a lib.defs (library definition) file:

The lib.defs file associates logical library names used by tools with physical locations on disks.

DEFINE  designLib      ./designLibOnDisk  lib.defs

The lib.defs file is a text file. It can be created and managed by OpenAccess functions, OR it can be created and edited in your favorite text editor. For our simple example, it is made in the editor.

9 6/7/13

oasPython Example The “DEFINE” statement specifies the mapping between a logical

library name and its physical location on disk.

DEFINE        lib.defs

The library’s logical name is “designLib”. The library’s physical location is “./designLibOnDisk”.

10 6/7/13

oasPython Example The OpenAccess API looks for a lib.defs file in 1.  The current directory 2.  The home directory 3.  <oaInstallDir>/data/libraries directory

DEFINE  designLib      ./designLibOnDisk  lib.defs

11 6/7/13

oasPython Example Creating an example design script:

#!/usr/bin/env  python  

makeDesign.py

Execute  as  a  python  script.  

12 6/7/13

oasPython Example Creating an example design script:

#!/usr/bin/env  python  

import  sys  import  oa  

makeDesign.py

Import  the  system  uAlity  and  oa  modules.  

13 6/7/13

oasPython Example Creating an example design script:

#!/usr/bin/env  python  

import  sys  import  oa  

oa.oaDesignInit()  

makeDesign.py

“import  oa”  calls  oaDesignInit()  

automaAcally,  so  this  isn’t  needed  

14 6/7/13

oasPython Example Creating an example design script:

#!/usr/bin/env  python  

import  sys  import  oa  

oa.oaLibDefList.openLibs()  

makeDesign.py

Read  the  lib.defs  file,  which  maps  logical  names  to  physical  locaAons.  

15 6/7/13

oasPython Example Creating an example design script:

#!/usr/bin/env  python  

import  sys  import  oa  

oa.oaLibDefList.openLibs()  vt=oa.oaViewType.get(“netlist”)  

makeDesign.py

viewType  must  be  specified  to  

create  a  design.  

16 6/7/13

oasPython Example Creating an example design script:

import  sys  import  oa  

oa.oaLibDefList.openLibs()  vt=oa.oaViewType.get(“netlist”)  

des=oa.oaDesign.open(“designLib”,              “myCell”,            “myView”,              vt,              ‘w’)  

makeDesign.py Open  a  design  with  logical,  cell,  and  view  names,  viewType,  and  write  mode.  

17 6/7/13

oasPython Example Creating an example design script:

oa.oaLibDefList.openLibs()  vt=oa.oaViewType.get(“netlist”)  

des=oa.oaDesign.open(“designLib”,              “myCell”,            “myView”,              vt,              ‘w’)  

block=oa.oaBlock.create(des)  

makeDesign.py

The  block  holds  a  physical  

descripAon  of  the  design.  

18 6/7/13

oasPython Example Creating an example design script:

des=oa.oaDesign.open(“designLib”,              “myCell”,            “myView”,              vt,              ‘w’)  

block=oa.oaBlock.create(des)  

oa.oaScalarNet.create(block,          “net1”)  

makeDesign.py

This  creates  the  1st  net,  “net1”.  

19 6/7/13

oasPython Example Creating an example design script:

block=oa.oaBlock.create(des)  

oa.oaScalarNet.create(block,          “net1”)  

oa.oaScalarNet.create(block,          “net2”)  

makeDesign.py

This  creates  the  2nd  net,  “net2”.  

20 6/7/13

oasPython Example Creating an example design script:

block=oa.oaBlock.create(des)  

oa.oaScalarNet.create(block,          “net1”)  

oa.oaScalarNet.create(block,          “net2”)  

for  net  in  (block.getNets()):          print  “net  in  block:  %s”  %  (net.getName())  

makeDesign.py

This  iterates  over  the  collecAon  of  nets  in  the  block.  

21 6/7/13

oasPython Example Creating an example design script:

block=oa.oaBlock.create(des)  

oa.oaScalarNet.create(block,          “net1”)  

oa.oaScalarNet.create(block,          “net2”)  

for  net  in  (block.getNets()):          print  “net  in  block:  %s”  %  (net.getName())  

makeDesign.py

This  prints  each  net’s  name  in  the  

collecAon.  

22 6/7/13

oasPython Example Creating an example design script:

oa.oaScalarNet.create(block,          “net1”)  

oa.oaScalarNet.create(block,          “net2”)  

for  net  in  (block.getNets()):          print  “net  in  block:  %s”  %  (net.getName())  

des.save()  

makeDesign.py

This  saves  the  design  to  the  disk.  

23 6/7/13

oasPython Example Creating an example design script:

oa.oaScalarNet.create(block,          “net2”)  

for  net  in  (block.getNets()):          print  “net  in  block:  %s”  %  (net.getName())  

des.save()  

des.close()  

makeDesign.py

This  closes  the  design.  

24 6/7/13

oasPython Example Running the makeDesign.py script:

Don’t forget your environment variables…

linux> export PYTHONPATH=/opt/oaScript/python2 linux> export LD_LIBRARY_PATH=/opt/oa22.43p004/…/opt linux> export OA_UNSUPPORTED_PLAT=linux_rhel50_gcc44x

Make sure you have the script, library, and lib.defs file in the current directory.

linux> ls lib.defs makeDesign.py designLibOnDisk

You may need to make your file executable… linux> chmod +x makeDesign.py

25 6/7/13

oasPython Example Running the makeDesign.py script:

Execute the script…

linux> ./makeDesign.py net in block: net1 net in block: net2

NoAce:  this  is  our  expected  output.  

26 6/7/13

#include <iostream> #include "oaDesignDB.h“

int main(int argc, char *argv[]) {

oa::oaDesignInit(); oa::oaLibDefList::openLibs(); oa::oaNativeNS nns;

oa::oaScalarName slib(nns, argv[1]); oa::oaScalarName scell(nns, argv[2]); oa::oaScalarName sview(nns, argv[3]);

oa::oaDesign *design = oa::oaDesign::open(slib, scell, sview, 'r'); oa::oaBlock *block = design->getTopBlock(); oa::oaIter<oaNet> iter(block->getNets()); while (oa::oaNet *net = iter.getNext()) { oa::oaString str; net->getName(nns,str); std::cout << str << std::endl; } }

C++ Dump Nets

27 6/7/13

Python Dump Nets

import sys import oa

oa.oaLibDefList.openLibs()

design = oa.oaDesign.open(sys.argv[1], sys.argv[2], sys.argv[3], ‘r’) block = design.getTopBlock()

for net in block.getNets(): print net.getName()

28 6/7/13

oaDebug Example Let’s look at our design library with oaDebug:

Executing oaDebug from the same directory will allow it to read the same lib.defs file…

linux> <path_to_oaDebug>/si2oadebug

By default, this will start a Firefox browser and show you…

29 6/7/13

oaDebug Example

NoAce:  this  is  our  library.  

30 6/7/13

oaDebug Example

NoAce  all  the  references  to  

where  you  are  in  the  design.  

31 6/7/13

oaDebug Example

To  save  on  memory,  designs  are  not  shown  

unAl  you  “BIND”.  

32 6/7/13

oaDebug Example

Once  you  “BIND”,  a  new  browser  window  opens  containing  the  

design.  

33 6/7/13

oaDebug Example

NoAce  the  oaBlock  within  the  oaDesign.    Under  oaBlock,  you  will  find  your  nets.  

34 6/7/13

oaDebug Example

Under  nets  you  can  see  that  you  have  a  total  count  of  2.  

35 6/7/13

oaDebug Example

Here  you  have  your  net1  and  net2.  

36 6/7/13

oaDebug Example

Under  each  net,  you  will  find  all  of  it’s  properAes  and  members.  

37 6/7/13

oaDebug Example

NoAce  that  OpenAccess  specific  classes  in  blue  are  right  mouse  click  hyperlinks  directed  to  the  OpenAccess  

Docs.  

38 6/7/13

Si2 oaDebugging Suite Check out Si2’s other debug programs. •  si2oadebug •  si2oadiff

  diff any 2 designs •  si2oaforensics

  Checks for GLIBCXX compatibility   Release Build Name   Internal Build Name   Libraries’ Build Info   Data Model Rev   API Minor Rev   Platform Name   Wafer Support   Data Compression Support   Scratch Design Support

39 6/7/13

OpenAccess Recent Progress

Recent Releases of OpenAccess •  oa22.41 Stream

•  p031 Released May 14, 2013 •  p029 Released January 28, 2013

•  oa22.43 Stream •  p014 Released April 24, 2013 •  p010 Released February 20, 2013

40

OpenAccess News

6/7/13

The new ESG v2.0 License has been approved! •  Sign Once / Use Many model.

String/Name Table Capacity Increase •  Due in 2013.

END of LIFE coming January 1, 2014: •  oa22.04 Stream •  oa22.42 Stream

41

oaScript 2.0 NOW AVAILABLE TO ALL SI2

MEMBERS!

UNDER THE ESG LICENSE v2.0.

6/7/13

42

Si2 oaDebugging Suite ALWAYS AVAILABLE TO

EVERYONE!

FREE, AS IN “GRATIS”! UNDER THE APACHE 2.0 LICENSE.

6/7/13

43

For More Information

6/7/13

oaScript Users Wiki http://www.oascript.org

README notes for the oaScript releases https://www.si2.org/openeda.si2.org/project/shownotes.php?release_id=563

OpenAccess Documentation and Training Si2 OpenAccess Online Course https://www.si2.org/?page=414

Si2 OpenAccess Tutorial and Labs https://www.si2.org/openeda.si2.org/projects/si2oatools

OpenAccess Online Docs https://www.si2.org/openeda.si2.org/si2_online/oa_online_info.php

44

For More Information

6/7/13

Si2 oaDebugging Suite https://www.si2.org/openeda.si2.org/projects/si2oadebug

OpenAccess Documentation and Training Si2 OpenAccess Online Course https://www.si2.org/?page=414

Si2 OpenAccess Tutorial and Labs https://www.si2.org/openeda.si2.org/projects/si2oatools

OpenAccess Online Docs https://www.si2.org/openeda.si2.org/si2_online/oa_online_info.php

45

THANK YOU!

6/7/13