mirror of https://github.com/llvm/circt.git
![]() For the new concept of Moore dialect, some operations will be defined as memory-related operations. Modeling memref Dialect and LLVM dialect, the operation relationship is as follows: ReadOp and blockingAssignOp are related to loadOp and storeOp. VariableOp is related to allocaOp. However, the operations mentioned below are for basic types. This PR will support nested types in the following way: VariableOp with nested types is still related to allocaOp (will be replaced with structCreateOp and UnionCreateOp). structExtractRefOp is related to storeOp. structExtractOp is related to loadOp. To implement this: Since these operations will be lowered to the hw dialect, the design largely refers to the hw dialect. Add the trait DestructurableAllocationOpInterface for VariableOp. Add the trait DestructurableAccessorOpInterface for structExtractOp and structExtractRefOp. Implement the DestructurableTypeInterface for structLikeType and the reftype of structLikeType. For local variables: Use the SROA (Scalar Replacement of Aggregates) Pass to destructure all nested-type variables into basic-type variables. Use the Mem2Reg (Memory to Register) Pass to replace variables imported by SROA with constants. For global/module-level variables: When importing Verilog, use structInjectOp rather than blockingAssignOp, because structExtractRefOp has the Destructurable trait, but global variables should not be destructured. structInjectOp means creating a new struct with new values and other old values. Use the canonicalizer Pass to fold duplicate injecting same field operations. Use the canonicalizer Pass to explicitly show new struct creation. Use the canonicalizer Pass to send source values directly and remove structExtractOp. Also, remove some unnecessary spaces in other code. What's more: Verify that the input of nested-type-related operations should match the field type defined. To do: Update the use of struct SSA values referring to the latest structInjectOp SSA values. Design the method for union types. Add and support the dbg dialect to keep local variables visible after SROA & Mem2Reg. Co-authored-by: Théo Degioanni <degiotheo@gmail.com> Co-authored-by: Fabian Schuiki <fabian@schuiki.ch> |
||
---|---|---|
.. | ||
arcilator | ||
circt-as | ||
circt-cocotb-driver | ||
circt-dis | ||
circt-lec | ||
circt-lsp-server | ||
circt-opt | ||
circt-reduce | ||
circt-rtl-sim | ||
circt-translate | ||
circt-verilog | ||
firtool | ||
handshake-runner | ||
hlstool | ||
ibistool | ||
llhd-sim | ||
om-linker | ||
py-split-input-file | ||
CMakeLists.txt |