com.newisys.ova
Class OVA

java.lang.Object
  extended by com.newisys.ova.OVA
All Implemented Interfaces:
OVAInterface

public final class OVA
extends Object
implements OVAInterface

The native OVA interface. This class implements OVAInterface by providing native implementations for each interface method.


Constructor Summary
OVA()
          Sole constructor.
 
Method Summary
 boolean addAssertListener(long clientID, int eventID, long assertID)
          Adds a callback for a specified assert and event type.
 boolean addEngineListener(long clientID, int eventID)
          Adds a callback for the specified engine event type.
 boolean assertDoAction(long clientID, int eventID, long assertID, long attemptID, int userData)
          Performs the specified action on the specified OVAAssert.
 boolean disableAssertCount(long clientID, long assertID, int eventID)
          Disables counting the specified event type for the specified assert.
 boolean doAction(long clientID, int eventID, int userData)
          Performs the specified action on the OVA Engine.
 boolean enableAssertCount(long clientID, long assertID, int eventID)
          Enables counting the specified event type for the specified assert.
 long firstAssert(long clientID)
          Returns the first assert from the engine, or null if no asserts are present in the design.
 String getApiVersion()
          Returns a string representing the OVA API version.
 int getAssertCategory(long clientID, long assertID)
          Returns the current category for the specified assert.
 long getAssertCount(long clientID, long assertID, int eventID)
          Returns the number of times the specified event type has occurred for the specified assert since counting was enabled.
 OVAAssertInfo getAssertInfo(long clientID, long id)
          Returns the information for the specified assert.
 int getAssertSeverity(long clientID, long assertID)
          Returns the current severity level for the specified assert.
 String getAssertUserMessage(long clientID, long assertID)
          Returns the current user message for the specified assert.
 boolean hasAssertInfo(long clientID)
          Returns whether information about OVA asserts is available from OVA.
static boolean isSupported()
          Returns whether native OVA support is available.
 long nextAssert(long clientID)
          Returns the next assert from the engine, or null if no more asserts are available.
 long registerClient()
          Registers a client with OVA.
 boolean removeAssertListener(int eventID, long assertID)
          Removes a callback for a specified assert and event type.
 boolean removeEngineListener(int eventID)
          Removes a callback for the specified engine event type.
 boolean setAssertCategory(long clientID, long assertID, int category)
          Sets the category of the specified assert.
 boolean setAssertSeverity(long clientID, long assertID, int severity)
          Sets the severity level of the specified assert.
 boolean setAssertUserMessage(long clientID, long assertID, String msg)
          Sets the user message of the specified assert.
 boolean setConfigSwitch(long clientID, int confSwitch, boolean enable)
          Sets the specified OVA option.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OVA

public OVA()
Sole constructor. This is not intended to be invoked by user code.

Throws:
IllegalStateException - if the simulator does not support OVA
Method Detail

isSupported

public static boolean isSupported()
Returns whether native OVA support is available.

Returns:
true if native OVA support is available, false otherwise

getApiVersion

public String getApiVersion()
Returns a string representing the OVA API version.

Specified by:
getApiVersion in interface OVAInterface
Returns:
the API version string

registerClient

public long registerClient()
Registers a client with OVA. A client identifier is returned. This identifier can be zero in the following cases:

Specified by:
registerClient in interface OVAInterface
Returns:
the client identifier to be used in future calls into the API, or zero as described above

setConfigSwitch

public boolean setConfigSwitch(long clientID,
                               int confSwitch,
                               boolean enable)
Sets the specified OVA option.

Specified by:
setConfigSwitch in interface OVAInterface
Parameters:
clientID - the client identifier
confSwitch - the configuration switch to be set
enable - true if confSwitch should be enabled, false otherwise
Returns:
true if the operation is successful, false otherwise
See Also:
OVAConfigSwitch

doAction

public boolean doAction(long clientID,
                        int eventID,
                        int userData)
Performs the specified action on the OVA Engine.

Specified by:
doAction in interface OVAInterface
Parameters:
clientID - the client identifier
eventID - the type of action to be performed on the OVA engine
userData - user defined data
Returns:
true if the operation is successful, false otherwise
See Also:
OVAEngineAction

firstAssert

public long firstAssert(long clientID)
Returns the first assert from the engine, or null if no asserts are present in the design.

Specified by:
firstAssert in interface OVAInterface
Parameters:
clientID - the client identifier
Returns:
the assert identifier of the first assert or null if no asserts are present in the design
See Also:
OVAAssert

nextAssert

public long nextAssert(long clientID)
Returns the next assert from the engine, or null if no more asserts are available. It is expected that OVAInterface.firstAssert(long) has been called before calling this method.

Specified by:
nextAssert in interface OVAInterface
Parameters:
clientID - the client identifier
Returns:
the assert identifier of the next assert or null if no more asserts are available
See Also:
OVAAssert

assertDoAction

public boolean assertDoAction(long clientID,
                              int eventID,
                              long assertID,
                              long attemptID,
                              int userData)
Performs the specified action on the specified OVAAssert. Some actions require an attempt identifier. For those that do not, attemptID should be zero.

Specified by:
assertDoAction in interface OVAInterface
Parameters:
clientID - the client identifier
eventID - the type of action to be performed on the assert
assertID - the assert identifier
attemptID - the attempt identifier
userData - user defined data
Returns:
true if the operation is successful, false otherwise
See Also:
OVAAssert, OVAAssertAction

hasAssertInfo

public boolean hasAssertInfo(long clientID)
Returns whether information about OVA asserts is available from OVA.

Specified by:
hasAssertInfo in interface OVAInterface
Parameters:
clientID - the client identifier
Returns:
true if assert information is available, false otherwise

getAssertInfo

public OVAAssertInfo getAssertInfo(long clientID,
                                   long id)
Returns the information for the specified assert. It is expected that OVAInterface.hasAssertInfo(long) will be called and return true before calling this method.

Specified by:
getAssertInfo in interface OVAInterface
Parameters:
clientID - the client identifier
id - the assert identifier
Returns:
the OVAAssertInfo corresponding to the assert referenced by assertID
See Also:
OVAAssert

addEngineListener

public boolean addEngineListener(long clientID,
                                 int eventID)
Adds a callback for the specified engine event type.

Specified by:
addEngineListener in interface OVAInterface
Parameters:
clientID - the client identifier
eventID - the event type
Returns:
true if the operation is successful, false otherwise
See Also:
OVAEngineEventType

addAssertListener

public boolean addAssertListener(long clientID,
                                 int eventID,
                                 long assertID)
Adds a callback for a specified assert and event type.

Specified by:
addAssertListener in interface OVAInterface
Parameters:
clientID - the client identifier
eventID - the event type
assertID - the assert identifier
Returns:
true if the operation is successful, false otherwise
See Also:
OVAAssert, OVAAssertEventType

removeAssertListener

public boolean removeAssertListener(int eventID,
                                    long assertID)
Removes a callback for a specified assert and event type.

Specified by:
removeAssertListener in interface OVAInterface
Parameters:
eventID - the event type
assertID - the assert identifier
Returns:
true if the operation is successful, false otherwise
See Also:
OVAAssert, OVAEngineEventType

removeEngineListener

public boolean removeEngineListener(int eventID)
Removes a callback for the specified engine event type.

Specified by:
removeEngineListener in interface OVAInterface
Parameters:
eventID - the event type
Returns:
true if the operation is successful, false otherwise
See Also:
OVAEngineEventType

setAssertSeverity

public boolean setAssertSeverity(long clientID,
                                 long assertID,
                                 int severity)
Sets the severity level of the specified assert. The severity should be a value from 0 to 0xFF.

Specified by:
setAssertSeverity in interface OVAInterface
Parameters:
clientID - the client identifier
assertID - the assert identifier
severity - the severity level
Returns:
true if the operation is successful, false otherwise
See Also:
OVAAssert

getAssertSeverity

public int getAssertSeverity(long clientID,
                             long assertID)
Returns the current severity level for the specified assert. The severity is a value from 0 to 0xFF.

Specified by:
getAssertSeverity in interface OVAInterface
Parameters:
clientID - the client identifier
assertID - the assert identifier
Returns:
the severity level for the assert referenced by assertID
See Also:
OVAAssert

setAssertCategory

public boolean setAssertCategory(long clientID,
                                 long assertID,
                                 int category)
Sets the category of the specified assert. The category should be a value from 0 to 0xFFFFFF.

Specified by:
setAssertCategory in interface OVAInterface
Parameters:
clientID - the client identifier
assertID - the assert identifier
category - the category
Returns:
true if the operation is successful, false otherwise
See Also:
OVAAssert

getAssertCategory

public int getAssertCategory(long clientID,
                             long assertID)
Returns the current category for the specified assert. The category is a value from 0 to 0xFFFFFF.

Specified by:
getAssertCategory in interface OVAInterface
Parameters:
clientID - the client identifier
assertID - the assert identifier
Returns:
the category for the assert referenced by assertID
See Also:
OVAAssert

setAssertUserMessage

public boolean setAssertUserMessage(long clientID,
                                    long assertID,
                                    String msg)
Sets the user message of the specified assert. The user message should be any non-null string.

Specified by:
setAssertUserMessage in interface OVAInterface
Parameters:
clientID - the client identifier
assertID - the assert identifier
msg - the user message
Returns:
true if the operation is successful, false otherwise
See Also:
OVAAssert

getAssertUserMessage

public String getAssertUserMessage(long clientID,
                                   long assertID)
Returns the current user message for the specified assert. The user message is a non-null string.

Specified by:
getAssertUserMessage in interface OVAInterface
Parameters:
clientID - the client identifier
assertID - the assert identifier
Returns:
theuser message for the assert referenced by assertID
See Also:
OVAAssert

enableAssertCount

public boolean enableAssertCount(long clientID,
                                 long assertID,
                                 int eventID)
Enables counting the specified event type for the specified assert. This method is separate from the generic OVAInterface.addAssertListener(long, int, long) method in order to improve performance. This method resets the count to zero before enabling counting.

Specified by:
enableAssertCount in interface OVAInterface
Parameters:
clientID - the client identifier
assertID - the assert identifier
eventID - the event type being counted
Returns:
true if the operation is successful, false otherwise
See Also:
OVAAssert, OVAAssertEventType

disableAssertCount

public boolean disableAssertCount(long clientID,
                                  long assertID,
                                  int eventID)
Disables counting the specified event type for the specified assert. This method is a counterpart to OVAInterface.enableAssertCount(long, long, int). The event count obtained via OVAInterface.getAssertCount(long, long, int) will continue to be valid after this method is called (unless there is a subsequent call to enableAssertCount).

Specified by:
disableAssertCount in interface OVAInterface
Parameters:
clientID - the client identifier
assertID - the assert identifier
eventID - the event type being counted
Returns:
true if the operation is successful, false otherwise
See Also:
OVAAssert, OVAAssertEventType

getAssertCount

public long getAssertCount(long clientID,
                           long assertID,
                           int eventID)
Returns the number of times the specified event type has occurred for the specified assert since counting was enabled. If counting is not enabled, an OVAException is thrown.

Specified by:
getAssertCount in interface OVAInterface
Parameters:
clientID - the client identifier
assertID - the assert identifier
eventID - the event type being counted
Returns:
the number of times an event of type eventID occurred for the assert referenced by assertID
See Also:
OVAAssert, OVAAssertEventType