circt icon indicating copy to clipboard operation
circt copied to clipboard

[FIRRTL] LowerClasses should enforce single instantiation

Open mikeurbach opened this issue 1 year ago • 0 comments

This was removed in https://github.com/llvm/circt/pull/7129, because this requirement never existed in EmitOMIR, and in real designs coming from Chisel today, we are not yet able to enforce single instantiation. This is fine in ResolvePaths, it is sensible and correct to simply convey the local or hierarchical path the user requested. But in LowerClasses, we have to build up the path prefix from the owning module to the start of the hierpath op created by ResolvePaths.

Note that this is currently not being done at all, which is tracked in https://github.com/llvm/circt/issues/7125. When we do implement this, in the case of multiple instances, we will just have to pick one. Ideally, Chisel users wouldn't generate such paths to begin with, and we could enforce single instantiation. For now, just picking the first one in the case of multiple instances will produce the same output as EmitOMIR would.

mikeurbach avatar Jun 04 '24 19:06 mikeurbach