gpt4 book ai didi

scala - 具有多时钟域的凿子测试仪 SteppedHWIOTester

转载 作者:行者123 更新时间:2023-12-02 01:07:14 25 4
gpt4 key购买 nike

尝试像那样用 SteppedHWIOTester 测试用凿子编写的 asyncFifo

class AsyncFifo(width: Int, depth: Int, syncStages: Int) extends Module {
val length = log2Ceil(depth)
val io = IO(new Bundle {
val clk_write = Input(Clock())
val clk_read = Input(Clock())
val rstn_write = Input(Bool())
val rstn_read = Input(Bool())
val deq = Decoupled(UInt(width.W))
val enq = Flipped(Decoupled(UInt(width.W)))
})
val memory = Mem(depth, UInt(width.W))
val reader: reader = withClock(io.clk_read)( Module(new reader(width, depth, syncStages)) )
val writer: writer = withClock(io.clk_write)( Module(new writer(width, depth, syncStages)) )
//some connections here...
}
class AsyncFifoHardWareTester extends SteppedHWIOTester {
val device_under_test = Module(new AsyncFifo(32, 32, 2))
val c = device_under_test
enable_all_debug = true

step(2)
poke(c.io.enq.bits, 0x11L)
poke(c.io.enq.valid, 0x1L)
step(2)
poke(c.io.enq.bits, 0x11L)
poke(c.io.enq.valid, 0x0L)
step(2)
expect(c.io.deq.valid, 0x11L)
expect(c.io.deq.bits, 0x0L)
}

Tester 生成vcd,其中clk_write 和clk_read 由零驱动。有什么方法可以在 HW 或 PeekPoke 测试仪中声明异步时钟及其比率?

最佳答案

不幸的是,目前的答案是否定的,chisel-testers repo 没有测试多个时钟的设施。凿子团队正在努力清理和改进凿子测试仪,请参阅:Chisel3 Issues: Testers Unification看到一些激励性的讨论。同样正在进行的是对 firrtl 解释器的重写,它将明确支持多个时钟,但这可能还需要几个月的时间。

人们自己做到了这一点。您也可以在 Chisel Users Group 上尝试这个问题

关于scala - 具有多时钟域的凿子测试仪 SteppedHWIOTester,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47033706/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com