stanford-ppl / spatial

Spatial: "Specify Parameterized Accelerators Through Inordinately Abstract Language"
https://spatial.stanford.edu
MIT License
271 stars 33 forks source link

Add support for LockSRAM and Lock nodes #270

Open mattfel1 opened 4 years ago

mattfel1 commented 4 years ago

For plasticine. Details tbd...

mattfel1 commented 4 years ago

issue270_locking branch has an app called SimpleLock. The IR looks like:

x1: LockSRAM = LockSRAMNew(size_of_memory)
x2: Lock = LockNew(width_of_vec [product of nested pars?])
....
x3: UnrolledWriter = LockSRAMBankedWrite(data, Seq(addr), addr [ignore this one, ofs placeholder], None [Seq[LockWithKeys] type], ens)
...
x4...x20: LockWithKeys = LockOnKeys(x2, b###)
x21: UnrolledReader = LockSRAMBankedRead(Seq(addr), addr, Some(Seq(x4,...,x20)), ens)
...
x22: UnrolledWriter = LockSRAMBankedWrite(data, Seq(addr), addr, Some(Seq(x4,...,x20)), ens)

Handing this over so you can tell me what else needs to be changed in the IR. It's messy but I think this covers simple cases for what we talked about.