The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 8:19pm
Pages: 1
Send Topic Print
VPI function for analog signals (Read 1513 times)
at
New Member
*
Offline



Posts: 1

VPI function for analog signals
Oct 25th, 2007, 1:00pm
 
hi!

Lets say I'm a newbie in AMS .. so there are maybe some points I miss or some missunderstandings, but give me a try:

I wrote a VPI function which should be able to handle real values only. Since I found out AMS-Designer doesn't allow to call system tasks/functions within the analog block I tried to get around with a trick -- it looks like that:
(module is maybe not compileable since i improvise - but it should be enough to give you an idea)

Code:
module blabla (in, out)
  input in; output out;
  electrical in, out;
  real vin;
  real sig;

  always @(cross(t,0)) begin
    vin = V(in);
    sig = $my_vpi_func(vin);
  end

  analog begin
    @(initial_step) t = 1;
    t = -t;
    V(out) <+ sig;
  end
endmodule  



I'm quite sure  this is the type of code which works.
The goal is clear: go only into the "always" block if spectre invokes a calculation
and it is also clear that ncsims time-resolution is responsible for the accuracy of the delay, but what is unclear is the resulting delay between the input and output signals, which is exactly the delay of one analog timestep (that is e.g. around 50-100 times the digital timestep).
The delay should be even visible if you  skip the VPI function.
Again, maybe this is a complete wrong approach to solve such a "simple" problem, thus, I'm open for any suggestions.
thanks
armin
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.