You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 line
589B

  1. package Ex0
  2. import chisel3._
  3. import chisel3.util.Counter
  4. class DotProd(val elements: Int) extends Module {
  5. val io = IO(
  6. new Bundle {
  7. val dataInA = Input(UInt(32.W))
  8. val dataInB = Input(UInt(32.W))
  9. val dataOut = Output(UInt(32.W))
  10. val outputValid = Output(Bool())
  11. }
  12. )
  13. /**
  14. * Your code here
  15. */
  16. val counter = Counter(elements)
  17. val accumulator = RegInit(UInt(32.W), 0.U)
  18. // Please don't manually implement product!
  19. val product = io.dataInA * io.dataInB
  20. // placeholder
  21. io.dataOut := 0.U
  22. io.outputValid := false.B
  23. }