X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmain%2Fscala%2Fdevices%2Fmockaon%2FMockAONPeriphery.scala;h=91fa4fb93273e509c194f77e84142bcdb3f4f528;hb=d4bb8a77ea7a0a9545dcaf93a4a2a32671c2dd47;hp=1f99c313dfe3351ec705274f071e9118e265a5dd;hpb=79f64de12cac914c0c195dc876f34adcaf15f7d5;p=sifive-blocks.git diff --git a/src/main/scala/devices/mockaon/MockAONPeriphery.scala b/src/main/scala/devices/mockaon/MockAONPeriphery.scala index 1f99c31..91fa4fb 100644 --- a/src/main/scala/devices/mockaon/MockAONPeriphery.scala +++ b/src/main/scala/devices/mockaon/MockAONPeriphery.scala @@ -3,20 +3,14 @@ package sifive.blocks.devices.mockaon import Chisel._ import config.Field -import coreplex.CoreplexRISCVPlatform -import diplomacy.LazyModule -import rocketchip.{ - HasTopLevelNetworks, - HasTopLevelNetworksBundle, - HasTopLevelNetworksModule -} +import diplomacy.{LazyModule, LazyMultiIOModuleImp} +import rocketchip.{HasSystemNetworks, HasCoreplexRISCVPlatform} import uncore.tilelink2.{IntXing, TLAsyncCrossingSource, TLFragmenter} +import util.ResetCatchAndSync case object PeripheryMockAONKey extends Field[MockAONParams] -trait HasPeripheryMockAON extends HasTopLevelNetworks { - val coreplex: CoreplexRISCVPlatform - +trait HasPeripheryMockAON extends HasSystemNetworks with HasCoreplexRISCVPlatform { // We override the clock & Reset here so that all synchronizers, etc // are in the proper clock domain. val mockAONParams= p(PeripheryMockAONKey) @@ -27,15 +21,18 @@ trait HasPeripheryMockAON extends HasTopLevelNetworks { intBus.intnode := aon_int.intnode } -trait HasPeripheryMockAONBundle extends HasTopLevelNetworksBundle { - val aon = new MockAONWrapperBundle() +trait HasPeripheryMockAONBundle { + val aon: MockAONWrapperBundle + def coreResetCatchAndSync(core_clock: Clock) = { + ResetCatchAndSync(core_clock, aon.rsts.corerst, 20) + } } -trait HasPeripheryMockAONModule extends HasTopLevelNetworksModule { +trait HasPeripheryMockAONModuleImp extends LazyMultiIOModuleImp with HasPeripheryMockAONBundle { val outer: HasPeripheryMockAON - val io: HasPeripheryMockAONBundle + val aon = IO(new MockAONWrapperBundle) - io.aon <> outer.aon.module.io + aon <> outer.aon.module.io // Explicit clock & reset are unused in MockAONWrapper. // Tie to check this assumption.