The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 6:37pm
Pages: 1
Send Topic Print
Using $table_model with time as one axis (Read 4034 times)
RolfK
New Member
*
Offline



Posts: 7
Germany
Using $table_model with time as one axis
Nov 22nd, 2012, 5:00am
 
Dear Experts,

I would like to trigger a curent wave by some event.
The event could by a kind of clock signal or an abstract verilog named event.

My questions is a conceptual one.
In case I would use a table model like shown below, I could imagine to assign it to a signal.
The constant inputs are MIN|TYP|MAX (as enumerator 0,1,2) and the current simulation dtime (time - the start time of this process ).
This way I hope the simulator interpolates the current given by the table dependent on simulation time.
This is quite similar to a PWL. BUT, I do not know how to start a PWL on some event and additinally it looks very benefitial to me to have the option of more consatnt parameters in one table.

Here is some PSEUDO CODE snipet:
analog
     @(starting event) begin
           start_time = 0 ;
           always(@ $current_time ) begin
                 dtime = $current_time - start_time ;
                 I(p,n) n <+ $table_model (TYP, dtime , "iwave.tbl", "?,?,?") ;
           end
     end
end

######### table file #########################
// Look up table for i(t) 2d with time
//      Index      mtm            time      current
     1            0            0                  0
     2            0            1.00e-12      0.1
     3            0            2.00e-12      0.3
     4            0            10.00e-12      0.05
     5            1            0                  0  
     6            1            1.00e-12      0.15      
     7            1            2.00e-12      0.35
     8            1            10.00e-12      0.06
     9            2            0                  0  
     10            2            1.00e-12      0.2
     11            2            2.00e-12      0.4
     12            2            10.00e-12      0.07


If there is some alternative or better idea I wopuld like to learn about it.
Additionally I need to learmn more about the control string.
I had a look into the Cadence Verilog-A Reference model, but did not find an exhaustive explantion there.

Thanks a lot

RolfK
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Using $table_model with time as one axis
Reply #1 - Nov 26th, 2012, 6:30am
 
Your pseudo-code isn't right; you shouldn't have everything inside the @(starting event), and you shouldn't have contributions inside an event.  I've re-written it below, assuming you want 0 current up until the trigger event.

analog begin
     @(initial_step) begin
           start_time = 0;
           enable = 0;
     end
     @(starting event) begin
           start_time = $abstime;
           enable = 1;
     end
     if (enable) begin
           dtime = $abstime - start_time ;
           ival = $table_model (TYP, dtime , "iwave.tbl", "?,?,?") ;
     end else begin
           ival = 0 ;
     end

     I(p,n) n <+ ival;

end // analog
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   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.