RRZE-HPC / pycachesim

Python Cache Hierarchy Simulator
GNU Affero General Public License v3.0
88 stars 27 forks source link

There seems to be a logic error in cache block size checks #6

Closed arkD closed 5 years ago

arkD commented 5 years ago

in cache.py Cashe.init() line ~293 assert store_to is None or store_to.cl_size <= cl_size, \ "cl_size may only increase towards main memory." assert load_from is None or load_from.cl_size <= cl_size, \ "cl_size may only increase towards main memory."

if cl_size may only increase towards main memory then I expect l1b = 32, l2b = 64, l3b =128 to work since l3 is closest to memory and l1 is furthest but it does not l1b = 128, l2b = 64, l3b =32 works obviously these sizes are usually the same but intuitively I think the comment is correct and the logic is wrong

cod3monk commented 5 years ago

I believe you're correct. I will fix this shortly. Thanks for reporting!