Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to only modify certain one reset kind of specific Reg in vex core. #404

Open
littlezpf666 opened this issue Apr 22, 2024 · 1 comment

Comments

@littlezpf666
Copy link

I need to change a reg reset kind to SYNC in vex core. So, I try to implement by using ClockDomain object according to SpinalHDL docs.

  val decodePc_Domain = ClockDomain(ClockDomain.current.readClockWire,ClockDomain.current.readResetWire,
    config = ClockDomainConfig(
      clockEdge = RISING,
      resetKind = spinal.core.SYNC,
      resetActiveLevel = LOW
    )
  )

  val decodePc_Area = new ClockingArea(decodePc_Domain) {
    val pcReg = Reg(UInt(32 bits)) init (if (resetVector != null) resetVector else externalResetVector) addAttribute (Verilator.public)
  }

But it reports clock crossing violation error now.
CLOCK CROSSING VIOLATION :

  • Source : (toplevel/IBusCachedPlugin_decodePc_decodePc_Area_pcReg : UInt[32 bits]) vexriscv.plugin.IBusFetcherImpl$FetchArea$$anonfun$33$$anon$6$$anon$2$$anonfun$34.apply(Fetcher.scala:276)
  • Source clock : (toplevel/clk : in Bool)
  • Destination : (toplevel/IBusCachedPlugin_fetchPc_pcReg : UInt[32 bits]) vexriscv.plugin.IBusFetcherImpl$FetchArea$$anon$5$$anonfun$30.apply(Fetcher.scala:198)
  • Destination clock : (clk : Bool)
    Could you tell me how to only modify one specific Reg's reset kind and how to use clock domain correctly?
@Dolu1990
Copy link
Member

Hi,

ClockDomain.current.readClockWire,ClockDomain.current.readResetWire

The following will be detected properly :
ClockDomain.current.clock,ClockDomain.current.reset

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

No branches or pull requests

2 participants