1 / 29

Introducing Specman

Aarthi Nadarajan . Introducing Specman . Interns – Basic Intro . Language “e” The ‘e’ Language has constructs necessary for verification automation Specman Elite is the tool from Verisity (now Cadence) that simulates ‘e’ code stand-alone or also with HDL simulator . What is Specman ?.

yuval
Télécharger la présentation

Introducing Specman

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aarthi Nadarajan Introducing Specman Interns – Basic Intro

  2. Language “e” The ‘e’ Language has constructs necessary for verification automation Specman Elite is the tool from Verisity (now Cadence) that simulates ‘e’ code stand-alone or also with HDL simulator What is Specman ?

  3. High Extensibility All common procedural actions No complex pointer arithmetic Automated memory management Predefined data structures ‘e’ as a Programming Language

  4. A sample verification environment

  5. What are structs What are units Code Structure Basic ‘e’ Language Getting Started Interns – Basic Intro

  6.     Structs are dynamic objects and created on the fly when you want to use it and are usually destroyed by garbage collection mechanism. Units are static objects which stay alive from start to end . They are generated at simulation zero time. Class in C What are Structs and Units ?

  7. Code Structure

  8. struct is a keyword. All syntax keywords are lower-case. The name my_struct is different from the name MY_STRUCT. Defining units and structs Example Code • Thee language is case sensitive. • Both for predefined syntax keywords and user-defined names. Example: struct my_struct { }; struct MY_STRUCT { };

  9. Basics of ‘e’ Language Interns – Basic Intro

  10. Predefined types

  11. Defining Enumerated Types Syntax: typeenum-type: [name1[=exp],...] [(bits|bytes: width-exp)]; Example: type opcode: [ADD, SUB]; • By default the new enumerated type is 32 bits, but it can be sized • according to the number of bits required. • type direction: [READ, WRITE](bits: 1); • Enumerated type statement. Default first enum value is 0. Subsequent • enum values increment by 1. This internal value is used for • comparisons (with strong type matching maintained). • Values can be explicitly assigned with the syntax: typeopcode: [ADD= 4, SUB = 6];

  12. Include in C Import ‘e’ Files • Specman e files are called modules. To reference statements or struct members that are declared in other modules, use the import statement so that Specman loads those modules first. The import statement must be before any other statements. Syntax: import file-name, … | ( file-name, … ); Example: <' import my_packet, my_port; . . . '>

  13. Lists • List types hold ordered collections of data elements where each data element conforms to the same type. • Items in a list can be indexed with the subscript operator [ ], by placing a non-negative integer expression in the brackets. • List indexes start at zero. You can select an item from a list by specifying its index. • Lists are dynamically resizable. • Lists contain many predefined methods. • Lists are defined by using the list of keyword in a variable or a field definition. Lists in ‘E’

  14. Methods • emethods are similar to C functions, Verilog tasks, and VHDL processes. • An emethod is an operational procedure containing actions that define its behavior. Syntax:method_name([arg: type, …])[:return_type] is {action;};

  15. Methods can: • Contain actions (procedural code). • Declare and use local variables. • Have zero to fourteen input arguments/parameters. • Optionally return a value • Optionally consume time if declared to be a “Time-Consuming Method(TCM)” What values can be read or written inside a method? • Locally declared variables within the method • Fields within the local struct’ • Arguments (parameters) and return value of the method • Fields in other structs using path notation Methods

  16. Procedural flow control elements: 1. if then else Syntaxifbool-exp [then] {action; ...} [else ifbool-exp [then] {action; ...}] [else {action; ...}] 2. case labeled-case-item Syntaxcasecase-exp {labeled-case-item; . [default: {default-action; .}]} 3. case bool-case-item Syntax case {bool-case-item; ... [default{default-action;...}]} Procedural Control

  17. 1. while Syntax whilebool-exp [do] {action; ...}2. repeat until Syntax repeat{action; ...}until bool-exp3. for each in Syntax for each [type] [(item-name)] [using index (index-name)] in [reverse] list-exp [do] {action; .} 4. for from to Syntax for var-namefromfrom-exp [down] toto-exp [step step-exp] [do] {action; .} 5. for Syntax for {initial-action; bool-exp; step-action} [do] {action; ...} Procedural Loop Constructs

  18. Constraints are directives that influence the behavior of the Specman test generator. They are declared within a struct and influence the generation of values for data items within the struct and its subtree. 1. Hard Constraints2. Soft Constraints Constraints

  19. Constraints can be defined in many ways: . By defining a range of legal values in the field or variable declaration . By defining a list size in the list declaration . By using one of the keep construct variations within a struct definition . By using a gen...keeping action within a method Constraints

  20. keep Syntax keep constraint-bool-exp keep for each Syntax keep for each [(item-name)] [using [index (index-name)] [prev(prev-name)]] ingen-item{constraint-bool-exp | nested-for-each; .} Defining Constraints

  21. keep soft Syntax keep soft constraint-bool-exp keep soft - select Syntax keep softgen-item==select {weight:value; .} Defining Constraints

  22. There are two ways to implement object-oriented inheritance in e: like inheritance or when inheritanceLikeinheritance is the classical, single inheritance familiar to users of all object-oriented languages and is specified with the like clause in new struct definitions. When inheritance is a concept unique to e and is specified by defining subtypes with when struct members. When inheritance provides the following advantages compared to like inheritance: -Ability to have explicit reference to the when fields -Ability to have multiple, orthogonal subtypes -Ability to extend the struct later Inheritance

  23. A TCM is a time-consuming method that is distinguished from a regular method by the presence of @event and can use time-consuming actions such as sync and wait.Invoking TCMs:1.tcm() Syntax[[struct-exp].]method-name([parameter-list])Description-Calling a TCM -You can call a TCM only from another TCM. Time Consuming Methods

  24. 2.start tcm() Syntax start [[struct-exp].]method-name([parameter-list]) DescriptionA start action can be used within another method, either a TCM or a regular method. A started TCM begins execution either when its sampling event occurs or immediately, if the sampling event has already occurred for the current Specman tick.A started TCM runs in parallel with the TCM that started it on a separate thread.Notes. A TCM that has a return value cannot be started with a start action.. You cannot start a TCM before the run phase begins or after the check phase begins. Invoking TCM’s

  25. Packing performs concatenation of scalars, strings, list elements, or struct fields in the order that you specifyUnpacking performs the reverse operation, splitting a single expression into multiple expressions.1.pack() Syntax pack(option:pack option,item: exp, .): list of bitParameterspacking.highPlaces the least significant bit of the last physical field declared or the highest list item at index [0] in the resulting list of bit. packing.lowPlaces the least significant bit of the first physical field declared or lowest list item at index [0] in the resulting list of bit. Packing and Unpacking

  26. Using SPECMAN

  27. RUNNING A TEST

  28. USING SOME DEBUG OPTIONS- BASIC

  29. Coverage and exit

More Related