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

Can't poke memory #229

Open
immesys opened this issue Dec 29, 2018 · 2 comments
Open

Can't poke memory #229

immesys opened this issue Dec 29, 2018 · 2 comments

Comments

@immesys
Copy link

immesys commented Dec 29, 2018

I modified the example GCD program to have the following line:

val mem = Mem(1024, UInt(8.W))

And then modified the test to have the following:

pokeAt(gcd.mem, 10, 10)

And I get the following error:

[error] (run-main-0) treadle.executable.TreadleException: Error: memory mem.forceWrite(10, 10). memory not found
[error] treadle.executable.TreadleException: Error: memory mem.forceWrite(10, 10). memory not found
[error] 	at treadle.executable.TreadleException$.apply(TreadleException.scala:10)
[error] 	at treadle.TreadleTester.pokeMemory(TreadleTester.scala:284)
[error] 	at chisel3.iotesters.TreadleBackend.poke(TreadleBackend.scala:36)
[error] 	at chisel3.iotesters.PeekPokeTester.pokeAt(PeekPokeTester.scala:190)

What am I doing wrong?

@chick
Copy link
Contributor

chick commented Jan 2, 2019

@immesys I believe your problem is that the memory you added is getting removed by the dead code elimination pass because your memory is not hooked up directly or indirectly to an IO port. I added the same line you did and added a port and wired the memory to it and the pokeAt and peekAt worked.

@immesys
Copy link
Author

immesys commented Jan 2, 2019

Hmm that could well be the problem. My module is a processor but I am trying to test it by setting up memory with instructions and writing results back to memory, which gets observed using peekAt. Nothing is exposed in the top level IO so it is probably eliminating the entire processor.

Thanks for pointing that out, it should be easy to fix.

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

2 participants