【问题标题】:In chisel, How to generate serval Module with different parameter?在凿子中,如何生成具有不同参数的伺服模块?
【发布时间】:2022-01-25 08:08:48
【问题描述】:

我有一个模块 monit ,它有一个参数 threshold ,然后我想在包装器中生成 serval(e.g.8) Module monit 具有不同的阈值。但是当我使用

val monits = Seq.fill(8)(Module(new monit(32)))

要创建8个模块monit,它们都有相同的阈值,我如何传递不同的阈值参数?

【问题讨论】:

    标签: scala chisel rocket-chip


    【解决方案1】:

    也许是这样的?

    val thresholds = Seq(1,2,3,4,5,6,7,8)
    val monits = thresholds.map(th => Module(new monit(th)) )
    

    我在手机上输入了这个,并没有测试代码,但应该给出一个关于使用 scala 集合和map 的想法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多