llvm / circt

Circuit IR Compilers and Tools
https://circt.org
Other
1.67k stars 298 forks source link

Standard-To-Handshake + handshake runner doesn't handle toplevel memories well. #68

Open stephenneuendorffer opened 4 years ago

stephenneuendorffer commented 4 years ago

There's currently a small 'hack' to enable simulation with the handshake runner when code from the standard dialect has passed a pointer. In the current implementation, the pointer argument is converted to an internal memory, which is then intended to be initialized before simulation (although this doesn't actually happen yet). This is somewhat unintuitive since the memory conceptually lies outside the handshake design.

Fixing this properly probably requires better design for how the handshake dialect (And graph regions in general) are embedded inside SSACFG regions (e.g. the standard dialect). It would make more sense if a testable interface was provided by the standard to handshake conversion, which could then be easily interacted with by sequential code (like the handshake runner) or by an MLIR testbench. Today this complexity is built into the runner.

mikeurbach commented 3 years ago

@stephenneuendorffer is this the issue for the "tarpit" you were mentioning today about memrefs as inputs to Standard funcs? Just want to make sure it's tracked and we have a clear place to discuss and eventually resolve with Juan and Jianyi.