/
CompilerConfigs.scala
92 lines (72 loc) · 2.92 KB
/
CompilerConfigs.scala
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//See LICENSE for license details.
package firesim.configs
import firrtl.options.Dependency
import freechips.rocketchip.config.{Parameters, Config, Field}
import midas.{TargetTransforms, HostTransforms}
import firesim.bridges._
// Experimental: mixing this in will enable assertion synthesis
class WithSynthAsserts extends Config((site, here, up) => {
case midas.SynthAsserts => true
})
// Experimental: mixing this in will enable print synthesis
class WithPrintfSynthesis extends Config((site, here, up) => {
case midas.SynthPrints => true
})
// MIDAS 2.0 Switches
class WithMultiCycleRamModels extends Config((site, here, up) => {
case midas.GenerateMultiCycleRamModels => true
})
class WithModelMultiThreading extends Config((site, here, up) => {
case midas.EnableModelMultiThreading => true
})
// Short name aliases for above
class MCRams extends WithMultiCycleRamModels
class MTModels extends WithModelMultiThreading
// Enables NIC loopback the NIC widget
class WithNICWidgetLoopback extends Config((site, here, up) => {
case LoopbackNIC => true
})
// ADDITIONAL TARGET TRANSFORMATIONS
// These run on the the Target FIRRTL before Target-toHost Bridges are extracted ,
// and decoupling is introduced
// Replaces Rocket Chip's black-box async resets with a synchronous equivalent
class WithAsyncResetReplacement extends Config((site, here, up) => {
case TargetTransforms => Dependency(firesim.passes.AsyncResetRegPass) +: up(TargetTransforms, site)
})
// The wiring transform is normally only run as part of ReplSeqMem
class WithWiringTransform extends Config((site, here, up) => {
case TargetTransforms => Dependency[firrtl.passes.wiring.WiringTransform] +: up(TargetTransforms, site)
})
// ADDITIONAL HOST TRANSFORMATIONS
// These run on the generated simulator(after all Golden Gate transformations:
// host-decoupling is introduced, and BridgeModules are elaborated)
// Generates additional TCL scripts requried by FireSim's EC2 F1 vivado flow
class WithEC2F1Artefacts extends Config((site, here, up) => {
case HostTransforms => Dependency(firesim.passes.EC2F1Artefacts) +: up(HostTransforms, site)
})
// Tells ILATopWiringTransform to actually populate the ILA
class WithAutoILA extends Config((site, here, up) => {
case midas.EnableAutoILA => true
})
// Implements the AutoCounter performace counters features
class WithAutoCounter extends Config((site, here, up) => {
case midas.EnableAutoCounter => true
})
class WithAutoCounterPrintf extends Config((site, here, up) => {
case midas.EnableAutoCounter => true
case midas.AutoCounterUsePrintfImpl => true
case midas.SynthPrints => true
})
class BaseF1Config extends Config(
new WithWiringTransform ++
new WithAsyncResetReplacement ++
new WithEC2F1Artefacts ++
new midas.F1Config
)
class BaseVitisConfig extends Config(
new WithWiringTransform ++
new WithAsyncResetReplacement ++
// new WithEC2F1Artefacts ++
// new WithILATopWiringTransform ++
new midas.VitisConfig
)