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:
use ieee.std_logic_1164 .all;
entity triangle_generator is
port(wave1: out real);
architecture archi of triangle_generator is
signal tmp1 : real := 0.0;
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;
PHASE_RAD := (math_2_pi * PHASE)/360.0;
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 process P1;
wave1 <= tmp1;
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?