Server Reference Guide : ASOLib--OpenROAD Server Library : How You Can Use ASOLib Within an OpenROAD Server Application : Step 3: Create or Amend a User Class Whose Methods Will Be Exposed
 
Share this page          
Step 3: Create or Amend a User Class Whose Methods Will Be Exposed
Using the User Class Editor, create a user class with one or more methods. Parameters can be passed by value or through BYREF. Nested user classes and arrays are supported, but only supported data types are passed. For example, a reference variable of class FrameExec would be ignored.
Note:  You should not declare a method parameter called OSCA. The OSCA parameter is generated and used within the GSCP only.
From your method script, you can call procedures, create objects, and invoke methods, and so on, in the usual fashion. Do not issue statements such as CALLFRAME and MESSAGE that require a user interface. Statements such as CALLFRAME will cause a runtime error.
To report errors back to the calling client, global variable OSCA can be used. For more information about how to handle user errors, fatal errors, and information messages from an OpenROAD Server application, see uc_osca (OpenROAD Server).
Finally, to successfully expose methods of the user class through the GSCP interface, the user class must be a subclass of uc_bus_pol_mgr. You can find this user class in the OpenROAD core library; it enables the method to be invoked dynamically by the associated GSCP.
A useful trace facility can be made available to the Server Manager if you include calls to ASDebug() in your OpenROAD Server code. Examples are provided in the demonstration applications.