Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add reset to the Queue chisel class

Tags:

chisel

I am trying to use the chisel Queue class and want to be able to flush it on reset. It seems that in the past there was an option for a reset in the Class constructor

@deprecated("Module constructor with override _reset deprecated, use withReset", "chisel3")
  def this(gen: T, entries: Int, pipe: Boolean, flow: Boolean, _reset: Bool)

However, as the deprecation message implies I should use withReset. how do I do that ?
this question from 3 years ago is similar but the answer suggest to use _reset argumnet which is now deprecated.

like image 395
user3567895 Avatar asked Dec 01 '25 22:12

user3567895


1 Answers

That deprecation method is referring to withReset. The (Spartan) API documentation can be found here and the source code is located here. Additionally, there's a discussion of multiple clock domains on the Chisel3 Wiki that gives some example usages.

These methods enable you to change which clock, reset, or clock and reset are used within a block of code. If you want to change which reset is used, something like the following will do that:

import chisel3.experimental.withReset
// ...

  withReset(myReset) {
    // Anything in here will be reset to myReset
  }

For a more detailed example, the MultiClockSpec tests provide some concrete examples. See: src/test/scala/chiselTests/MultiClockSpec.scala.

like image 68
seldridge Avatar answered Dec 08 '25 06:12

seldridge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!