You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/verification_components/user_guide.rst
+54-42Lines changed: 54 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,98 +95,110 @@ The handle is given as an argument to the procedure calls to direct messages to
95
95
VC and VCI Compliance Testing
96
96
=============================
97
97
98
-
VUnit establishes a standard for VCs and VCIs, designed around a set of rules that promote flexibility, reusability, interoperability,
99
-
and future-proofing of VCs and VCIs.
98
+
VUnit establishes a standard for VCs and VCIs, designed around a set of rules that promote flexibility,
99
+
reusability, interoperability, and future-proofing of VCs and VCIs.
100
100
101
101
Rule 1
102
102
------
103
103
104
-
The file containing a VC entity shall include only one entity, and the file containing a VCI package shall include only one package.
104
+
The file containing the VC entity shall contain only that entity, and the file containing the VCI package shall
105
+
contain only that package.
105
106
106
-
**Rationale**: This simplifies compliance testing, as the VC/VCI can be referenced by file name.
107
+
**Rationale**: This structure simplifies compliance testing, as each VC or VCI can be directly referenced by its
108
+
file name.
107
109
108
110
Rule 2
109
111
------
110
112
111
-
The function used to create a new instance of a VC (the constructor) shall have a name starting with ``new_``.
113
+
A VC shall have only **one** generic, the *handle*, and it shall be of a record type containing **private** fields.
112
114
113
-
**Rationale**: This naming convention allows the compliance test to easily identify the constructor and evaluate it against other applicable rules.
115
+
**Rationale**: Using a record allows future updates to add and/or remove fields in the record without breaking
116
+
backward compatibility.
117
+
118
+
**Recommendation**: Mark the fields as private by using a naming convention and/or including comments. This minimizes
119
+
the risk of users accessing fields directly.
114
120
115
121
Rule 3
116
122
------
117
123
118
-
A VC constructor shall include an ``id`` parameter, allowing the user to specify the VC's identity.
124
+
The VC handle shall be created by a function, the *constructor*, which shall have a name beginning with ``new``.
119
125
120
-
**Rationale**: This provides users control over the namespace assigned to the VC.
126
+
**Rationale**: Using a constructor removes the need for users to directly access the private fields of the handle
127
+
record. The naming convention also enables compliance tests to easily locate the constructor and verify it against
128
+
other applicable rules.
121
129
122
130
Rule 4
123
131
------
124
132
125
-
The ``id`` parameter shall default to ``null_id``. If not overridden, the ``id`` shall follow the format ``<provider>:<VC name>:<n>``, where
126
-
``<n>`` starts at 1 for the first instance of the VC and increments with each subsequent instance.
133
+
The VC constructor shall include an ``id`` parameter of type ``id_t`` to enable the user to specify the VC's identity.
127
134
128
-
**Rationale**: This structured format ensures clear identification while preventing name collisions when combining VCs from different providers.
135
+
**Rationale**: This gives users control over the namespace assigned to the VC.
129
136
130
137
Rule 5
131
138
------
132
139
133
-
All identity-supporting objects associated with the VC (such as loggers, actors, and events) shall be assigned an identity within the namespace
134
-
defined by the constructor’s ``id`` parameter.
140
+
The ``id`` parameter shall default to ``null_id``. If not overridden, ``id`` shall be assigned a value on the format
141
+
``<provider>:<VC name>:<n>``, where ``<n>`` starts at 1 for the first instance of the VC and increments with each
142
+
additional instance.
135
143
136
-
**Rationale**: This gives users control over these objects and allows for easy association of log messages with a specific VC instance.
144
+
**Rationale**: This format ensures clear identification while preventing naming collisions when VCs from different
145
+
providers are combined.
137
146
138
147
Rule 6
139
148
------
140
149
141
-
All checkers used by the VC shall report to the VC’s loggers.
150
+
All identity-supporting objects associated with the VC (such as loggers, actors, and events) shall be assigned an
151
+
identity within the namespace defined by the constructor’s ``id`` parameter.
142
152
143
-
**Rationale**: This ensures that error messages are clearly linked to a specific VC instance.
153
+
**Rationale**: This gives users control over these objects and simplifies the association of log messages with a
154
+
specific VC instance.
144
155
145
156
Rule 7
146
157
------
147
158
148
-
A VC constructor shall include an ``unexpected_msg_type_policy`` parameter, allowing users to define the action taken when the VC receives an unexpected message type.
149
-
150
-
**Rationale**: A VC actor subscribing to another actor may receive irrelevant messages, while VCs addressed directly should only receive messages they can process.
151
-
152
-
Rule 10
153
-
-------
159
+
All logging performed by the VC, including indirect logging (such that error logs from checkers), shall use the
160
+
VUnit logging mechanism.
154
161
155
-
A VC shall keep the ``test_runner_cleanup`` entry gate locked while it has unfinished work, and must unlock the gate at all other times.
162
+
**Rationale**: Using a unified logging mechanism ensures consistency and compatibility across logging outputs
163
+
from different VCs.
156
164
157
-
**Rationale**: This prevents premature termination of the testbench.
158
-
159
-
Rule 11
160
-
-------
165
+
Rule 8
166
+
------
161
167
162
-
All fields in the handle returned by the constructor shall begin with the prefix ``p_``.
168
+
Communication with the VC shall be based on VUnit message passing, and the VC actor’s identity shall match the
169
+
``id`` parameter provided to the constructor.
163
170
164
-
**Rationale**: This emphasizes that all fields are private, which simplifies future updates without breaking backward compatibility.
171
+
**Rationale**: This ensures a consistent communication framework and enables the reuse of VCIs across multiple VCs.
165
172
166
-
Rule 12
167
-
-------
173
+
Rule 9
174
+
------
168
175
169
-
The standard configuration, ``std_cfg_t``, consisting of the required parameters for the constructor, shall be accessible through the handle via a ``get_std_cfg`` call.
176
+
All VCs shall support the sync interface.
170
177
171
-
**Rationale**: This enables reuse of common operations across multiple VCs.
178
+
**Rationale**: The ability to verify if a VC is idle and to introduce delays between transactions are frequently
179
+
needed features for VC users.
172
180
173
-
Rule 13
181
+
Rule 10
174
182
-------
175
183
176
-
A VC shall only have one generic.
184
+
The VC constructor shall include an ``unexpected_msg_type_policy`` parameter, allowing users to specify the action
185
+
taken when the VC receives an unexpected message type.
177
186
178
-
**Rationale**: Representing a VC with a single object simplifies code management. Since all handle fields are private, future updates are less likely to break backward compatibility.
187
+
**Rationale**: This policy enables flexibility in handling situations where a VC actor, subscribed to another actor,
188
+
might receive unsupported messages, while VCs addressed directly should only receive supported messages.
179
189
180
-
Rule 14
190
+
Rule 11
181
191
-------
182
192
183
-
All VCs shall support the sync interface.
193
+
The standard configuration (of type ``std_cfg_t``), which includes the required parameters for the constructor, shall
194
+
be accessible by calling ``get_std_cfg`` with the VC handle.
184
195
185
-
**Rationale**: Being able to verify whether a VC is idle and introduce delays between transactions is a common and useful feature for VC users.
196
+
**Rationale**: This enables reuse of common functions across multiple VCs.
186
197
187
-
Rule 15
198
+
Rule 12
188
199
-------
189
200
190
-
A VC shall keep the ``test_runner_cleanup`` phase entry gate locked while there are pending operations.
201
+
A VC shall keep the ``test_runner_cleanup`` phase entry gate locked as long as there are pending operations.
191
202
192
-
**Rationale**: Locking the gate prevents the simulation from terminating prematurely.
203
+
**Rationale**: Locking the gate ensures that the simulation does not terminate prematurely before all operations have
0 commit comments