The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 19th, 2024, 2:37pm
Pages: 1
Send Topic Print
2 analog events causing "Process stopped by UNIX signal 6" (Read 4849 times)
fabian
Junior Member
**
Offline



Posts: 19
Europe
2 analog events causing "Process stopped by UNIX signal 6"
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
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: 2 analog events causing "Process stopped by UNIX signal 6"
Reply #1 - 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.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
fabian
Junior Member
**
Offline



Posts: 19
Europe
Re: 2 analog events causing "Process stopped by UNIX signal 6"
Reply #2 - 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
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: 2 analog events causing "Process stopped by UNIX signal 6"
Reply #3 - 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.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
fabian
Junior Member
**
Offline



Posts: 19
Europe
Re: 2 analog events causing "Process stopped by UNIX signal 6"
Reply #4 - 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
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: 2 analog events causing "Process stopped by UNIX signal 6"
Reply #5 - 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.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
fabian
Junior Member
**
Offline



Posts: 19
Europe
Re: 2 analog events causing "Process stopped by UNIX signal 6"
Reply #6 - 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.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.