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

Blackboxing RAM with one read and one readWrite port #1372

Open
KireinaHoro opened this issue Mar 21, 2024 · 2 comments
Open

Blackboxing RAM with one read and one readWrite port #1372

KireinaHoro opened this issue Mar 21, 2024 · 2 comments

Comments

@KireinaHoro
Copy link
Contributor

I understand that for Mem, a readWrite port can always host a read or a write port, so in principle the RAM with 1 readSync and 1 readWrite port should be able to be blackboxed into a Ram_2wrs. This is not possible currently:

class spinal.core.blackboxAll$ is not able to blackbox toplevel/bindProtoToCoreCtrl_txPktBuffer : Mem[151*512 bits]                                                                          
  write ports : 0                                                                                                                                                                            
  readAsync ports : 0                                                                                                                                                                        
  readSync ports : 1                                                                                                                                                                         
  readWrite ports : 1                                                                                                                                                                        
  -> Unblackboxable memory topology 
@KireinaHoro
Copy link
Contributor Author

KireinaHoro commented Mar 21, 2024

I think in practice RAM like this would be possible to infer by the EDA tool, so there's not a strict need to blackbox this case. I'm currently using the blackbox flow to make sure I don't accidentally create RAM that could not be inferred by Vivado; do we have some sort of checks for this purpose?

@Dolu1990
Copy link
Member

should be able to be blackboxed into a Ram_2wrs

But shoudnl't as the idea is to be very accurate about what it is (Ram_1r_1wrs which doesn't exists)

I think in practice RAM like this would be possible to infer by the EDA tool,

Ahh on the big vendors yes, but on smaller things / darker place, things can break very easily
For vivado, i only use blackboxing when using byte enable or multiple write ports

do we have some sort of checks for this purpose?

See https://github.com/SpinalHDL/VexiiRiscv/blob/litex/src/main/scala/vexiiriscv/soc/litex/Soc.scala#L295 for instance only ask blackboxing on byte enable rams

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