Skip to content

Issue313 chiselgen vec chiselvecs#314

Open
mattfel1 wants to merge 20 commits intomasterfrom
issue313_chiselgen_vec_chiselvecs
Open

Issue313 chiselgen vec chiselvecs#314
mattfel1 wants to merge 20 commits intomasterfrom
issue313_chiselgen_vec_chiselvecs

Conversation

@mattfel1
Copy link
Member

No description provided.

val idx = trues.head._2
vals(idx).unbox
}
// else if (sels.exists{case Literal(true) => true; case _ => false}) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remind me what was wrong with this?

emit(src"lazy val w$i = Access(${w.hashCode}, ${w.port.muxPort}, ${w.port.muxOfs}, ${w.port.castgroup.mkString("List(",",",")")}, ${w.port.broadcast.mkString("List(",",",")")}, ${w.shiftAxis}, PortInfo(${w.port.bufferPort}, ${1 max w.accessWidth}, ${1 max ofsWidth}, ${banksWidths.map(1 max _).mkString("List(",",",")")}, ${bitWidth(mem.tp.typeArgs.head)}, $resids))")
}
if (mem.writers.isEmpty) {emit(src"val w0 = AccessHelper.singular(32)")}
if (mem.writers.isEmpty) {emit(src"lazy val w0 = AccessHelper.singular(32)")}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the advantage of making these lazy vals?

warn(s"Detected potential write conflicts on ${a.access.ctx} (uid: ${a.unroll}) and ${conflicts.head.access.ctx} (uid: ${conflicts.head.unroll}) to memory ${mem.ctx} (${mem.name.getOrElse("")})")
warn(s" These are technically unbankable but you signed the waiver (by adding .conflictable) that says you know what you are doing")
// warn(s"Detected potential write conflicts on ${a.access.ctx} (uid: ${a.unroll}) and ${conflicts.head.access.ctx} (uid: ${conflicts.head.unroll}) to memory ${mem.ctx} (${mem.name.getOrElse("")})")
// warn(s" These are technically unbankable but you signed the waiver (by adding .conflictable) that says you know what you are doing")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were these warns removed on purpose?

readsAfter.foreach{r =>
val dist = paths(regWrite).toInt - paths(r).toInt
warn(s"Avoid reading register (${reg.name.getOrElse("??")}) after writing to it in the same inner loop, if this is not an accumulation (write: ${regWrite.ctx}, read: ${r.ctx})")
// warn(s"Avoid reading register (${reg.name.getOrElse("??")}) after writing to it in the same inner loop, if this is not an accumulation (write: ${regWrite.ctx}, read: ${r.ctx})")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed temporarily to prevent spam?

assert(getArg(z0) == 3)
assert(getArg(z1) == 5)
}
} No newline at end of file
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test is already in VecTypes.scala in master so this file can be dropped

val otherUInt: UInt = other.asUInt
vec := otherUInt.asTypeOf(vec)
}
}
Copy link
Member Author

@mattfel1 mattfel1 Oct 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, this means we can change my recent update for vecs in structs:

    case FieldApply(struct, field) =>
      emit(createWire(quote(lhs),remap(lhs.tp)))
      val (start, end) = getField(struct.tp, field)
      lhs.tp match {
        case v: Vec[_] => emit(src"$lhs.toSeq.zipWithIndex.foreach{case (fa, i) => fa := $struct($start, $end + (${v.size - 1} - i) * ${bitWidth(v.typeArgs.head)})}")
        case _ => emit(src"$lhs.r := $struct($start, $end)")
      }

to just $lhs := $struct($start, $end) for the case of a Vec field?

Or is this UIntlike trait used in a different way somewhere that I missed?

# Conflicts:
#	fringe/src/fringe/utils/implicits.scala
…s' into issue313_chiselgen_vec_chiselvecs

# Conflicts:
#	test/spatial/tests/compiler/VecInStruct.scala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants