1
0

Avoid cross-module references

You can't instantiate a Vec in one module and use it in another.
An idiosyncrasy of the Chisel2 implementation let this one slip by.
In this case, it's just a matter of using def instead of val.
This commit is contained in:
Andrew Waterman 2015-07-30 23:47:13 -07:00
parent 8f7b390353
commit 0686bdbe28

View File

@ -29,8 +29,8 @@ trait HasCustomTileLinkMessageTypes {
def grantTypeWidth = log2Up(nGrantTypes) def grantTypeWidth = log2Up(nGrantTypes)
val acquireTypesWithData = Nil // Only built-in Acquire types have data for now val acquireTypesWithData = Nil // Only built-in Acquire types have data for now
val releaseTypesWithData: Vec[UInt] def releaseTypesWithData: Vec[UInt]
val grantTypesWithData: Vec[UInt] def grantTypesWithData: Vec[UInt]
} }
/** This API contains all functions required for client coherence agents. /** This API contains all functions required for client coherence agents.
@ -129,8 +129,8 @@ class MICoherence(dir: DirectoryRepresentation) extends CoherencePolicy(dir) {
val releaseInvalidateData :: releaseCopyData :: releaseInvalidateAck :: releaseCopyAck :: Nil = Enum(UInt(), nReleaseTypes) val releaseInvalidateData :: releaseCopyData :: releaseInvalidateAck :: releaseCopyAck :: Nil = Enum(UInt(), nReleaseTypes)
val grantExclusive :: Nil = Enum(UInt(), nGrantTypes) val grantExclusive :: Nil = Enum(UInt(), nGrantTypes)
val releaseTypesWithData = Vec(releaseInvalidateData, releaseCopyData) def releaseTypesWithData = Vec(releaseInvalidateData, releaseCopyData)
val grantTypesWithData = Vec(grantExclusive) def grantTypesWithData = Vec(grantExclusive)
// Client states and functions // Client states and functions
val nClientStates = 2 val nClientStates = 2
@ -220,8 +220,8 @@ class MEICoherence(dir: DirectoryRepresentation) extends CoherencePolicy(dir) {
val releaseInvalidateData :: releaseDowngradeData :: releaseCopyData :: releaseInvalidateAck :: releaseDowngradeAck :: releaseCopyAck :: Nil = Enum(UInt(), nReleaseTypes) val releaseInvalidateData :: releaseDowngradeData :: releaseCopyData :: releaseInvalidateAck :: releaseDowngradeAck :: releaseCopyAck :: Nil = Enum(UInt(), nReleaseTypes)
val grantExclusive :: Nil = Enum(UInt(), nGrantTypes) val grantExclusive :: Nil = Enum(UInt(), nGrantTypes)
val releaseTypesWithData = Vec(releaseInvalidateData, releaseDowngradeData, releaseCopyData) def releaseTypesWithData = Vec(releaseInvalidateData, releaseDowngradeData, releaseCopyData)
val grantTypesWithData = Vec(grantExclusive) def grantTypesWithData = Vec(grantExclusive)
// Client states and functions // Client states and functions
val nClientStates = 3 val nClientStates = 3
@ -322,8 +322,8 @@ class MSICoherence(dir: DirectoryRepresentation) extends CoherencePolicy(dir) {
val releaseInvalidateData :: releaseDowngradeData :: releaseCopyData :: releaseInvalidateAck :: releaseDowngradeAck :: releaseCopyAck :: Nil = Enum(UInt(), nReleaseTypes) val releaseInvalidateData :: releaseDowngradeData :: releaseCopyData :: releaseInvalidateAck :: releaseDowngradeAck :: releaseCopyAck :: Nil = Enum(UInt(), nReleaseTypes)
val grantShared :: grantExclusive :: grantExclusiveAck :: Nil = Enum(UInt(), nGrantTypes) val grantShared :: grantExclusive :: grantExclusiveAck :: Nil = Enum(UInt(), nGrantTypes)
val releaseTypesWithData = Vec(releaseInvalidateData, releaseDowngradeData, releaseCopyData) def releaseTypesWithData = Vec(releaseInvalidateData, releaseDowngradeData, releaseCopyData)
val grantTypesWithData = Vec(grantShared, grantExclusive) def grantTypesWithData = Vec(grantShared, grantExclusive)
// Client states and functions // Client states and functions
val nClientStates = 3 val nClientStates = 3
@ -440,8 +440,8 @@ class MESICoherence(dir: DirectoryRepresentation) extends CoherencePolicy(dir) {
val releaseInvalidateData :: releaseDowngradeData :: releaseCopyData :: releaseInvalidateAck :: releaseDowngradeAck :: releaseCopyAck :: Nil = Enum(UInt(), nReleaseTypes) val releaseInvalidateData :: releaseDowngradeData :: releaseCopyData :: releaseInvalidateAck :: releaseDowngradeAck :: releaseCopyAck :: Nil = Enum(UInt(), nReleaseTypes)
val grantShared :: grantExclusive :: grantExclusiveAck :: Nil = Enum(UInt(), nGrantTypes) val grantShared :: grantExclusive :: grantExclusiveAck :: Nil = Enum(UInt(), nGrantTypes)
val releaseTypesWithData = Vec(releaseInvalidateData, releaseDowngradeData, releaseCopyData) def releaseTypesWithData = Vec(releaseInvalidateData, releaseDowngradeData, releaseCopyData)
val grantTypesWithData = Vec(grantShared, grantExclusive) def grantTypesWithData = Vec(grantShared, grantExclusive)
// Client states and functions // Client states and functions
val nClientStates = 4 val nClientStates = 4
@ -555,8 +555,8 @@ class MigratoryCoherence(dir: DirectoryRepresentation) extends CoherencePolicy(d
val releaseInvalidateData :: releaseDowngradeData :: releaseCopyData :: releaseInvalidateAck :: releaseDowngradeAck :: releaseCopyAck :: releaseDowngradeDataMigratory :: releaseDowngradeAckHasCopy :: releaseInvalidateDataMigratory :: releaseInvalidateAckMigratory :: Nil = Enum(UInt(), nReleaseTypes) val releaseInvalidateData :: releaseDowngradeData :: releaseCopyData :: releaseInvalidateAck :: releaseDowngradeAck :: releaseCopyAck :: releaseDowngradeDataMigratory :: releaseDowngradeAckHasCopy :: releaseInvalidateDataMigratory :: releaseInvalidateAckMigratory :: Nil = Enum(UInt(), nReleaseTypes)
val grantShared :: grantExclusive :: grantExclusiveAck :: grantReadMigratory :: Nil = Enum(UInt(), nGrantTypes) val grantShared :: grantExclusive :: grantExclusiveAck :: grantReadMigratory :: Nil = Enum(UInt(), nGrantTypes)
val releaseTypesWithData = Vec(releaseInvalidateData, releaseDowngradeData, releaseCopyData, releaseInvalidateDataMigratory, releaseDowngradeDataMigratory) def releaseTypesWithData = Vec(releaseInvalidateData, releaseDowngradeData, releaseCopyData, releaseInvalidateDataMigratory, releaseDowngradeDataMigratory)
val grantTypesWithData = Vec(grantShared, grantExclusive, grantReadMigratory) def grantTypesWithData = Vec(grantShared, grantExclusive, grantReadMigratory)
// Client states and functions // Client states and functions
val nClientStates = 7 val nClientStates = 7