Verification Guild
A Community of Verification Professionals

 Create an AccountHome | Calendar | Downloads | FAQ | Links | Site Admin | Your Account  

Login
Nickname

Password

Security Code: Security Code
Type Security Code
BACKWARD

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.

Modules
· Home
· Downloads
· FAQ
· Feedback
· Recommend Us
· Web Links
· Your Account

Advertising

Who's Online
There are currently, 53 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here

  
Verification Guild: Forums

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile  ProfileDigest    Log inLog in 

VCS support for passing time variables to a function

 
Post new topic   Reply to topic    Verification Guild Forum Index -> Main
View previous topic :: View next topic  
Author Message
Monkey_man
Junior
Junior


Joined: Oct 07, 2008
Posts: 6

PostPosted: Tue May 08, 2012 11:14 pm    Post subject: VCS support for passing time variables to a function Reply with quote

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
View user's profile
Monkey_man
Junior
Junior


Joined: Oct 07, 2008
Posts: 6

PostPosted: Tue May 08, 2012 11:50 pm    Post subject: Reply with quote

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
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Verification Guild Forum Index -> Main All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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
Verification Guild © 2006 Janick Bergeron
Web site engine's code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.162 Seconds