stanford-ppl / spatial-lang

Spatial: "Specify Parameterized Accelerators Through Inordinately Abstract Language"
MIT License
99 stars 12 forks source link

Aligned load becomes unaligned load because of type conversion #264

Open yaqiz01 opened 6 years ago

yaqiz01 commented 6 years ago

Not sure whether this is a bug or feature. I was trying figure out why certain apps have unaligned loads/stores when tile size is a multiple of burst size. And it turns out to be the type conversion on loop indices mess up constant propagation in spatial.

For example in GEMM_Blocked,

a_sram load a_dram(ii+i, kk::kk.to[Index]+tileSize)

is a unaligned load while

a_sram load a_dram(ii+i, kk::kk+tileSize)

is a aligned load. because requestLength.s in DRAMTransfersInternal is not statically known. I would assume loop bound is already of type Index so .to[Index] effectively should be a no op?