2014-09-13 00:31:38 +02:00
|
|
|
// See LICENSE for license details.
|
|
|
|
|
2012-09-27 21:59:45 +02:00
|
|
|
package uncore
|
2012-10-16 03:52:48 +02:00
|
|
|
package constants
|
2012-09-27 21:59:45 +02:00
|
|
|
|
|
|
|
import Chisel._
|
2012-10-16 03:52:48 +02:00
|
|
|
|
2013-07-25 08:22:36 +02:00
|
|
|
object MemoryOpConstants extends MemoryOpConstants
|
2012-10-16 03:52:48 +02:00
|
|
|
trait MemoryOpConstants {
|
2014-11-12 02:36:55 +01:00
|
|
|
val NUM_XA_OPS = 9
|
2013-04-04 07:13:51 +02:00
|
|
|
val M_SZ = 5
|
2015-07-28 11:46:23 +02:00
|
|
|
val M_X = BitPat("b?????");
|
|
|
|
val M_XRD = UInt("b00000"); // int load
|
|
|
|
val M_XWR = UInt("b00001"); // int store
|
|
|
|
val M_PFR = UInt("b00010"); // prefetch with intent to read
|
|
|
|
val M_PFW = UInt("b00011"); // prefetch with intent to write
|
|
|
|
val M_XA_SWAP = UInt("b00100");
|
2016-06-01 04:25:31 +02:00
|
|
|
val M_FLUSH_ALL = UInt("b00101") // flush all lines
|
2015-07-28 11:46:23 +02:00
|
|
|
val M_XLR = UInt("b00110");
|
|
|
|
val M_XSC = UInt("b00111");
|
|
|
|
val M_XA_ADD = UInt("b01000");
|
|
|
|
val M_XA_XOR = UInt("b01001");
|
|
|
|
val M_XA_OR = UInt("b01010");
|
|
|
|
val M_XA_AND = UInt("b01011");
|
|
|
|
val M_XA_MIN = UInt("b01100");
|
|
|
|
val M_XA_MAX = UInt("b01101");
|
|
|
|
val M_XA_MINU = UInt("b01110");
|
|
|
|
val M_XA_MAXU = UInt("b01111");
|
|
|
|
val M_FLUSH = UInt("b10000") // write back dirty data and cede R/W permissions
|
|
|
|
val M_PRODUCE = UInt("b10001") // write back dirty data and cede W permissions
|
|
|
|
val M_CLEAN = UInt("b10011") // write back dirty data and retain R/W permissions
|
2012-11-16 11:37:56 +01:00
|
|
|
|
2015-07-28 11:46:23 +02:00
|
|
|
def isAMO(cmd: UInt) = cmd(3) || cmd === M_XA_SWAP
|
|
|
|
def isPrefetch(cmd: UInt) = cmd === M_PFR || cmd === M_PFW
|
2015-09-26 00:27:20 +02:00
|
|
|
def isRead(cmd: UInt) = cmd === M_XRD || cmd === M_XLR || cmd === M_XSC || isAMO(cmd)
|
2015-07-28 11:46:23 +02:00
|
|
|
def isWrite(cmd: UInt) = cmd === M_XWR || cmd === M_XSC || isAMO(cmd)
|
|
|
|
def isWriteIntent(cmd: UInt) = isWrite(cmd) || cmd === M_PFW || cmd === M_XLR
|
2012-10-16 03:52:48 +02:00
|
|
|
}
|
2016-06-28 20:21:38 +02:00
|
|
|
|