xilinx beginner modelsim question

Hi!!!

I started recently with the xilinx software and these days I am trying to become more familiar with the modelsim and ise. I wanted to test some basic counter simulation in modelsim so I used this simple code

counter design file

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

entity counter is port( clk: in std_logic; reset: in std_logic; enable: in std_logic; count: out std_logic_vector(3 downto 0) ); end counter;

architecture behav of counter is signal pre_count: std_logic_vector(3 downto 0); begin process(clk, enable, reset) begin if reset = '1' then pre_count

Reply to
Zorjak
Loading thread data ...

Zoran -

I compiled and simulated your files in Modelsim SE 6.2h and your counter works fine. Perhaps you should try some of the examples that ship with Modelsim - find the examples folder in your install directory. Maybe something is wrong in your modelsim.ini file; I really have no idea.

Barry

Reply to
Barry

Your clock process will only produce -1- clock cycle. You need the clock to be in a loop:

clock : process begin loop clk

Reply to
Dave Pollum

The clock process is Ok as is - there doesn't need to be a loop. Since there's no 'wait' statement at the end of the process, execution will go back to the top of the process on the next delta cycle.

This stimulus process could use some work, though. Try defining the reset and enable signals from the beginning, like this:

stimulus : process begin reset

Reply to
Dave

Thanks to everybody for the help. As I said I am beginner with modelsim so I was making mistake when I was starting my simulation. After I was starting simulation I was choosing both files (design and testbench) and I should chose only testbench file. So this was problem. At the end I tried to select only testbench file and it worked fine and there was no end of my happiness:):):)

One more time, thanks to everyone Zoran

Reply to
Zorjak

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.