vpi.Container.lock
- Container.lock(mode: vpi.Lock, memtype: vpi.MemType) vpi.Container.Lock
- Container.lock(memtype: vpi.MemType) vpi.Container.Lock
Lock the container data.
Hint
This allows the container data to be accessed in a with statement, using the item target as the data itself. Example:
with container.lock(vpi.Lock.READ, vpi.MemType.CPU) as data:
.Note
The data returned is not a copy of the container data.
- Parameters
mode (vpi.Lock, optional) – Lock mode defines how the data will be accessed. Use
read-and-write
access when missing.memtype (vpi.MemType) – The memory type where the data will reside.
- Returns
Access container data using the as of a with statement.
- Return type
vpi.Container.Lock