SlideShare uma empresa Scribd logo
1 de 21
Wildcard Match
Mayank Gupta and Rajpal Singh
0in FE Noida


March, 2012
Agenda

         Introduction
         Motivation
         New Flow
         Class Hierarchy




                                         © 2011 Mentor Graphics Corp. Company Confidential
2   Mayank, Wildcard Match, March 2012   www.mentor.com
Motivation

         Efficiently matching a regular expression in a RTL design.
         Use NELT to do matching.
             — Previous flow creates a separate data structure altogether to do
               matching.
             — Using NELT hierarchy would reduce memory usage.
         Enhance Functionality.




                                                       © 2011 Mentor Graphics Corp. Company Confidential
3   Mayank, Wildcard Match, March 2012                 www.mentor.com
New Flow

                                         • Tokenizing Pattern
                            Tokenize
                                         • Store it in appropriate Data structure



                                         • Start matching on NELT.
                            Match on
                             NELT


                                         • Do matching on UTG.
                                         • For Record/Arrays.
                            Match on
                              UTG




                                                                        © 2011 Mentor Graphics Corp. Company Confidential
4   Mayank, Wildcard Match, March 2012                                  www.mentor.com
New Flow

    STEP 1 : Tokenize wildcard


    Eg : Wildcard is ―a*.b*.*.*c*‖


                 a*                  b*   *   *c*




                                                    © 2011 Mentor Graphics Corp. Company Confidential
5   Mayank, Wildcard Match, March 2012              www.mentor.com
New Flow

    STEP 2 : Start matching nodes in NELT


    -     Match current token with top‘s children                       top

                                                   a1                                                        b1
     a*             b*            *      *c*
                                               a    aa            b2                             b                c1

                                                           b                   c1
                                                                                                                  c
                                                                                C



                                                         © 2011 Mentor Graphics Corp. Company Confidential
6   Mayank, Wildcard Match, March 2012                   www.mentor.com
New Flow

    -     Match ―b*‖ with children of a1

                                                                       top

                                                   a1                                                       b1

                                               a   aa            b2
        a*           b*             *    *c*                                                    b                c1

                                                          b                   c1
                                                                                                                 c
                                                                               C



                                                        © 2011 Mentor Graphics Corp. Company Confidential
7   Mayank, Wildcard Match, March 2012                  www.mentor.com
New Flow

    -     Match ―*‖ with children of b2

                                                                       top

                                                   a1                                                       b1

                                               a   aa            b2                             b                c1

        a*           b*             *    *c*              b                   c1
                                                                                                                 c
                                                                               c



                                                        © 2011 Mentor Graphics Corp. Company Confidential
8   Mayank, Wildcard Match, March 2012                  www.mentor.com
New Flow

    -     Match ―*c*‖ and ―*‖ with children of c1

                                                                           top

                                                       a1                                                       b1

                                                   a   aa            b2                             b                c1

        a*           b*             *        *c*              b                   c1
                                                                                                                     c
                                                                                   c
        a*            b*                 *   *c*
                                                                        Final Match
                                                            © 2011 Mentor Graphics Corp. Company Confidential
9   Mayank, Wildcard Match, March 2012                      www.mentor.com
New Flow

          Step 3 : Match on UTG hierarchy

              — If we hit a record/Array/Subtype we match using UTG
                Hierarchy.




                                                     © 2011 Mentor Graphics Corp. Company Confidential
10   Mayank, Wildcard Match, March 2012              www.mentor.com
Why match using UTG?

          Because we do not create NELT for record symbols.

                                                    top



                                          a1        b1                                    Record1



                              a                b2   b       Record2                  f1                      f2


                                               b          f21            f22


                                                            No NELT for this portion

          Hence we use UTG for matching inside records.
                                                                © 2011 Mentor Graphics Corp. Company Confidential
11   Mayank, Wildcard Match, March 2012                         www.mentor.com
Tokenizing a wildcard

          A token can be of two types :
            — String Token
            — Star Token                                         TokenBase

          Star token is simply a ‗*‘
          String token is anything other     StringToken                                    StarToken
           than ‗*‘
          Eg : ―a*.b*.*.*c*‖
            — String Tokens are a*,b*,*c*             Class Hierarchy
            — Star token is only 1 here - *




                                                 © 2011 Mentor Graphics Corp. Company Confidential
12   Mayank, Wildcard Match, March 2012          www.mentor.com
How to do Hierarchical Match?

          How we ensure that we match
           hierarchy in case of ‗*‘
                                                                    Star Token
          There are two types of ‗*‘
            — Local Match Star
            — Hierarchical Match Star          Local Match Star
                                                                                               Hierarchical
                                                                                               Match Star

          Local Star matches only the
           nodes at current level               Two types of ‗*‘ in regex
          Hierarchical Star matches all the
           nodes at current and lower level.




                                                    © 2011 Mentor Graphics Corp. Company Confidential
13   Mayank, Wildcard Match, March 2012             www.mentor.com
How to do Hierarchical Match?

     Example.
          If pattern is ―a*.b*.*.*c*‖
                                                                                       Star Token


          It will be converted to                                                                                Hierarchical
                                                                  Local Match Star
                                                                                                                  Match Star
         a*        H*        b*           H*   L*   H*   *c* H*

                                                                   Two types of ‗*‘ in regex




                                                                       © 2011 Mentor Graphics Corp. Company Confidential
14   Mayank, Wildcard Match, March 2012                                www.mentor.com
Organizing Tokens

          Class NeltTokenArray contains
              — vector<TokenBase*>                               a*            b*                    *                      *c*

          Class NeltTokenIndex contains
            — NeltTokenArray*                                          a*      b*             *               *c*
            — Index (current token)
                                                                       Index
          Class NeltRegexExpr contains
            — Vector<NeltTokenIndex*>

         a*       b*         *            *c*   a*      b*   *   *c*        a*          b*          *           *c*
         Index                                  Index                       Index




                                                                               © 2011 Mentor Graphics Corp. Company Confidential
15   Mayank, Wildcard Match, March 2012                                        www.mentor.com
Manager Classes

          Class NeltRegexMgr is used to match on NELT.
          Class NeltUtgRegexMgr is used to match on UTG .
          It is the responsibility of NeltRegexMgr to invoke NeltUtgRegexMgr.




                                                      © 2011 Mentor Graphics Corp. Company Confidential
16   Mayank, Wildcard Match, March 2012               www.mentor.com
C++ classes

          NeltRegexMgr                     NeltTraverse                        NeltUtgTypeTraverse
              — NeltTraverse
          NeltUtgRegexMgr
                                            NeltRegexMgr                            NeltUtgRegexMgr
              — NeltTypeTraverse
          NeltRegexExpr
          NeltTokenIndex                 NeltTokenIndex                                    TokenBase
              — NeltUtgTokenIndex
          NeltTokenArray                 NeltUtgTokenIndex              StringToken                              StarToken
          TokenBase
              — StringToken
              — StarToken



                                                              © 2011 Mentor Graphics Corp. Company Confidential
17   Mayank, Wildcard Match, March 2012                       www.mentor.com
Source Code

          Source files
              — src/commonpp/nelt
                        –   neltRegexMgr.cxx
                        –   neltRegexMgr.hxx
                        –   neltUtgRegexMgr.cxx
                        –   neltUtgRegexMgr.hxx
                        –   neltRegexUtils.cxx
                        –   neltRegexUtils.hxx




                                                  © 2011 Mentor Graphics Corp. Company Confidential
18   Mayank, Wildcard Match, March 2012           www.mentor.com
Performance data

                S.No                Test Case   Old Flow Time(s)      New Flow Time(s)
                    1             Parme         161                   484
                    2             Oracle        1814                  1658




                                                              © 2011 Mentor Graphics Corp. Company Confidential
19   Mayank, Wildcard Match, March 2012                        www.mentor.com
Future Work

          Add a new class SliceToken deriving from TokenBase to
           store tokens of the form tok[slice]
          Avoid duplicate matching
              — Eg : ―a*.a*b‖ is expanded into two patterns :
                1) a*.H*.a*b
                2) a*.H*.a*.H*.*b

                    Both the patterns have ―a*.H*‖ in the beginning and hence it gets
                    matched twice.




                                                           © 2011 Mentor Graphics Corp. Company Confidential
20   Mayank, Wildcard Match, March 2012                    www.mentor.com
www.mentor.com




                                                       © 2011 Mentor Graphics Corp. Company Confidential
21   Mayank, Wildcard Match, March 2012                www.mentor.com

Mais conteúdo relacionado

Mais procurados

1362 1363 1352 1353 ball valve with elect and pneu actuator
1362 1363 1352 1353 ball valve with elect and pneu actuator1362 1363 1352 1353 ball valve with elect and pneu actuator
1362 1363 1352 1353 ball valve with elect and pneu actuatorChaitannya Mahatme
 
Greg Lollback_Variation in biomass estimation among replicated PPBio PTER plo...
Greg Lollback_Variation in biomass estimation among replicated PPBio PTER plo...Greg Lollback_Variation in biomass estimation among replicated PPBio PTER plo...
Greg Lollback_Variation in biomass estimation among replicated PPBio PTER plo...TERN Australia
 
Ball spline
Ball splineBall spline
Ball splineochiba
 
Acordes piano
Acordes pianoAcordes piano
Acordes pianocmusica
 
Tajmahal e a4
Tajmahal e a4Tajmahal e a4
Tajmahal e a4paciffic
 

Mais procurados (6)

1362 1363 1352 1353 ball valve with elect and pneu actuator
1362 1363 1352 1353 ball valve with elect and pneu actuator1362 1363 1352 1353 ball valve with elect and pneu actuator
1362 1363 1352 1353 ball valve with elect and pneu actuator
 
Greg Lollback_Variation in biomass estimation among replicated PPBio PTER plo...
Greg Lollback_Variation in biomass estimation among replicated PPBio PTER plo...Greg Lollback_Variation in biomass estimation among replicated PPBio PTER plo...
Greg Lollback_Variation in biomass estimation among replicated PPBio PTER plo...
 
Ball spline
Ball splineBall spline
Ball spline
 
Metrics
MetricsMetrics
Metrics
 
Acordes piano
Acordes pianoAcordes piano
Acordes piano
 
Tajmahal e a4
Tajmahal e a4Tajmahal e a4
Tajmahal e a4
 

Último

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Último (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

Wildcard expansion

  • 1. Wildcard Match Mayank Gupta and Rajpal Singh 0in FE Noida March, 2012
  • 2. Agenda  Introduction  Motivation  New Flow  Class Hierarchy © 2011 Mentor Graphics Corp. Company Confidential 2 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 3. Motivation  Efficiently matching a regular expression in a RTL design.  Use NELT to do matching. — Previous flow creates a separate data structure altogether to do matching. — Using NELT hierarchy would reduce memory usage.  Enhance Functionality. © 2011 Mentor Graphics Corp. Company Confidential 3 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 4. New Flow • Tokenizing Pattern Tokenize • Store it in appropriate Data structure • Start matching on NELT. Match on NELT • Do matching on UTG. • For Record/Arrays. Match on UTG © 2011 Mentor Graphics Corp. Company Confidential 4 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 5. New Flow STEP 1 : Tokenize wildcard Eg : Wildcard is ―a*.b*.*.*c*‖ a* b* * *c* © 2011 Mentor Graphics Corp. Company Confidential 5 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 6. New Flow STEP 2 : Start matching nodes in NELT - Match current token with top‘s children top a1 b1 a* b* * *c* a aa b2 b c1 b c1 c C © 2011 Mentor Graphics Corp. Company Confidential 6 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 7. New Flow - Match ―b*‖ with children of a1 top a1 b1 a aa b2 a* b* * *c* b c1 b c1 c C © 2011 Mentor Graphics Corp. Company Confidential 7 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 8. New Flow - Match ―*‖ with children of b2 top a1 b1 a aa b2 b c1 a* b* * *c* b c1 c c © 2011 Mentor Graphics Corp. Company Confidential 8 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 9. New Flow - Match ―*c*‖ and ―*‖ with children of c1 top a1 b1 a aa b2 b c1 a* b* * *c* b c1 c c a* b* * *c* Final Match © 2011 Mentor Graphics Corp. Company Confidential 9 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 10. New Flow  Step 3 : Match on UTG hierarchy — If we hit a record/Array/Subtype we match using UTG Hierarchy. © 2011 Mentor Graphics Corp. Company Confidential 10 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 11. Why match using UTG?  Because we do not create NELT for record symbols. top a1 b1 Record1 a b2 b Record2 f1 f2 b f21 f22 No NELT for this portion  Hence we use UTG for matching inside records. © 2011 Mentor Graphics Corp. Company Confidential 11 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 12. Tokenizing a wildcard  A token can be of two types : — String Token — Star Token TokenBase  Star token is simply a ‗*‘  String token is anything other StringToken StarToken than ‗*‘  Eg : ―a*.b*.*.*c*‖ — String Tokens are a*,b*,*c* Class Hierarchy — Star token is only 1 here - * © 2011 Mentor Graphics Corp. Company Confidential 12 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 13. How to do Hierarchical Match?  How we ensure that we match hierarchy in case of ‗*‘ Star Token  There are two types of ‗*‘ — Local Match Star — Hierarchical Match Star Local Match Star Hierarchical Match Star  Local Star matches only the nodes at current level Two types of ‗*‘ in regex  Hierarchical Star matches all the nodes at current and lower level. © 2011 Mentor Graphics Corp. Company Confidential 13 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 14. How to do Hierarchical Match? Example.  If pattern is ―a*.b*.*.*c*‖ Star Token  It will be converted to Hierarchical Local Match Star Match Star a* H* b* H* L* H* *c* H* Two types of ‗*‘ in regex © 2011 Mentor Graphics Corp. Company Confidential 14 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 15. Organizing Tokens  Class NeltTokenArray contains — vector<TokenBase*> a* b* * *c*  Class NeltTokenIndex contains — NeltTokenArray* a* b* * *c* — Index (current token) Index  Class NeltRegexExpr contains — Vector<NeltTokenIndex*> a* b* * *c* a* b* * *c* a* b* * *c* Index Index Index © 2011 Mentor Graphics Corp. Company Confidential 15 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 16. Manager Classes  Class NeltRegexMgr is used to match on NELT.  Class NeltUtgRegexMgr is used to match on UTG .  It is the responsibility of NeltRegexMgr to invoke NeltUtgRegexMgr. © 2011 Mentor Graphics Corp. Company Confidential 16 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 17. C++ classes  NeltRegexMgr NeltTraverse NeltUtgTypeTraverse — NeltTraverse  NeltUtgRegexMgr NeltRegexMgr NeltUtgRegexMgr — NeltTypeTraverse  NeltRegexExpr  NeltTokenIndex NeltTokenIndex TokenBase — NeltUtgTokenIndex  NeltTokenArray NeltUtgTokenIndex StringToken StarToken  TokenBase — StringToken — StarToken © 2011 Mentor Graphics Corp. Company Confidential 17 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 18. Source Code  Source files — src/commonpp/nelt – neltRegexMgr.cxx – neltRegexMgr.hxx – neltUtgRegexMgr.cxx – neltUtgRegexMgr.hxx – neltRegexUtils.cxx – neltRegexUtils.hxx © 2011 Mentor Graphics Corp. Company Confidential 18 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 19. Performance data S.No Test Case Old Flow Time(s) New Flow Time(s) 1 Parme 161 484 2 Oracle 1814 1658 © 2011 Mentor Graphics Corp. Company Confidential 19 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 20. Future Work  Add a new class SliceToken deriving from TokenBase to store tokens of the form tok[slice]  Avoid duplicate matching — Eg : ―a*.a*b‖ is expanded into two patterns : 1) a*.H*.a*b 2) a*.H*.a*.H*.*b Both the patterns have ―a*.H*‖ in the beginning and hence it gets matched twice. © 2011 Mentor Graphics Corp. Company Confidential 20 Mayank, Wildcard Match, March 2012 www.mentor.com
  • 21. www.mentor.com © 2011 Mentor Graphics Corp. Company Confidential 21 Mayank, Wildcard Match, March 2012 www.mentor.com