harerama
Member level 4
- Joined
- Sep 21, 2011
- Messages
- 79
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 1,288
- Location
- Bangalore,India
- Activity points
- 1,747
HI.
I written traffic program in fsm.after ran in ghdl simulator gtk wave not dispaying waveform .whats the problem?
commands used :ghdl -a tra.vhd
ghdl -e tra
ghdl -r tra --vcd=tra.vcd=$ --stop-time=100ns
gtkwave tra.vcd
library ieee;
use ieee.std_logic_1164.all;
entity tra is
port(rst,clk : in std_logic;
q : out std_logic_vector(2 downto 0));
end;
architecture fsm of tra is
type state_type is(red,green,yellow);
signal ps,ns1 : state_type;
begin
process(clk,rst)
begin
if(rst = '0')then
ps <= red;
elsif clk'event and clk='1'then
ps <= ns1;
end if;
end process;
process(ps,ns1)
begin
case ps is
when red =>
q <="001";
ns1<= green;
when green =>
q <= "010";
ns1 <= yellow;
when yellow =>
q <= "100";
ns1 <= red;
end case;
end process;
end fsm;
Thanks in advence
Regards
Raghavendra
I written traffic program in fsm.after ran in ghdl simulator gtk wave not dispaying waveform .whats the problem?
commands used :ghdl -a tra.vhd
ghdl -e tra
ghdl -r tra --vcd=tra.vcd=$ --stop-time=100ns
gtkwave tra.vcd
library ieee;
use ieee.std_logic_1164.all;
entity tra is
port(rst,clk : in std_logic;
q : out std_logic_vector(2 downto 0));
end;
architecture fsm of tra is
type state_type is(red,green,yellow);
signal ps,ns1 : state_type;
begin
process(clk,rst)
begin
if(rst = '0')then
ps <= red;
elsif clk'event and clk='1'then
ps <= ns1;
end if;
end process;
process(ps,ns1)
begin
case ps is
when red =>
q <="001";
ns1<= green;
when green =>
q <= "010";
ns1 <= yellow;
when yellow =>
q <= "100";
ns1 <= red;
end case;
end process;
end fsm;
Thanks in advence
Regards
Raghavendra