ArgParser.scala (1fc8b8778a8bfc722c895017ebb477b5ecdd325e) | ArgParser.scala (ce34d21eb5ac76b5b49df0748e135581b8df51e5) |
---|---|
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: --- 20 unchanged lines hidden (view full) --- 29import utility._ 30 31object ArgParser { 32 // TODO: add more explainations 33 val usage = 34 """ 35 |XiangShan Options 36 |--xs-help print this help message | 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: --- 20 unchanged lines hidden (view full) --- 29import utility._ 30 31object ArgParser { 32 // TODO: add more explainations 33 val usage = 34 """ 35 |XiangShan Options 36 |--xs-help print this help message |
37 |--version print version info |
|
37 |--config <ConfigClassName> 38 |--num-cores <Int> 39 |--hartidbits <Int> 40 |--with-dramsim3 41 |--fpga-platform 42 |--reset-gen 43 |--enable-difftest 44 |--enable-log --- 18 unchanged lines hidden (view full) --- 63 @tailrec 64 def nextOption(config: Parameters, list: List[String]): Parameters = { 65 list match { 66 case Nil => config 67 case "--xs-help" :: tail => 68 println(usage) 69 if(tail == Nil) exit(0) 70 nextOption(config, tail) | 38 |--config <ConfigClassName> 39 |--num-cores <Int> 40 |--hartidbits <Int> 41 |--with-dramsim3 42 |--fpga-platform 43 |--reset-gen 44 |--enable-difftest 45 |--enable-log --- 18 unchanged lines hidden (view full) --- 64 @tailrec 65 def nextOption(config: Parameters, list: List[String]): Parameters = { 66 list match { 67 case Nil => config 68 case "--xs-help" :: tail => 69 println(usage) 70 if(tail == Nil) exit(0) 71 nextOption(config, tail) |
72 case "--version" :: tail => 73 println(os.read(os.resource / "publishVersion")) 74 if(tail == Nil) exit(0) 75 nextOption(config, tail) |
|
71 case "--config" :: confString :: tail => 72 nextOption(getConfigByName(confString), tail) 73 case "--issue" :: issueString :: tail => 74 nextOption(config.alter((site, here, up) => { 75 case coupledL2.tl2chi.CHIIssue => issueString 76 }), tail) 77 case "--num-cores" :: value :: tail => 78 nextOption(config.alter((site, here, up) => { --- 87 unchanged lines hidden --- | 76 case "--config" :: confString :: tail => 77 nextOption(getConfigByName(confString), tail) 78 case "--issue" :: issueString :: tail => 79 nextOption(config.alter((site, here, up) => { 80 case coupledL2.tl2chi.CHIIssue => issueString 81 }), tail) 82 case "--num-cores" :: value :: tail => 83 nextOption(config.alter((site, here, up) => { --- 87 unchanged lines hidden --- |