Specman e 等待线程完成(非耗时方法)

Specman e wait until threads finish (non time consuming method)

有没有办法让 unit3.thread() 在其他两个线程之后变为 运行?

run() is also
{
    start unit1.thread();
    start unit2.thread();
    unit3.thread();
};

我希望单元 1 和单元 2 中的线程并行 运行,线程 3 在它们都完成后并行 运行。然而,由于 运行() 不是一个耗时的方法解决方案,例如:

all of
{
    {
        unit1.thread();
    };
    {
        unit2.thread();
    }
};
unit3.thread();

不允许。

有没有办法让 unit3.thread() 等到前面的线程完成?

您可以通过在 unit1unit2 完成时手动触发事件来完成此操作:

extend sys {
   event u1_done;
   event u2_done;
   run() is also {
     all of {
       { unit1.thread(); }
       { unit2.thread(); }
     };
   };
   on @u1_done and @u2_done unit3.thread();
};

然后在 unit1unit2 完成后发出这些语句:

emit u1_done;

unit2:

emit u2_done;

我现在无法访问 Specman,因此语法可能不准确,但我已经使用了这种技术。