coverage.py (c8b1e4db9cf506f40d3cbddfbd259cfecf0168b7) coverage.py (c6d439803a044ea209139672b25e35fe8d7f4aa0)
1#/usr/bin/python3
2# -*- coding: UTF-8 -*-
1#/usr/bin/python3
2# -*- coding: UTF-8 -*-
3
4#***************************************************************************************
5# Copyright (c) 2020-2021 Institute of Computing Technology, Chinese Academy of Sciences
6#
7# XiangShan is licensed under Mulan PSL v2.
8# You can use this software according to the terms and conditions of the Mulan PSL v2.
9# You may obtain a copy of Mulan PSL v2 at:
10# http://license.coscl.org.cn/MulanPSL2
11#
12# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
13# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
14# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
15#
16# See the Mulan PSL v2 for more details.
17#***************************************************************************************
18
3import sys
4import re
5import copy
6
7if __name__ == "__main__":
8 assert len(sys.argv) == 3, "Expect input_file and output_file"
9 input_file = sys.argv[1]
10 output_file = sys.argv[2]

--- 19 unchanged lines hidden (view full) ---

30
31 ifdef_match = ifdef.search(line)
32 ifndef_match = ifndef.search(line)
33 endif_match = endif.search(line)
34 synthesis_match = synthesis.search(line)
35 reg_init_match = reg_init.search(line)
36 mem_init_match = mem_init.search(line)
37 coverage_match = coverage.search(line)
19import sys
20import re
21import copy
22
23if __name__ == "__main__":
24 assert len(sys.argv) == 3, "Expect input_file and output_file"
25 input_file = sys.argv[1]
26 output_file = sys.argv[2]

--- 19 unchanged lines hidden (view full) ---

46
47 ifdef_match = ifdef.search(line)
48 ifndef_match = ifndef.search(line)
49 endif_match = endif.search(line)
50 synthesis_match = synthesis.search(line)
51 reg_init_match = reg_init.search(line)
52 mem_init_match = mem_init.search(line)
53 coverage_match = coverage.search(line)
38
54
39 # enter synthesis block
40 if synthesis_match:
41 assert synthesis_nest_level == 0, "Should not nest SYNTHESIS macro"
42 synthesis_nest_level = 1
43
44 if synthesis_nest_level > 0:
45 if ifdef_match or (ifndef_match and not synthesis_match):
46 synthesis_nest_level += 1

--- 48 unchanged lines hidden ---
55 # enter synthesis block
56 if synthesis_match:
57 assert synthesis_nest_level == 0, "Should not nest SYNTHESIS macro"
58 synthesis_nest_level = 1
59
60 if synthesis_nest_level > 0:
61 if ifdef_match or (ifndef_match and not synthesis_match):
62 synthesis_nest_level += 1

--- 48 unchanged lines hidden ---