Skip to content

Commit

Permalink
fix file suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
unlsycn committed Dec 1, 2024
1 parent 22428c1 commit 24b1565
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
35 changes: 14 additions & 21 deletions rocketv/src/SRAM.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ import chisel3.util.{log2Ceil, MemoryFile, SRAMDescription, SRAMInterface}
import firrtl.transforms.BlackBoxInlineAnno
import chisel3.experimental.ChiselAnnotation
import chisel3.experimental.hierarchy.core.Hierarchy.HierarchyBaseModuleExtensions
import chisel3.util.HasExtModuleInline

class SRAMBlackbox(parameter: CIRCTSRAMParameter) extends FixedIOExtModule(new CIRCTSRAMInterface(parameter)) { self =>
class SRAMBlackbox(parameter: CIRCTSRAMParameter)
extends FixedIOExtModule(new CIRCTSRAMInterface(parameter))
with HasExtModuleInline { self =>

private val verilogInterface: String =
(Seq.tabulate(parameter.write)(idx =>
Expand Down Expand Up @@ -112,19 +115,14 @@ class SRAMBlackbox(parameter: CIRCTSRAMParameter) extends FixedIOExtModule(new C

override def desiredName = parameter.moduleName

chisel3.experimental.annotate(
new ChiselAnnotation {
def toFirrtl = new BlackBoxInlineAnno(
self.toNamed,
parameter.moduleName,
s"""module ${parameter.moduleName}(
|${verilogInterface}
|);
|${logic}
|endmodule
|""".stripMargin
)
}
setInline(
desiredName + ".sv",
s"""module ${parameter.moduleName}(
|${verilogInterface}
|);
|${logic}
|endmodule
|""".stripMargin
)
}

Expand Down Expand Up @@ -409,13 +407,8 @@ object SRAM {
})
.getOrElse(0)
)

Module.currentModule.foreach { case m: RawModule =>
m.atModuleBodyEnd {
descriptionInstance.hierarchyIn := Property(Path(mem.toTarget))
}
}
description := descriptionInstance.getPropertyReference
descriptionInstance.hierarchyIn := Property(Path(mem.toTarget))
description := descriptionInstance.getPropertyReference
}
out
}
Expand Down
11 changes: 3 additions & 8 deletions t1/src/SRAM.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class SRAMBlackbox(parameter: CIRCTSRAMParameter)
override def desiredName = parameter.moduleName

setInline(
desiredName,
desiredName + ".sv",
s"""module ${parameter.moduleName}(
|${verilogInterface}
|);
Expand Down Expand Up @@ -407,13 +407,8 @@ object SRAM {
})
.getOrElse(0)
)

Module.currentModule.foreach { case m: RawModule =>
m.atModuleBodyEnd {
descriptionInstance.hierarchyIn := Property(Path(mem.toTarget))
}
}
description := descriptionInstance.getPropertyReference
descriptionInstance.hierarchyIn := Property(Path(mem.toTarget))
description := descriptionInstance.getPropertyReference
}
out
}
Expand Down

0 comments on commit 24b1565

Please sign in to comment.