Merge pull request #1059 from freechipsproject/add-supports-atomics-property
Add atomics support to DTS JSON file.
This commit is contained in:
commit
3b36dda9e1
@ -165,7 +165,7 @@ abstract class BaseCoreplexModule[+L <: BaseCoreplex](_outer: L) extends BareCor
|
||||
private val ranges = collect(Nil, outer.bindingTree).groupBy(_._2).toList.flatMap { case (key, seq) =>
|
||||
AddressRange.fromSets(key.address).map { r => (r, key.permissions, seq.map(_._1)) }
|
||||
}.sortBy(_._1)
|
||||
private val json = ranges.map { case (range, ResourcePermissions(r, w, x, c), names) =>
|
||||
private val json = ranges.map { case (range, ResourcePermissions(r, w, x, c, a), names) =>
|
||||
println(fmt.format(
|
||||
range.base,
|
||||
range.base+range.size,
|
||||
@ -173,8 +173,9 @@ abstract class BaseCoreplexModule[+L <: BaseCoreplex](_outer: L) extends BareCor
|
||||
if (w) 'W' else ' ',
|
||||
if (x) 'X' else ' ',
|
||||
if (c) 'C' else ' ',
|
||||
if (a) 'A' else ' ',
|
||||
names.mkString(", ")))
|
||||
s"""{"base":[${range.base}],"size":[${range.size}],"r":[$r],"w":[$w],"x":[$x],"c":[$c],"names":[${names.map('"'+_+'"').mkString(",")}]}"""
|
||||
s"""{"base":[${range.base}],"size":[${range.size}],"r":[$r],"w":[$w],"x":[$x],"c":[$c],"a":[$a],"names":[${names.map('"'+_+'"').mkString(",")}]}"""
|
||||
}
|
||||
println("")
|
||||
ElaborationArtefacts.add("memmap.json", s"""{"mapping":[${json.mkString(",")}]}""")
|
||||
|
@ -26,12 +26,12 @@ object JSON
|
||||
}
|
||||
|
||||
private def helper(res: ResourceValue)(implicit path: Map[String, String]): Seq[String] = res match {
|
||||
case ResourceAddress(address, ResourcePermissions(r, w, x, c)) =>
|
||||
case ResourceAddress(address, ResourcePermissions(r, w, x, c, a)) =>
|
||||
AddressRange.fromSets(address).map { case AddressRange(base, size) =>
|
||||
s"""{"base":${base},"size":${size},"r":${r},"w":${w},"x":${x},"c":${c}}"""}
|
||||
case ResourceMapping(address, offset, ResourcePermissions(r, w, x, c)) =>
|
||||
s"""{"base":${base},"size":${size},"r":${r},"w":${w},"x":${x},"c":${c},"a":${a}}"""}
|
||||
case ResourceMapping(address, offset, ResourcePermissions(r, w, x, c, a)) =>
|
||||
AddressRange.fromSets(address).map { case AddressRange(base, size) =>
|
||||
s"""{"base":${base},"size":${size},"offset":${offset},"r":${r},"w":${w},"x":${x},"c":${c}}"""}
|
||||
s"""{"base":${base},"size":${size},"offset":${offset},"r":${r},"w":${w},"x":${x},"c":${c},"a":${a}}"""}
|
||||
case ResourceInt(value) => Seq(value.toString)
|
||||
case ResourceString(value) => Seq("\"" + value + "\"")
|
||||
case ResourceReference(value) => Seq("\"&" + path(value) + "\"")
|
||||
|
@ -12,8 +12,9 @@ sealed trait ResourceValue
|
||||
* @param w writable.
|
||||
* @param x executable.
|
||||
* @param c cacheable.
|
||||
* @param a supports all atomic operations.
|
||||
*/
|
||||
case class ResourcePermissions(r: Boolean, w: Boolean, x: Boolean, c: Boolean) // Not part of DTS
|
||||
case class ResourcePermissions(r: Boolean, w: Boolean, x: Boolean, c: Boolean, a: Boolean) // Not part of DTS
|
||||
|
||||
/** An address space description.
|
||||
* @param address the address space.
|
||||
|
@ -64,7 +64,8 @@ case class TLManagerParameters(
|
||||
r = supportsAcquireB || supportsGet,
|
||||
w = supportsAcquireT || supportsPutFull,
|
||||
x = executable,
|
||||
c = regionType >= RegionType.UNCACHED))
|
||||
c = regionType >= RegionType.UNCACHED,
|
||||
a = supportsArithmetic && supportsLogical))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user