Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FireSim doesn't work with cloned configs + CloneLazyModule caveats #2076

Open
3 tasks done
abejgonzalez opened this issue Oct 8, 2024 · 1 comment
Open
3 tasks done
Labels

Comments

@abejgonzalez
Copy link
Contributor

Background Work

Chipyard Version and Hash

Latest

OS Setup

N/A

Other Setup

Tried building

class Cloned64MegaBoomV3Config extends Config(

Current Behavior

Errors since you can't access the .module member here for each tile:

chiptops.foreach {
case c: ChipTop => c.lazySystem match {
case ls: InstantiatesHierarchicalElements => {
if (p(FireSimMultiCycleRegFile)) ls.totalTiles.values.map {
case r: RocketTile => {
annotate(MemModelAnnotation(r.module.core.rocketImpl.rf.rf))
r.module.fpuOpt.foreach(fpu => annotate(MemModelAnnotation(fpu.fpuImpl.regfile)))
}
case b: BoomTile => {
val core = b.module.core
core.iregfile match {
case irf: boom.v3.exu.RegisterFileSynthesizable => annotate(MemModelAnnotation(irf.regfile))
}
if (core.fp_pipeline != null) core.fp_pipeline.fregfile match {
case frf: boom.v3.exu.RegisterFileSynthesizable => annotate(MemModelAnnotation(frf.regfile))
}
}
case _ =>
}
if (p(FireSimFAME5)) ls.totalTiles.values.map {
case b: BoomTile =>
annotate(EnableModelMultiThreadingAnnotation(b.module))
case r: RocketTile =>
annotate(EnableModelMultiThreadingAnnotation(r.module))
case _ => Nil
}
}
case _ =>
}
case _ =>

Expected Behavior

You can bypass the issue by just annotating the 1st element of the sequence. Ideally an API is exposed for CloneLazyModule that indicates if it's been cloned.

Other Information

No response

@abejgonzalez
Copy link
Contributor Author

Additionally, CloneLazyModule doesn't work for non-diplomatic IOs. I.e. something like this doesn't work:

class M0 extends LazyModule {
  val module = LazyModuleImp {
     val io = IO(new Bundle {
        val ib = Input(Bool())
        val ob = Output(Bool())
     }
  }
}

// in lazy module scope
val m0 = LazyModule(new M0)
val m1 = LazyModule(new M0)

// in impl scope
m1.module.io.ib := false.B
m0.module.io.ib := m1.module.io.ob

// change instantiation to this
val m0 = LazyModule(new M0)
val m1 = CloneLazyModule(new M0, m0)

@abejgonzalez abejgonzalez changed the title FireSim doesn't work with cloned configs FireSim doesn't work with cloned configs + CloneLazyModule caveats Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant