winIDEA SDK
test_scope.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8winidea_id = ''
9
10
11def test_scope():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 covCtrl = ic.CCoverageController2(connMgr, 'example.trd', "u")
16 covCtrl.waitUntilLoaded(5000, isThrow=True)
17
18 triggerIndex = covCtrl.createTrigger("test_scope")
19 covCtrl.setScope(triggerIndex, ic.CCoverageController2.EScopeEntireMemory)
20 scope = covCtrl.getScope(triggerIndex)
21 readableScope = covCtrl.scope2Str(scope)
22 print(f"Scope of 'test_scope' trigger has been set to scope '{readableScope}'.")
23
24 scope = covCtrl.scope2Enum(readableScope)
25 print(f"Scope readable string can be converted back to isystem.connect enum value: '{scope}'.")
26 covCtrl.close()
27
28
29if __name__ == "__main__":
30 test_scope()