SVEditor provides a number of wizards to ease the creation / maintenance of classes
SVEditor provides a wizard for creating new class files. The wizard can be invoked from the main menu (File>New>SystemVerilog Class) if the SystemVerilog perspective is active.
The wizard can also be invoked from the context menu when a container (folder or project) is selected.
Change the source folder if necessary. Specify the name of the class to be created. By default, the file name of the class will be ''classname''.svh. If a different name is desired, uncheck the Default Filename check-box and change the filename.
If the class being created extends from an existing class, either type the name in the Super Class text entry or select the Browse button.
Classes that are accessible from the index of the containing project are available when browsing for a super-class. In this particular case, a new OVM test is being created, which must extend from ovm_test.
It is often necessary to implement the constructor of a class, especially if there is a super-class. Leaving Implement new() checked causes the new class to implement the constructor. If a super-class is specified and that class has a constructor, a call to the super-constructor is made. In the case of our new test-case class, the following code is generated.
SVEditor provides a wizard that creates task or function templates for methods that are overridden by the active class. Open the Override Methods dialog from the context menu within SVEditor, as shown in the figure below.
When the Override Methods dialog opens, find the class and method to override and select it as shown in the figure below.
Selecting OK causes SVEditor to create a new method template at the cursor location, as shown in the figure below. If Auto-Indent is enabled, the newly-inserted content will be indented.