ArgParser.scala (0ffeff0dfd0776be463415a25137f43b59b336e4) ArgParser.scala (37b8fdee014787fb0fcef2682ed2c04af07fdeff)
1/***************************************************************************************
2* Copyright (c) 2020-2021 Institute of Computing Technology, Chinese Academy of Sciences
3* Copyright (c) 2020-2021 Peng Cheng Laboratory
4*
5* XiangShan is licensed under Mulan PSL v2.
6* You can use this software according to the terms and conditions of the Mulan PSL v2.
7* You may obtain a copy of Mulan PSL v2 at:
8* http://license.coscl.org.cn/MulanPSL2

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

34 |--num-cores <Int>
35 |--with-dramsim3
36 |--fpga-platform
37 |--enable-difftest
38 |--enable-log
39 |--with-chiseldb
40 |--with-rollingdb
41 |--disable-perf
1/***************************************************************************************
2* Copyright (c) 2020-2021 Institute of Computing Technology, Chinese Academy of Sciences
3* Copyright (c) 2020-2021 Peng Cheng Laboratory
4*
5* XiangShan is licensed under Mulan PSL v2.
6* You can use this software according to the terms and conditions of the Mulan PSL v2.
7* You may obtain a copy of Mulan PSL v2 at:
8* http://license.coscl.org.cn/MulanPSL2

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

34 |--num-cores <Int>
35 |--with-dramsim3
36 |--fpga-platform
37 |--enable-difftest
38 |--enable-log
39 |--with-chiseldb
40 |--with-rollingdb
41 |--disable-perf
42 |--disable-alwaysdb
42 |""".stripMargin
43
44 def getConfigByName(confString: String): Parameters = {
45 var prefix = "top." // default package is 'top'
46 if(confString.contains('.')){ // already a full name
47 prefix = ""
48 }
49 val c = Class.forName(prefix + confString).getConstructor(Integer.TYPE)

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

100 case "--enable-log" :: tail =>
101 nextOption(config.alter((site, here, up) => {
102 case DebugOptionsKey => up(DebugOptionsKey).copy(EnableDebug = true)
103 }), tail)
104 case "--disable-perf" :: tail =>
105 nextOption(config.alter((site, here, up) => {
106 case DebugOptionsKey => up(DebugOptionsKey).copy(EnablePerfDebug = false)
107 }), tail)
43 |""".stripMargin
44
45 def getConfigByName(confString: String): Parameters = {
46 var prefix = "top." // default package is 'top'
47 if(confString.contains('.')){ // already a full name
48 prefix = ""
49 }
50 val c = Class.forName(prefix + confString).getConstructor(Integer.TYPE)

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

101 case "--enable-log" :: tail =>
102 nextOption(config.alter((site, here, up) => {
103 case DebugOptionsKey => up(DebugOptionsKey).copy(EnableDebug = true)
104 }), tail)
105 case "--disable-perf" :: tail =>
106 nextOption(config.alter((site, here, up) => {
107 case DebugOptionsKey => up(DebugOptionsKey).copy(EnablePerfDebug = false)
108 }), tail)
109 case "--disable-alwaysdb" :: tail =>
110 nextOption(config.alter((site, here, up) => {
111 case DebugOptionsKey => up(DebugOptionsKey).copy(AlwaysBasicDB = false)
112 }), tail)
108 case "--xstop-prefix" :: value :: tail if chisel3.BuildInfo.version != "3.6.0" =>
109 nextOption(config.alter((site, here, up) => {
110 case SoCParamsKey => up(SoCParamsKey).copy(XSTopPrefix = Some(value))
111 }), tail)
112 case "--firtool-opt" :: option :: tail =>
113 firtoolOpts ++= option.split(" ").filter(_.nonEmpty)
114 nextOption(config, tail)
115 case option :: tail =>
116 // unknown option, maybe a firrtl option, skip
117 firrtlOpts :+= option
118 nextOption(config, tail)
119 }
120 }
121 val newArgs = DifftestModule.parseArgs(args)
122 var config = nextOption(default, newArgs.toList)
123 (config, firrtlOpts, firtoolOpts)
124 }
125}
113 case "--xstop-prefix" :: value :: tail if chisel3.BuildInfo.version != "3.6.0" =>
114 nextOption(config.alter((site, here, up) => {
115 case SoCParamsKey => up(SoCParamsKey).copy(XSTopPrefix = Some(value))
116 }), tail)
117 case "--firtool-opt" :: option :: tail =>
118 firtoolOpts ++= option.split(" ").filter(_.nonEmpty)
119 nextOption(config, tail)
120 case option :: tail =>
121 // unknown option, maybe a firrtl option, skip
122 firrtlOpts :+= option
123 nextOption(config, tail)
124 }
125 }
126 val newArgs = DifftestModule.parseArgs(args)
127 var config = nextOption(default, newArgs.toList)
128 (config, firrtlOpts, firtoolOpts)
129 }
130}