The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design Languages >> Verilog-AMS >> 2 analog events causing "Process stopped by UNIX signal 6" https://designers-guide.org/forum/YaBB.pl?num=1297701742 Message started by fabian on Feb 14th, 2011, 8:42am |
Title: 2 analog events causing "Process stopped by UNIX signal 6" Post by fabian on Feb 14th, 2011, 8:42am Dear All, I am hoping my problem is an interest for the forum. I have just been registered to our community and I wonder if I could have a tip on the following issue. My code is as follow: electrical in; parameter real V_th=0.0; parameter real ttol=10p; parameter integer dir=1; parameter integer flag_start=0; real t1, v_meas; analog begin @(cross(V(in)-V_th,dir,ttol)) begin t1=$abstime; flag_start <= 1; // $strobe("time: %g", t1); end @(timer(t1, 1u)) begin if (flag_start==1) begin v_meas = V(in); $strobe("value: %e", v_meas); end end This veriloga breaks the simulation with the message I have put in the subject. What I would like to implement is an event based on the outcome of an other. If I remove the condition "if", the two events are running without any issue but the second event is not waiting t1 value to be affected before to start. Thanks for your feedback and remarks, Fabian |
Title: Re: 2 analog events causing "Process stopped by UNIX signal 6" Post by Geoffrey_Coram on Feb 14th, 2011, 10:21am There's something odd about what you typed: parameter integer flag_start=0; ... flag_start <= 1; What's this line doing? You can't change the value of a parameter from within the module. |
Title: Re: 2 analog events causing "Process stopped by UNIX signal 6" Post by fabian on Feb 14th, 2011, 3:12pm Hi Goeffrey, This line is to change the flag value once the first even is true. The second event could then to effectively something as the if statement become true with the flag equal to 1. So should I change my line to be integer flag_start=0; or should I initialize under initial bengin end Regards, Fabian |
Title: Re: 2 analog events causing "Process stopped by UNIX signal 6" Post by Geoffrey_Coram on Feb 15th, 2011, 5:11am I would do integer flag_start; and then in the analog block, @(initial_step) flag_start = 0; I'm not sure that initialization as part of the declaration statement is supported by all simulators. Variables are initialized to zero automatically, per the LRM, but it's more clear to the reader if you show the initialization. |
Title: Re: 2 analog events causing "Process stopped by UNIX signal 6" Post by fabian on Feb 17th, 2011, 4:01am Hi Geoffrey, Thanks is work. My code looks like now electrical in; parameter real V_th=0.0; parameter real ttol=10p; parameter integer dir=1; parameter integer flag_start=0; real t1, v_meas; analog begin @(cross(V(in)-V_th,dir,ttol)) begin flag_start = 1; end @(timer(0, 1u)) begin if (flag_start==1) begin v_meas = V(in); end end What I do not understand it is why I have to start an event (@timer ) from 0us and do nothing until the flag is true instead of having this event starting from a time t1 as shown in my first code. Thanks Fabian |
Title: Re: 2 analog events causing "Process stopped by UNIX signal 6" Post by Geoffrey_Coram on Feb 17th, 2011, 6:57am Did you try setting t1 to 1e6 (or something large) @(initial_step)? Then the cross will set t1 to a value that will be hit. |
Title: Re: 2 analog events causing "Process stopped by UNIX signal 6" Post by fabian on Feb 17th, 2011, 8:28am Thanks it works. I understand that I need to put t1=$abstime+10n instead of t1=$abstime; otherwise the event @timer does not start. Thanks it closed the issue, I believe. |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |