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
import Chisel._
import Node._
import Constants._
import uncore._
class HellaCacheArbiter(n: Int)(implicit conf: RocketConfiguration) extends Component

View File

@ -56,12 +56,6 @@ trait InterruptConstants {
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 {
val VEC_X = Bits("b??", 2).toUFix
val VEC_FN_N = UFix(0, 2)

View File

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

View File

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

View File

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

View File

@ -88,7 +88,7 @@ object Simplify
for (p <- r; if p.prime)
prime = p :: prime
}
prime.sort(_<_)
prime.sortWith(_<_)
}
def getEssentialPrimeImplicants(prime: Seq[Term], minterms: Seq[Term]): (Seq[Term],Seq[Term],Seq[Term]) = {
for (i <- 0 until prime.size) {
@ -116,7 +116,7 @@ object Simplify
val ca = getCost(a, 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))
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) = {
if (minterms.nonEmpty) {
@ -179,7 +179,7 @@ object SimplifyDC
for (p <- r; if p.prime)
prime = p :: prime
}
prime.sort(_<_)
prime.sortWith(_<_)
}
def verify(cover: Seq[Term], minterms: Seq[Term], maxterms: Seq[Term]) = {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,8 +1,6 @@
package rocket
import Chisel._
import Node._
import Constants._
import uncore._
import Util._
@ -12,6 +10,9 @@ case class DCacheConfig(sets: Int, ways: Int, co: CoherencePolicy,
narrowRead: Boolean = true,
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(ways)) // TODO: relax this
def lines = sets*ways

View File

@ -1,18 +1,7 @@
package rocket
import rocket.constants._
import Chisel._
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
package object rocket extends
rocket.constants.ScalarOpConstants with
rocket.constants.InterruptConstants with
rocket.constants.VectorOpConstants
{
val START_ADDR = 0x2000
}

View File

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

View File

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

View File

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