QSysify
QSysify is a tool which is able to generate a QSys IP (tcl script) from a SpinalHDL component by analyzing its IO definition. It currently implement the following interfaces features :
主/从AvalonMM
主/从APB3
时钟域输入
复位输出
中断输入
导线(作为最后手段使用)
示例
以UART控制器为例:
case class AvalonMMUartCtrl(...) extends Component {
val io = new Bundle {
val bus = slave(AvalonMM(AvalonMMUartCtrl.getAvalonMMConfig))
val uart = master(Uart())
}
// ...
}
下面的 main
将生成Verilog和QSys TCL脚本,其中io.bus将作为AvalonMM总线,io.uart作为导线:
object AvalonMMUartCtrl {
def main(args: Array[String]) {
// Generate the Verilog
val toplevel = SpinalVerilog(AvalonMMUartCtrl(UartCtrlMemoryMappedConfig(...))).toplevel
// Add some tags to the avalon bus to specify it's clock domain (information used by QSysify)
toplevel.io.bus addTag(ClockDomainTag(toplevel.clockDomain))
// Generate the QSys IP (tcl script)
QSysify(toplevel)
}
}
添加新的接口支持
基本上,QSysify工具可以使用接口 emitter
列表进行设置 (如您在此处看到的) <https://github.com/SpinalHDL/SpinalHDL/blob/764193013f84cfe4f82d7d1f1739c4561ef65860/lib/src/main/scala/spinal/lib/eda/altera/QSys.scala#L12>
您可以通过创建一个扩展 QSysifyInterfaceEmiter 的新类来创建自己的发射器(emitter)