在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2554|回复: 0

[求助] how to use "fine-grain process" in systemverilog

[复制链接]
发表于 2011-3-26 21:44:36 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
In systemverilog LRM, fine-grain process control is described as:

A process is a built-in class that allows one process to access and control another process once it has started.
Users can declare variables of type process and safely pass them through tasks or incorporate them into other
objects.
Objects of type process are created internally when processes are spawned. Users cannot create objects of type
process; attempts to call
new shall not create a new process, and instead result in an error. The process class
cannot be extended. Attempts to extend it shall result in a compilation error. Objects of type process are
unique; they become available for reuse once the underlying process terminates and all references to the object
are discarded.

and the exampe in LRM is:

task do_n_way( int N );
process job[1:N];
  for ( int j = 1; j <= N; j++ )
    fork
      automatic int k = j;
      begin job[j] = process::self(); ... ; end
    join_none

  for( int j = 1; j <= N; j++ )// wait for all processes to start
    wait( job[j] != null );

  job[1].await();                         // wait for first process to finish

for ( int k = 1; k <= N; k++ ) begin
  if ( job[k].status != process::FINISHED )
    job[k].kill();
  end
endtask

I wrote my own code as following, but it did not work. I don't know why. Could any one can give me some suggetions?

module
...
...
process job_cpu;
initial
begin
  c_flag = 0;
  mem_value = 0;
  #10ns;
  $monitor("%t: mem_value = %0d ", $time,mem_value);
  #10ns;
  job_cpu = process::self();
  cpu_main();
  #10ns;
  $finish;
end

...
...
endmodule

The simulation information is:

process job_cpu;
         |
ncvlog: *E,NOIPRT (top.sv,14|14): Unrecognized declaration 'job_cpu' could be a spelling mistake [SystemVerilog].

It seems that the process is not recognized by the tool. Should I add some special statement before using the "process"??
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /3 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-19 19:56 , Processed in 0.020299 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表