There's a bug in datamem. It looks like you're assigning dout to be doutRam when the top bit is 0. However, if you read the spec, datamem is entirely synchronous so this does not. It should work like a reg so I have made the appropriate modifications. Please review to make sure this follows the paradigm you are using.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey Alan,
There's a bug in datamem. It looks like you're assigning dout to be doutRam when the top bit is 0. However, if you read the spec, datamem is entirely synchronous so this does not. It should work like a reg so I have made the appropriate modifications. Please review to make sure this follows the paradigm you are using.