
上QQ阅读APP看本书,新人免费读10天
设备和账号都新为新人
2.1.7 如何将队列插入到另外一个队列中?
在使用中容易出现这种不恰当的用法,q1.insert(x,q2),即在q1的index=x处,插入队列q2。在实际使用中,有的仿真器可以支持而有的仿真器并不能支持该种使用方法。IEEE-1800 SystemVerilog-2017的语法要求queue::insert(index,element)的第二个参数应该为队列中的单个元素,而不是某个队列。
关键词:
queue 队列,insert 插入队列
避坑指南:
我们还可以通过'{ }'拼接操作符实现队列的插入。
参考代码:sv_queue_insert.sv

仿真结果:

阅读手记: