In the above code, trans.addr is not taking the value of `MEM_DEPTH, it is only taking the value of 4. Please guide, i am trying to access the invalid address beyond 0-256 since addr is 8 bit.
You should post a complete example which demonstrates your issue. It’s difficult to determine what is wrong without seeing all variables declared.
You state that you want to access address >256, but address is only 8 bits which allows only 0 -255. What are you trying to accomplish and what isn’t working?
In the apb_generator, i am writing testcases in the task, and enabling them at the top of this file. Now, i am writing testcase to check the invalid address. But the trans.addr in the task is not taking the value which i am assigning in the task. Please guide.
In the above, trans.addr is not taking the value of MEM_DEPTH define, it is only taking value 4 which i am adding to MEM_DEPTH. I am trying to access the invalid address range of 8 bit address. Please guide.
Again, it would be very helpful if you show the complete code you are using, including variable definitions. If trans.addr is only 8 bits wide, then it can only have values 0 to 255. You can’t have any addr value outside of that range.
The address bus to your APB slave is 8 bits, which means addresses 0 to 255. Your memory supports 256 addresses, 0 to 255. Your address bus will always contain a valid address.
You have two options:
Make your APB slave address bus bigger than 8 bits.