op_vvec_print()
Abstract
Sends a text representation of a value vector to a standard output device.
Syntax
op_vvec_print (vector)
| Argument | Type | Description |
|---|---|---|
vector |
Vvec_Vector |
value vector to send to an output device [This is a vector that will be sent to the standard output device, such as a screen.] |
Return Type
void
No return value
Example
/* respond to esys interface interrupt */
data_bus = op_intrpt_esys_interface ();
/* Obtain value from esys interface */
data_vector = op_vvec_create (OpC_Type_Stdlogic);
op_esys_interface_vector_get (data_bus, data_vector, 0);
/* print informational string */
printf ("The following value was asserted on the data bus:\n");
op_vvec_print (data_bus);
Details
When invoked, this function sends output to the standard output device stating whether the value vector is valid and, if it is, stating its size. For bit vectors, the contents of the vector are displayed with the most significant bit on the left and the least significant bit on the right. All other vectors appear with position 0 on the left, and all subsequent elements then appear in order.
For example, the value vector {1, 2, 3, 4, 5} prints as:
1 2 3 4 5
whereas the bit vector representation of a byte containing the number 5 appears as:
0 0 0 0 0 1 0 1
Purpose
Provides a mechanism to view the contents of a value vector by sending them, in a readable format, to an output device. In general, op_vvec_print() is a debugging aid that will not be a necessary part of a finished model. During the model development process, however, it is often useful to view the contents of a given vector.
Errors
- Recoverable Error: Value vector is invalid.
Reference
- Use the KP op_vvec_size_get() to determine the number of elements in a vector
- Use the KP op_vvec_type_get() to determine the data type of a vector