blob: 5cc1e0bf0ffa21f610aab23f04383c4f77206c40 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// SPDX-License-Identifier: Apache-2.0
package firrtl
package passes
package memlib
import firrtl.stage.Forms
class DumpMemoryAnnotations extends Transform with DependencyAPIMigration {
override def prerequisites = Forms.MidForm
override def optionalPrerequisites = Seq.empty
override def optionalPrerequisiteOf = Forms.MidEmitters
override def invalidates(a: Transform) = false
def execute(state: CircuitState): CircuitState = {
state.copy(annotations = state.annotations.flatMap {
// convert and remove AnnotatedMemoriesAnnotation to CustomFileEmission
case AnnotatedMemoriesAnnotation(annotatedMemories) =>
state.annotations.collect {
case a: MemLibOutConfigFileAnnotation =>
a.copy(annotatedMemories = annotatedMemories)
// todo convert xxx to verilogs here.
}
case MemLibOutConfigFileAnnotation(_, Nil) => Nil
case a => Seq(a)
})
}
}
|