|
本帖最后由 Eworm001 于 2019-2-20 20:35 编辑
Uart.scala
UartTest.scala
- class UartTopTest(c:UartTop) extends PeekPokeTester(c){
- poke(c.io.rx,true)
- step(200)
- for (i <- 0 to 255) {
- //printf(p"Step $i")
- //a Byte
- var d =i
- poke(c.io.rx, false)
- step(16)
- for(j <- 0 to 7){
- poke(c.io.rx, d&0x01)
- step(16)
- d = (d>>1)
- }
- poke(c.io.rx, true)
- step(16)
- step(100)
- }
- }
- object AuxSinkTopTester {
- def main(args: Array[String]): Unit = {
- val margs = Array("--tr-write-vcd")
- Driver.execute(margs, () => new UartTop) {
- c => new UartTopTest(c)
- }
- }
- }
复制代码
|
|