• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. step simulation

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 65
  • Views 12805
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

step simulation

sebgimi
sebgimi over 11 years ago

Hi all,

I'm stuck on a simple issue but can't get out of it: I would like to generate severals waveform signals for my future testbench but the frequency of my signals are not correct.

Below is the code I want to simulate:

library ieee;
use ieee.std_logic_1164 .all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
use ieee.math_real.all;

entity triangle_generator is

 generic(AMP: real;
  OFFSET: real;
  FREQ: real;
  PHASE :real);
 
 port(wave1: out real);
       
end triangle_generator;

architecture archi of triangle_generator is

signal tmp1 : real := 0.0;


begin

 P1:process
 
 constant delta   : real := 1000.0e-12;
 constant fin  : time := 1000 ps;
 
 variable angle   : real := 0.0;
 variable t    : real := 0.0;
 variable PHASE_RAD : real := 0.0;
 
 begin
 
   PHASE_RAD := (math_2_pi * PHASE)/360.0;

  loop
   angle   := math_2_pi * FREQ * t;
   t := t + delta;
   
   tmp1 <= OFFSET+(AMP/2.0)*(2.0/math_pi)*arcsin(sin(angle));

   wait for fin;
  
  end loop;
  
  wait;
  
 end process P1;
 
 wave1 <= tmp1;
 
end archi;

When I simule this code with FREQ=100 000 000 Hz I get the waveform in attachment, not really what I wanted. So I was thinking, if I write delta = 1000.0e-15 maybe it will be right, but absolutly not. When I change the value of delta, the frequency of the waveform is wrong.

So can you help me to get through this please? 

  • Capture.PNG
  • View
  • Hide
  • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information