tilelink2: move general-purpose code out of tilelink2 package
This commit is contained in:
@ -4,8 +4,8 @@ package util
|
||||
|
||||
import Chisel._
|
||||
import cde._
|
||||
import diplomacy.LazyModule
|
||||
import java.io.{File, FileWriter}
|
||||
import uncore.tilelink2.LazyModule
|
||||
|
||||
/** Representation of the information this Generator needs to collect from external sources. */
|
||||
case class ParsedInputNames(
|
||||
|
21
src/main/scala/util/GenericParameterizedBundle.scala
Normal file
21
src/main/scala/util/GenericParameterizedBundle.scala
Normal file
@ -0,0 +1,21 @@
|
||||
// See LICENSE for license details.
|
||||
|
||||
package util
|
||||
|
||||
import Chisel._
|
||||
|
||||
abstract class GenericParameterizedBundle[T <: Object](val params: T) extends Bundle
|
||||
{
|
||||
override def cloneType = {
|
||||
try {
|
||||
this.getClass.getConstructors.head.newInstance(params).asInstanceOf[this.type]
|
||||
} catch {
|
||||
case e: java.lang.IllegalArgumentException =>
|
||||
throw new Exception("Unable to use GenericParameterizedBundle.cloneType on " +
|
||||
this.getClass + ", probably because " + this.getClass +
|
||||
"() takes more than one argument. Consider overriding " +
|
||||
"cloneType() on " + this.getClass, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user