Skip to content

Commit

Permalink
ArgParser: update MaxHartIdBits for debug module (OpenXiangShan#2923)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang-Haojin authored Apr 26, 2024
1 parent 37b8fde commit 19fbeaf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/scala/top/ArgParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ package top
import org.chipsalliance.cde.config.{Config, Parameters}
import system.SoCParamsKey
import xiangshan.{DebugOptionsKey, XSTileKey}
import freechips.rocketchip.tile.MaxHartIdBits
import difftest.DifftestModule

import scala.annotation.tailrec
import scala.sys.exit
import chisel3.util.log2Up

object ArgParser {
// TODO: add more explainations
Expand Down Expand Up @@ -66,9 +68,12 @@ object ArgParser {
nextOption(getConfigByName(confString), tail)
case "--num-cores" :: value :: tail =>
nextOption(config.alter((site, here, up) => {
case XSTileKey => (0 until value.toInt) map{ i =>
case XSTileKey => (0 until value.toInt) map { i =>
up(XSTileKey).head.copy(HartId = i)
}
case MaxHartIdBits =>
require(log2Up(value.toInt) <= 10, "MaxHartIdBits should not be larger than 10.")
log2Up(value.toInt)
}), tail)
case "--with-dramsim3" :: tail =>
nextOption(config.alter((site, here, up) => {
Expand Down

0 comments on commit 19fbeaf

Please sign in to comment.