|
14 | 14 | # KIND, either express or implied. See the License for the |
15 | 15 | # specific language governing permissions and limitations |
16 | 16 | # under the License. |
17 | | -from vsc.impl.coverage_registry import CoverageRegistry |
18 | | - |
19 | 17 | ''' |
20 | 18 | Created on Jul 23, 2019 |
21 | 19 |
|
22 | 20 | @author: ballance |
23 | 21 | ''' |
24 | 22 |
|
| 23 | +import os |
| 24 | + |
| 25 | +from vsc.impl.coverage_registry import CoverageRegistry |
25 | 26 | from vsc.model.constraint_expr_model import ConstraintExprModel |
26 | 27 |
|
| 28 | + |
27 | 29 | rand_obj_type_m = {} |
28 | 30 | constraint_scope_stack = [] |
29 | 31 | expr_l = [] |
30 | 32 | foreach_arr_s = [] |
31 | 33 |
|
| 34 | +if "VSC_CAPTURE_SRCINFO" in os.environ.keys() and os.environ["VSC_CAPTURE_SRCINFO"] != "": |
| 35 | + try: |
| 36 | + glbl_capture_srcinfo = int(os.environ["VSC_CAPTURE_SRCINFO"]) |
| 37 | + except Exception: |
| 38 | + print("Note: VSC_CAPTURE_SRCINFO must be numeric, not %s" % |
| 39 | + os.environ["VSC_CAPTURE_SRCINFO"]) |
| 40 | + glbl_capture_srcinfo = 0 |
| 41 | +else: |
| 42 | + glbl_capture_srcinfo = 0 |
| 43 | + |
| 44 | +if "VSC_DEBUG" in os.environ.keys() and os.environ["VSC_DEBUG"] != "": |
| 45 | + try: |
| 46 | + glbl_debug = int(os.environ["VSC_DEBUG"]) |
| 47 | + except Exception: |
| 48 | + print("Note: VSC_DEBUG must be numeric, not %s" % |
| 49 | + os.environ["VSC_DEBUG"]) |
| 50 | + glbl_debug = 0 |
| 51 | +else: |
| 52 | + glbl_debug = 0 |
| 53 | + |
| 54 | +if "VSC_SOLVEFAIL_DEBUG" in os.environ.keys() and os.environ["VSC_SOLVEFAIL_DEBUG"] != "": |
| 55 | + try: |
| 56 | + glbl_solvefail_debug = int(os.environ["VSC_SOLVEFAIL_DEBUG"]) |
| 57 | + except Exception: |
| 58 | + print("Note: VSC_SOLVEFAIL_DEBUG must be numeric, not %s" % |
| 59 | + os.environ["VSC_SOLVEFAIL_DEBUG"]) |
| 60 | + glbl_solvefail_debug = 0 |
| 61 | +else: |
| 62 | + glbl_solvefail_debug = 0 |
| 63 | + |
| 64 | + |
32 | 65 | # Tracks whether srcinfo should be collected for a type |
33 | 66 | srcinfo_mode_s = [] |
34 | 67 |
|
@@ -62,7 +95,11 @@ def push_srcinfo_mode(m): |
62 | 95 | srcinfo_mode_s.append(m) |
63 | 96 |
|
64 | 97 | def in_srcinfo_mode(): |
65 | | - return len(srcinfo_mode_s) > 0 and srcinfo_mode_s[-1] |
| 98 | + global glbl_capture_srcinfo |
| 99 | + if glbl_capture_srcinfo > 0: |
| 100 | + return True |
| 101 | + else: |
| 102 | + return len(srcinfo_mode_s) > 0 and srcinfo_mode_s[-1] |
66 | 103 |
|
67 | 104 | def pop_srcinfo_mode(): |
68 | 105 | if len(srcinfo_mode_s) > 0: |
|
0 commit comments