Skip to content

Commit 4dd66f0

Browse files
committed
Various updates to the rules.
1 parent 0e7eabe commit 4dd66f0

File tree

1 file changed

+54
-42
lines changed

1 file changed

+54
-42
lines changed

docs/verification_components/user_guide.rst

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -95,98 +95,110 @@ The handle is given as an argument to the procedure calls to direct messages to
9595
VC and VCI Compliance Testing
9696
=============================
9797

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.
100100

101101
Rule 1
102102
------
103103

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.
105106

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.
107109

108110
Rule 2
109111
------
110112

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.
112114

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.
114120

115121
Rule 3
116122
------
117123

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``.
119125

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.
121129

122130
Rule 4
123131
------
124132

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.
127134

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.
129136

130137
Rule 5
131138
------
132139

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.
135143

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.
137146

138147
Rule 6
139148
------
140149

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.
142152

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.
144155

145156
Rule 7
146157
------
147158

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.
154161

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.
156164

157-
**Rationale**: This prevents premature termination of the testbench.
158-
159-
Rule 11
160-
-------
165+
Rule 8
166+
------
161167

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.
163170

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.
165172

166-
Rule 12
167-
-------
173+
Rule 9
174+
------
168175

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.
170177

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.
172180

173-
Rule 13
181+
Rule 10
174182
-------
175183

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.
177186

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.
179189

180-
Rule 14
190+
Rule 11
181191
-------
182192

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.
184195

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.
186197

187-
Rule 15
198+
Rule 12
188199
-------
189200

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.
191202

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
204+
completed.

0 commit comments

Comments
 (0)