Home > Community > Forums > Functional Verification > step simulation

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 step simulation 

Last post Fri, Apr 18 2014 6:22 AM by sebgimi. 0 replies.
Started by sebgimi 18 Apr 2014 06:22 AM. Topic has 0 replies and 1913 views
Page 1 of 1 (1 items)
Sort Posts:
  • Fri, Apr 18 2014 6:22 AM

    • sebgimi
    • Not Ranked
    • Joined on Tue, Jan 7 2014
    • Posts 13
    • Points 200
    step simulation Reply

    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? 


    • Post Points: 5
Page 1 of 1 (1 items)
Sort Posts:
Started by sebgimi at 18 Apr 2014 06:22 AM. Topic has 0 replies.