Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poke io as different format using bundle in PeekPokeTester #270

Closed
hukangha opened this issue Nov 12, 2019 · 1 comment
Closed

poke io as different format using bundle in PeekPokeTester #270

hukangha opened this issue Nov 12, 2019 · 1 comment

Comments

@hukangha
Copy link

hukangha commented Nov 12, 2019

Hi,
I'm using peekpoketester for this case which I need to reinterpret some data io as command

class DMACommandInterface(val numCMDs:Int)
                         (val memAddrWidth:Int)
                         (val nocDataWidth:Int)
                         (val nNodesX:Int,val nNodesY:Int)
  extends Bundle{
  val cmd         = UInt(log2Ceil(numCMDs).W)
  val srcAddr     = UInt(memAddrWidth.W)
  val destAddr    = UInt(memAddrWidth.W)
  val dataSize    = UInt(memAddrWidth.W)
  val nocX        = UInt(log2Ceil(nNodesX).W)
  val nocY        = UInt(log2Ceil(nNodesY).W)
  val dummy       = UInt((nocDataWidth-log2Ceil(numCMDs)-memAddrWidth*3).W)
  override def cloneType :this.type = (new DMACommandInterface(numCMDs)
  (memAddrWidth)(nocDataWidth)(nNodesX,nNodesY)).asInstanceOf[this.type]
}

class DMATxTester(c :DMATx) extends PeekPokeTester(c){

......

  val dmaCommand = new DMACommandInterface(Commands.numCmds)(c.memAddrWidth)(c.nocDataWidth)(c.nNodesX,c.nNodesY)

......

  poke(c.io.rx.data.asTypeOf(dmaCommand).cmd,read)
  poke(c.io.rx.data.asTypeOf(dmaCommand).srcAddr,addr)
  poke(c.io.rx.data.asTypeOf(dmaCommand).destAddr,addr)
  poke(c.io.rx.data.asTypeOf(dmaCommand).dataSize,size)
  poke(c.io.rx.data.asTypeOf(dmaCommand).nocX,xpos)
  poke(c.io.rx.data.asTypeOf(dmaCommand).nocY,ypos

}

and it reports error:
chisel3.internal.ChiselException: Error: Not in a UserModule. Likely cause: Missed Module() wrap, bare chisel API call, or attempting to construct hardware inside a BlackBox.

and if I use SteppedHWIOTester

...
poke(c.io.rx.data.asTypeOf(dmaCommand).cmd,1)
...

it reports
key not found: chisel3.core.UInt@363

So, how do we do this ?

@hukangha hukangha changed the title Reinterpret io to a different bundle in PeekPokeTester poke io as different format using bundle in PeekPokeTester Nov 13, 2019
@hukangha
Copy link
Author

hukangha commented Nov 21, 2019

I saw that tester2 is used for this.
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant