| Login | | Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name. | |
| Who's Online | There are currently, 50 guest(s) and 0 member(s) that are online.
You are Anonymous user. You can register for free by clicking here | |
 | |
|
Verification Guild: Forums |
|
| View previous topic :: View next topic |
| Author |
Message |
Monkey_man Junior


Joined: Oct 07, 2008 Posts: 6
|
Posted: Tue May 08, 2012 11:14 pm Post subject: VCS support for passing time variables to a function |
|
|
Does VCS support passing SystemVerilog variables of type "time" to functions? When I try the snippet below the variable "t" in function "huh" is always 0, even though the value I'm passing in is 2us. This code in Questa displays the expected "2000". Am I missing something? What clean alternatives are there to passing "time" data types to a function in VCS?
VCS Compiler version E-2011.03-SP1
module top;
reg clk;
time k = 2us;
initial begin
huh(k);
end
function void huh(time t);
$display("time %t", t);
endfunction
endmodule
Thanks in advance... |
|
| Back to top |
|
 |
Monkey_man Junior


Joined: Oct 07, 2008 Posts: 6
|
Posted: Tue May 08, 2012 11:50 pm Post subject: |
|
|
| I figured out that in VCS you need to specify the timeunit and timeprecision for the time variable scale to be correct. I must have used different default values for timeunit & precision in my VCS vs Questa sims, hence the different results. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|