Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > help needed regarding VHDL, GHDL and gtkwave

Reply
Thread Tools

help needed regarding VHDL, GHDL and gtkwave

 
 
ghry ghry is offline
Junior Member
Join Date: Jun 2012
Posts: 2
 
      06-23-2012
I need some help regarding a VHDL-program i wrote. Its supposed to get a clk of 1MHz and output a clk of 10kHz and a clk of 1kHz:

-------- takterzeugung.vhd -------
library ieee;
use ieee.std_logic_1164.all;
use ieee.Numeric_STD.all;

entity takterzeugung is
port (
gtakt: in std_logic;
takt: out std_logic;
ftakt: out std_logic;
reset: in std_logic
);
end takterzeugung;

architecture behavioral of takterzeugung is
signal c50: std_logic_vector(5 downto 0);
signal c5: std_logic_vector(2 downto 0);
signal tak: std_logic;
signal ftak: std_logic;
begin
process(gtakt, reset)
begin
if (reset = '1') then
c50 <= "000000";
c5 <= "000";
tak <= '0';
ftak <= '0';
elsif (rising_edge(gtakt)) then
if (c50 = "110001") then
c50 <= "000000";
ftak <= not ftak;
else
c50 <= std_logic_vector( unsigned(c50) + 1 );
end if;
end if;
end process;

process(ftak)
begin
if (rising_edge(ftak)) then
if (c5 = "100") then
c5 <= "000";
tak <= not tak;
else
c5 <= std_logic_vector( unsigned(c5) + 1 );
end if;
end if;
end process;

ftakt <= ftak;
takt <= tak;

end behavioral;
--------- takterzeugung.vhd ---------

after this i made a small testbench file to test it with gtkwave:

--------- takterzeugung_tb.vhd ----------
library ieee;
use ieee.std_logic_1164.all;

entity takterzeugung_tb is
end entity;

architecture TB of takterzeugung_tb is

component takterzeugung
port (
gtakt: in std_logic;
takt: out std_logic;
ftakt: out std_logic;
reset: in std_logic
);
end component;

signal gtakt: std_logic;
signal takt: std_logic;
signal ftakt: std_logic;
signal reset: std_logic;

begin
ter: takterzeugung port map (gtakt, takt, ftakt, reset);

process
begin
gtakt <= '0';
wait for 500 ns;
gtakt <= '1';
wait for 500 ns;
end process;


end;
---------- takterzeugung_tb.vhd ---------

ok so now if i run cmd i do the following:
ghdl -a takterzeugung.vhd
ghdl -a takterzeugung_tb.vhd
ghdl -e takterzeugung_tb

till here no errors or anything. Now i want to run the testbench and output the signals into a vcd file:

ghdl -r takterzeugung_tb --stop-time=1000ms --vcd=takterzeugung_tb.vcd

the computer starts working and doesnt stop till ghdl advises to shut down the programm cause smthing went wrong.
The vcd-file is nearly empty and i cant view it with gtkwave.
So my heres my question:
What am i doing wrong? Is my vhdl code wrong? Do i need to add another command in cmd?

Thanks for your help in advance!
 
Reply With Quote
 
 
 
 
Mister_J Mister_J is offline
Junior Member
Join Date: Jun 2012
Posts: 8
 
      07-02-2012
Did you try to make a GHDL waveform file instead of a vcd file (see http://ghdl.free.fr/ghdl/Simulation-options.html) ?

Jonas
 
Reply With Quote
 
 
 
 
ghry ghry is offline
Junior Member
Join Date: Jun 2012
Posts: 2
 
      07-02-2012
ive found it out... it doesnt work with the newest ghdl version.
i used 0.26 and it worked fine.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is this a Ghdl/gtkwave bug? Francesco Bonizzi VHDL 0 01-06-2012 09:33 AM
Is this a Ghdl/gtkwave bug? tuttoscorre VHDL 0 01-06-2012 09:31 AM
gtkwave not displaying ghdl simulation. Neil Dugan VHDL 3 05-12-2007 03:21 PM
Problems with GHDL and GTKWave Christian Christmann VHDL 1 11-15-2006 07:40 PM
GTKWave fabbl VHDL 2 01-17-2005 06:22 AM



Advertisments