1
0

tile: BaseTile refactor, pt 1

* Make dts generation reusable across tile subclasses
* First attempt to standardize tile IO nodes and connect methods
* hartid => hartId when talking about scala Ints
This commit is contained in:
Henry Cook
2017-12-20 17:18:38 -08:00
parent ba6dd160a3
commit 1cd018546c
18 changed files with 210 additions and 189 deletions

View File

@ -31,6 +31,25 @@ package object diplomacy
}
}
type PropertyOption = Option[(String, Seq[ResourceValue])]
type PropertyMap = Iterable[(String, Seq[ResourceValue])]
implicit class IntToProperty(x: Int) {
def asProperty: Seq[ResourceValue] = Seq(ResourceInt(BigInt(x)))
}
implicit class BigIntToProperty(x: BigInt) {
def asProperty: Seq[ResourceValue] = Seq(ResourceInt(x))
}
implicit class StringToProperty(x: String) {
def asProperty: Seq[ResourceValue] = Seq(ResourceString(x))
}
implicit class DeviceToPeroperty(x: Device) {
def asProperty: Seq[ResourceValue] = Seq(ResourceReference(x.label))
}
def EnableMonitors[T](body: Parameters => T)(implicit p: Parameters) = body(p.alterPartial {
case MonitorsEnabled => true
})