( ESNUG 322 Item 6 ) ---------------------------------------------- [6/15/99]

Subject: Log, Square Roots, & Other Advanced Mathematics In Verilog Sims

> I would like some mathematical functions within a verilog simulation.
> For example, my verilog model has data values in a linear scale.  I would
> like to display those values at various times throughout the simulation in
> a logarithmic scale.  Ideally, something like this:
>
>     always @(eventWhatever)
>         $display(" The log of %d is %d", x, log(x) );
>
> The verilog simulator I am using is Cadence Verilog-XL.  Is there a set
> of verilog extensions out there somewhere which I can use to do this type
> of thing?  Square Root would be nice also ...
>
>     - Jeff Streznetcky
>       Lockheed Martin Federal Systems


From: andi_carmon@my-deja.com

Jeff,

You need a PLI function to solve your mathematical functions.  All the
mathematical functions, including those you mention are gathered in one of
the ready-to-run examples in http://www.angelfire.com/ca/verilog

    - Andi Carmon



 Sign up for the DeepChip newsletter.
Email
 Read what EDA tool users really think.


Feedback About Wiretaps ESNUGs SIGN UP! Downloads Trip Reports Advertise

"Relax. This is a discussion. Anything said here is just one engineer's opinion. Email in your dissenting letter and it'll be published, too."
This Web Site Is Modified Every 2-3 Days
Copyright 1991-2024 John Cooley.  All Rights Reserved.
| Contact John Cooley | Webmaster | Legal | Feedback Form |

   !!!     "It's not a BUG,
  /o o\  /  it's a FEATURE!"
 (  >  )
  \ - / 
  _] [_     (jcooley 1991)