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

Single port RAM in Chisel Tutorial #56

Open
bqwer opened this issue Jan 7, 2017 · 0 comments
Open

Single port RAM in Chisel Tutorial #56

bqwer opened this issue Jan 7, 2017 · 0 comments

Comments

@bqwer
Copy link
Contributor

bqwer commented Jan 7, 2017

I believe there is incorrect description of single port memory in Chisel Tutorial 3.0 (beta)
Currently it looks like two port memory that can't read and write at the same time:

val ram1p = Mem(1024, UInt(width = 32))
val reg_raddr = Reg(UInt())
when (wen) { ram1p(waddr) := wdata }
.elsewhen (ren) { reg_raddr := raddr }
val rdata = `ram1p(reg_raddr)

Should be memory with only one address port:

val ram1p = Mem(1024, UInt(width = 32))
val reg_addr = Reg(UInt())
when (wen) { ram1p(addr) := wdata }
.elsewhen (ren) { reg_addr := addr }
val rdata = ram1p(reg_addr)

References:
Altera VHDL Examples
Xilinx Block Memory Generator User Guide Page 43

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