You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experimenting around to bring a simple API to build composable component in a similar way to NaxRiscv.
Here is an example :
importspinal.lib.misc.composable._classVexiiRiscvextendsComponent{
valhost=newServiceHost//Will host all the VexiiRiscv plugins
}
// Provide other plugins a way to get an interface to change the program counterclassPcPluginextendsPlugin {
valjumps=ArrayBuffer[Flow[UInt]]()
vallogic= during build newArea {
valpc=Reg(UInt(32 bits)) init(0)
for(jump <- jumps) when(jump.valid){ pc := jump.payload}
}
}
// Will implement jumps, by using an intreface from PcPlugin to set the program counter classJumpPluginextendsPlugin {
valsetup= during setup newArea{
Service[PcPlugin].retain()
}
vallogic= during build newArea {
valjump=Flow(UInt(32 bits))
Service[PcPlugin].jumps += jump
Service[PcPlugin].release()
}
}
classTopLevelextendsComponent {
valvexii=newVexiiRiscv// setHost(vexii.host) will specify the the "during xxx new Area{ ... }" will be executed in the vexii contextnewPcPlugin().setHost(vexii.host)
newJumpPlugin().setHost(vexii.host)
}
valreport=SpinalVerilog(newTopLevel).printRtl()
println(report.toplevel.vexii.host[PcPlugin])
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm experimenting around to bring a simple API to build composable component in a similar way to NaxRiscv.
Here is an example :
It is currently based on https://github.com/SpinalHDL/SpinalHDL/tree/composable-exp/lib/src/main/scala/spinal/lib/misc/composable
Beta Was this translation helpful? Give feedback.
All reactions