xiangshan.py (28bf033072e58fb2e3fb77753a0732d42e2de069) xiangshan.py (5bd65c56355db1d4f5b92a3815df78273c01b892)
1#***************************************************************************************
2# Copyright (c) 2024 Beijing Institute of Open Source Chip (BOSC)
3# Copyright (c) 2020-2024 Institute of Computing Technology, Chinese Academy of Sciences
4# Copyright (c) 2020-2021 Peng Cheng Laboratory
5#
6# XiangShan is licensed under Mulan PSL v2.
7# You can use this software according to the terms and conditions of the Mulan PSL v2.
8# You may obtain a copy of Mulan PSL v2 at:

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

73 # Makefile arguments
74 self.threads = args.threads
75 self.with_dramsim3 = 1 if args.with_dramsim3 else None
76 self.is_release = 1 if args.release else None
77 self.is_spike = "Spike" if args.spike else None
78 self.trace = 1 if args.trace or not args.disable_fork and not args.trace_fst else None
79 self.trace_fst = "fst" if args.trace_fst else None
80 self.config = args.config
1#***************************************************************************************
2# Copyright (c) 2024 Beijing Institute of Open Source Chip (BOSC)
3# Copyright (c) 2020-2024 Institute of Computing Technology, Chinese Academy of Sciences
4# Copyright (c) 2020-2021 Peng Cheng Laboratory
5#
6# XiangShan is licensed under Mulan PSL v2.
7# You can use this software according to the terms and conditions of the Mulan PSL v2.
8# You may obtain a copy of Mulan PSL v2 at:

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

73 # Makefile arguments
74 self.threads = args.threads
75 self.with_dramsim3 = 1 if args.with_dramsim3 else None
76 self.is_release = 1 if args.release else None
77 self.is_spike = "Spike" if args.spike else None
78 self.trace = 1 if args.trace or not args.disable_fork and not args.trace_fst else None
79 self.trace_fst = "fst" if args.trace_fst else None
80 self.config = args.config
81 self.yaml_config = args.yaml_config
81 self.emu_optimize = args.emu_optimize
82 self.xprop = 1 if args.xprop else None
83 self.issue = args.issue
84 self.with_chiseldb = 0 if args.no_db else 1
85 # emu arguments
86 self.max_instr = args.max_instr
87 self.ram_size = args.ram_size
88 self.seed = random.randint(0, 9999)

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

132 (self.is_spike, "REF"),
133 (self.trace, "EMU_TRACE"),
134 (self.trace_fst, "EMU_TRACE"),
135 (self.config, "CONFIG"),
136 (self.num_cores, "NUM_CORES"),
137 (self.emu_optimize, "EMU_OPTIMIZE"),
138 (self.xprop, "ENABLE_XPROP"),
139 (self.with_chiseldb, "WITH_CHISELDB"),
82 self.emu_optimize = args.emu_optimize
83 self.xprop = 1 if args.xprop else None
84 self.issue = args.issue
85 self.with_chiseldb = 0 if args.no_db else 1
86 # emu arguments
87 self.max_instr = args.max_instr
88 self.ram_size = args.ram_size
89 self.seed = random.randint(0, 9999)

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

133 (self.is_spike, "REF"),
134 (self.trace, "EMU_TRACE"),
135 (self.trace_fst, "EMU_TRACE"),
136 (self.config, "CONFIG"),
137 (self.num_cores, "NUM_CORES"),
138 (self.emu_optimize, "EMU_OPTIMIZE"),
139 (self.xprop, "ENABLE_XPROP"),
140 (self.with_chiseldb, "WITH_CHISELDB"),
141 (self.yaml_config, "YAML_CONFIG"),
140 (self.pgo, "PGO_WORKLOAD"),
141 (self.pgo_max_cycle, "PGO_MAX_CYCLE"),
142 (self.pgo_emu_args, "PGO_EMU_ARGS"),
143 (self.llvm_profdata, "LLVM_PROFDATA"),
144 (self.issue, "ISSUE"),
145 ]
146 args = filter(lambda arg: arg[0] is not None, makefile_args)
147 args = [(shlex.quote(str(arg[0])), arg[1]) for arg in args] # shell escape

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

667 # makefile arguments
668 parser.add_argument('--release', action='store_true', help='enable release')
669 parser.add_argument('--spike', action='store_true', help='enable spike diff')
670 parser.add_argument('--with-dramsim3', action='store_true', help='enable dramsim3')
671 parser.add_argument('--threads', nargs='?', type=int, help='number of emu threads')
672 parser.add_argument('--trace', action='store_true', help='enable vcd waveform')
673 parser.add_argument('--trace-fst', action='store_true', help='enable fst waveform')
674 parser.add_argument('--config', nargs='?', type=str, help='config')
142 (self.pgo, "PGO_WORKLOAD"),
143 (self.pgo_max_cycle, "PGO_MAX_CYCLE"),
144 (self.pgo_emu_args, "PGO_EMU_ARGS"),
145 (self.llvm_profdata, "LLVM_PROFDATA"),
146 (self.issue, "ISSUE"),
147 ]
148 args = filter(lambda arg: arg[0] is not None, makefile_args)
149 args = [(shlex.quote(str(arg[0])), arg[1]) for arg in args] # shell escape

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

669 # makefile arguments
670 parser.add_argument('--release', action='store_true', help='enable release')
671 parser.add_argument('--spike', action='store_true', help='enable spike diff')
672 parser.add_argument('--with-dramsim3', action='store_true', help='enable dramsim3')
673 parser.add_argument('--threads', nargs='?', type=int, help='number of emu threads')
674 parser.add_argument('--trace', action='store_true', help='enable vcd waveform')
675 parser.add_argument('--trace-fst', action='store_true', help='enable fst waveform')
676 parser.add_argument('--config', nargs='?', type=str, help='config')
677 parser.add_argument('--yaml-config', nargs='?', type=str, help='yaml config')
675 parser.add_argument('--emu-optimize', nargs='?', type=str, help='verilator optimization letter')
676 parser.add_argument('--xprop', action='store_true', help='enable xprop for vcs')
677 parser.add_argument('--issue', nargs='?', type=str, help='CHI issue')
678 # emu arguments
679 parser.add_argument('--numa', action='store_true', help='use numactl')
680 parser.add_argument('--diff', nargs='?', default="./ready-to-run/riscv64-nemu-interpreter-so", type=str, help='nemu so')
681 parser.add_argument('--max-instr', nargs='?', type=int, help='max instr')
682 parser.add_argument('--disable-fork', action='store_true', help='disable lightSSS')

--- 16 unchanged lines hidden ---
678 parser.add_argument('--emu-optimize', nargs='?', type=str, help='verilator optimization letter')
679 parser.add_argument('--xprop', action='store_true', help='enable xprop for vcs')
680 parser.add_argument('--issue', nargs='?', type=str, help='CHI issue')
681 # emu arguments
682 parser.add_argument('--numa', action='store_true', help='use numactl')
683 parser.add_argument('--diff', nargs='?', default="./ready-to-run/riscv64-nemu-interpreter-so", type=str, help='nemu so')
684 parser.add_argument('--max-instr', nargs='?', type=int, help='max instr')
685 parser.add_argument('--disable-fork', action='store_true', help='disable lightSSS')

--- 16 unchanged lines hidden ---