- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用凿子 RawModule 作为我正在构建的模块的 AXI 接口(interface)(以便我可以使用 axi aclk 和 aresetn。)但是,我无法执行使用 peekpoke 测试仪的正常策略。测试具有时钟的原始模块的推荐策略是什么?
最佳答案
PeekPokeTester
目前仅限于使用 MultiIOModule
或其子类型。您可以通过将 RawModule
包装在 MultiIOModule
中并将 IO(包括隐式时钟/重置)从包装 MultiIOModule
桥接到你的RawModule
。
Chisel 的新测试和验证库(取代 chisel-testers/chisel3.iotesters
)预计将原生支持此功能,并存在相关的跟踪问题:ucb-bar/chisel-testers2#14 .
编辑:将 RawModule
包装在 MultiIOModule
中的示例:
import chisel3._
import chisel3.stage.ChiselStage
sealed trait CommonIO { this: RawModule =>
val a = IO(Input(Bool()))
val b = IO(Output(Bool()))
}
class Foo extends RawModule with CommonIO {
val clk = IO(Input(Clock()))
val rst = IO(Input(Reset()))
b := withClockAndReset(clk, rst){ RegNext(a, true.B) }
}
class Wrapper extends MultiIOModule with CommonIO {
val foo = Module(new Foo)
foo.a := a
b := foo.b
foo.clk := clock
foo.rst := reset
}
(new ChiselStage)
.execute(Array("-X", "verilog"),
Seq(chisel3.stage.ChiselGeneratorAnnotation(() => new Wrapper)))
这会产生以下 FIRRTL:
circuit Wrapper :
module Foo :
input a : UInt<1>
output b : UInt<1>
input clk : Clock
input rst : Reset
reg _T : UInt<1>, clk with : (reset => (rst, UInt<1>("h01")))
_T <= a
b <= _T
module Wrapper :
input clock : Clock
input reset : UInt<1>
input a : UInt<1>
output b : UInt<1>
inst foo of Foo
foo.a <= a
b <= foo.b
foo.clk <= clock
foo.rst <= reset
注意:
withClockAndReset
使用clk
和rst
作为RegNext
的时钟和复位连接Wrapper.clock
和 Wrapper.reset
的连接。 withClockAndReset
在这里不起作用。关于chisel - 如何测试 RawModule?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57683775/
我正在使用凿子 RawModule 作为我正在构建的模块的 AXI 接口(interface)(以便我可以使用 axi aclk 和 aresetn。)但是,我无法执行使用 peekpoke 测试仪的
在 documentation 之后将我的项目从 vuex 存储中的单个模块移动到多个. 它声明特定模块应该像这样访问: store.state.a // -> `moduleA`'s state 这
我最近第一次为在 Vuex 中实现模块而苦苦挣扎。我在收到的控制台错误消息(rawModule is undefined)上找不到太多信息,所以我想我会分享我遇到的问题和解决方案。在处理一些示例时,我
我想在 withClock 的帮助下在 RawModule 中创建 RegNext。但是,当错误信息显示缺少隐式重置时,它无法工作。所以我必须这样写: class Test extends RawMo
我是一名优秀的程序员,十分优秀!