YamlParser.scala (69b78670068a0a6f0fb634fc02c24fc772838119) YamlParser.scala (53bd4e1cb2bbe049a6887a8f3c75c296803c14b0)
1/***************************************************************************************
2* Copyright (c) 2025 Beijing Institute of Open Source Chip (BOSC)
3* Copyright (c) 2025 Institute of Computing Technology, Chinese Academy of Sciences
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

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

51 IMSICParams: Option[IMSICParams],
52 CHIIssue: Option[String],
53 WFIClockGate: Option[Boolean],
54 EnablePowerDown: Option[Boolean],
55 XSTopPrefix: Option[String],
56 EnableDFX: Option[Boolean],
57 EnableSramCtl: Option[Boolean],
58 EnableCHINS: Option[Boolean],
1/***************************************************************************************
2* Copyright (c) 2025 Beijing Institute of Open Source Chip (BOSC)
3* Copyright (c) 2025 Institute of Computing Technology, Chinese Academy of Sciences
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

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

51 IMSICParams: Option[IMSICParams],
52 CHIIssue: Option[String],
53 WFIClockGate: Option[Boolean],
54 EnablePowerDown: Option[Boolean],
55 XSTopPrefix: Option[String],
56 EnableDFX: Option[Boolean],
57 EnableSramCtl: Option[Boolean],
58 EnableCHINS: Option[Boolean],
59 CHIAddrWidth: Option[Int],
59)
60
61object YamlParser {
62 implicit val customParserConfig: Configuration = Configuration.default.withDefaults
63 def parseYaml(config: Parameters, yamlFile: String): Parameters = {
64 val yaml = scala.io.Source.fromFile(yamlFile).mkString
65 val json = io.circe.yaml.parser.parse(yaml) match {
66 case Left(value) => throw value

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

180 case XSTileKey => up(XSTileKey).map(_.copy(hasSramCtl = enable))
181 })
182 }
183 yamlConfig.EnableCHINS.foreach { enable =>
184 newConfig = newConfig.alter((site, here, up) => {
185 case coupledL2.tl2chi.NonSecureKey => enable
186 })
187 }
60)
61
62object YamlParser {
63 implicit val customParserConfig: Configuration = Configuration.default.withDefaults
64 def parseYaml(config: Parameters, yamlFile: String): Parameters = {
65 val yaml = scala.io.Source.fromFile(yamlFile).mkString
66 val json = io.circe.yaml.parser.parse(yaml) match {
67 case Left(value) => throw value

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

181 case XSTileKey => up(XSTileKey).map(_.copy(hasSramCtl = enable))
182 })
183 }
184 yamlConfig.EnableCHINS.foreach { enable =>
185 newConfig = newConfig.alter((site, here, up) => {
186 case coupledL2.tl2chi.NonSecureKey => enable
187 })
188 }
189 yamlConfig.CHIAddrWidth.foreach { width =>
190 newConfig = newConfig.alter((site, here, up) => {
191 case coupledL2.tl2chi.CHIAddrWidthKey => width
192 })
193 }
188 newConfig
189 }
190}
194 newConfig
195 }
196}