1
0

Make compatible with scala 2.10. List.sort deprecated. Refactor constants into package object.

This commit is contained in:
Henry Cook 2013-07-23 20:26:17 -07:00
parent 5c00d0a030
commit 9abdf4e154
22 changed files with 22 additions and 60 deletions

View File

@ -1,8 +1,6 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import uncore._ import uncore._
class HellaCacheArbiter(n: Int)(implicit conf: RocketConfiguration) extends Component class HellaCacheArbiter(n: Int)(implicit conf: RocketConfiguration) extends Component

View File

@ -56,12 +56,6 @@ trait InterruptConstants {
val CAUSE_INTERRUPT = 32 val CAUSE_INTERRUPT = 32
} }
abstract trait RocketDcacheConstants extends uncore.constants.CacheConstants with uncore.constants.AddressConstants {
require(OFFSET_BITS == log2Up(uncore.Constants.CACHE_DATA_SIZE_IN_BYTES))
require(OFFSET_BITS <= uncore.Constants.ACQUIRE_WRITE_MASK_BITS)
require(log2Up(OFFSET_BITS) <= uncore.Constants.ACQUIRE_SUBWORD_ADDR_BITS)
}
trait VectorOpConstants { trait VectorOpConstants {
val VEC_X = Bits("b??", 2).toUFix val VEC_X = Bits("b??", 2).toUFix
val VEC_FN_N = UFix(0, 2) val VEC_FN_N = UFix(0, 2)

View File

@ -1,9 +1,8 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import hwacha._ import hwacha._
import uncore.constants.MemoryOpConstants._
import Util._ import Util._
class RocketIO(implicit conf: RocketConfiguration) extends Bundle class RocketIO(implicit conf: RocketConfiguration) extends Bundle

View File

@ -1,10 +1,9 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import Instructions._ import Instructions._
import hwacha._ import hwacha._
import uncore.constants.MemoryOpConstants._
import ALU._ import ALU._
import Util._ import Util._

View File

@ -1,8 +1,6 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import Instructions._ import Instructions._
import hwacha.Constants._ import hwacha.Constants._

View File

@ -88,7 +88,7 @@ object Simplify
for (p <- r; if p.prime) for (p <- r; if p.prime)
prime = p :: prime prime = p :: prime
} }
prime.sort(_<_) prime.sortWith(_<_)
} }
def getEssentialPrimeImplicants(prime: Seq[Term], minterms: Seq[Term]): (Seq[Term],Seq[Term],Seq[Term]) = { def getEssentialPrimeImplicants(prime: Seq[Term], minterms: Seq[Term]): (Seq[Term],Seq[Term],Seq[Term]) = {
for (i <- 0 until prime.size) { for (i <- 0 until prime.size) {
@ -116,7 +116,7 @@ object Simplify
val ca = getCost(a, bits) val ca = getCost(a, bits)
val cb = getCost(b, bits) val cb = getCost(b, bits)
def listLess(a: List[Term], b: List[Term]): Boolean = !b.isEmpty && (a.isEmpty || a.head < b.head || a.head == b.head && listLess(a.tail, b.tail)) def listLess(a: List[Term], b: List[Term]): Boolean = !b.isEmpty && (a.isEmpty || a.head < b.head || a.head == b.head && listLess(a.tail, b.tail))
ca < cb || ca == cb && listLess(a.sort(_<_), b.sort(_<_)) ca < cb || ca == cb && listLess(a.sortWith(_<_), b.sortWith(_<_))
} }
def getCover(implicants: Seq[Term], minterms: Seq[Term], bits: Int) = { def getCover(implicants: Seq[Term], minterms: Seq[Term], bits: Int) = {
if (minterms.nonEmpty) { if (minterms.nonEmpty) {
@ -179,7 +179,7 @@ object SimplifyDC
for (p <- r; if p.prime) for (p <- r; if p.prime)
prime = p :: prime prime = p :: prime
} }
prime.sort(_<_) prime.sortWith(_<_)
} }
def verify(cover: Seq[Term], minterms: Seq[Term], maxterms: Seq[Term]) = { def verify(cover: Seq[Term], minterms: Seq[Term], maxterms: Seq[Term]) = {

View File

@ -1,8 +1,6 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import ALU._ import ALU._
import Util._ import Util._

View File

@ -1,11 +1,10 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import Instructions._ import Instructions._
import Util._ import Util._
import hwacha._ import hwacha._
import uncore.constants.AddressConstants._
class Datapath(implicit conf: RocketConfiguration) extends Component class Datapath(implicit conf: RocketConfiguration) extends Component
{ {

View File

@ -2,7 +2,6 @@ package rocket
import Chisel._ import Chisel._
import Node._ import Node._
import Constants._
import Instructions._ import Instructions._
object ALU object ALU

View File

@ -1,10 +1,10 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import scala.math._
import Util._ import Util._
import Node._
import uncore.constants.AddressConstants._
import scala.math._
class DpathBTBIO extends Bundle class DpathBTBIO extends Bundle
{ {

View File

@ -2,7 +2,6 @@ package rocket
import Chisel._ import Chisel._
import Node._ import Node._
import Constants._
import Instructions._ import Instructions._
import hwacha.Constants._ import hwacha.Constants._

View File

@ -1,7 +1,6 @@
package rocket package rocket
import Chisel._ import Chisel._
import Constants._
import uncore._ import uncore._
import Util._ import Util._

View File

@ -1,11 +1,10 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import Instructions._ import Instructions._
import Util._ import Util._
import FPConstants._ import FPConstants._
import uncore.constants.MemoryOpConstants._
object FPConstants object FPConstants
{ {

View File

@ -2,7 +2,6 @@ package rocket
import Chisel._ import Chisel._
import Node._ import Node._
import Constants._
import uncore._ import uncore._
import Util._ import Util._

View File

@ -1,8 +1,6 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import uncore._ import uncore._
import Util._ import Util._

View File

@ -2,7 +2,6 @@ package rocket
import Chisel._ import Chisel._
import Node._ import Node._
import Constants._
object Instructions object Instructions
{ {

View File

@ -1,8 +1,6 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import ALU._ import ALU._
class MultiplierReq(implicit conf: RocketConfiguration) extends Bundle { class MultiplierReq(implicit conf: RocketConfiguration) extends Bundle {

View File

@ -1,8 +1,6 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import uncore._ import uncore._
import Util._ import Util._
@ -12,6 +10,9 @@ case class DCacheConfig(sets: Int, ways: Int, co: CoherencePolicy,
narrowRead: Boolean = true, narrowRead: Boolean = true,
reqtagbits: Int = -1, databits: Int = -1) reqtagbits: Int = -1, databits: Int = -1)
{ {
require(OFFSET_BITS == log2Up(CACHE_DATA_SIZE_IN_BYTES))
require(OFFSET_BITS <= ACQUIRE_WRITE_MASK_BITS)
require(log2Up(OFFSET_BITS) <= ACQUIRE_SUBWORD_ADDR_BITS)
require(isPow2(sets)) require(isPow2(sets))
require(isPow2(ways)) // TODO: relax this require(isPow2(ways)) // TODO: relax this
def lines = sets*ways def lines = sets*ways

View File

@ -1,18 +1,7 @@
package rocket package object rocket extends
import rocket.constants._ rocket.constants.ScalarOpConstants with
rocket.constants.InterruptConstants with
import Chisel._ rocket.constants.VectorOpConstants
import scala.math._
//TODO: When compiler bug SI-5604 is fixed in 2.10, change object Constants to
// package object rocket and remove import Constants._'s from other files
object Constants extends
ScalarOpConstants with
uncore.constants.MemoryOpConstants with
InterruptConstants with
RocketDcacheConstants with
VectorOpConstants with
uncore.constants.MemoryInterfaceConstants
{ {
val START_ADDR = 0x2000 val START_ADDR = 0x2000
} }

View File

@ -1,8 +1,8 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._ import uncore.constants.AddressConstants._
import Constants._ import uncore.constants.MemoryOpConstants._
import Util._ import Util._
class TLBPTWIO extends Bundle { class TLBPTWIO extends Bundle {

View File

@ -1,8 +1,6 @@
package rocket package rocket
import Chisel._ import Chisel._
import Node._
import Constants._
import uncore._ import uncore._
import Util._ import Util._

View File

@ -1,9 +1,8 @@
package rocket package rocket
import Chisel._; import Chisel._
import Node._; import uncore.constants.AddressConstants._
import Constants._; import scala.math._
import scala.math._;
class ioCAM(entries: Int, addr_bits: Int, tag_bits: Int) extends Bundle { class ioCAM(entries: Int, addr_bits: Int, tag_bits: Int) extends Bundle {
val clear = Bool(INPUT); val clear = Bool(INPUT);