SystemVerilog中是否有连接字符串队列的函数?

时间:2019-03-20 19:02:52

标签: system-verilog

通常,人们可以这样做:

string a;
a = {a, " first"};
a = {a, " second"};
a = {a, " third"};

据我了解,这意味着a每次都为连接的字符串连续重新分配。是否有一个神奇的join函数可以像这样工作,使其性能更高?

string a;
string a_q[$];
a_q = '{"first", "second", "third"};
a = a_q.join(); // a = {a_q} doesn't work as {a_q} returns another queue;

1 个答案:

答案 0 :(得分:0)

您可以使用位流投射:(LRM第6.24.3节“位流投射”)

a = string'(a_q);