Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

ModelSim : signals not passing between entities

hi

I'm fairly new to FPGA programming and have just started trying to get to grips with ModelSim (ModelSim Altera Starter Edition 6.6d). For example, I've completed 5 or 6 VGA projects using Quartus II 10.1 sp2 (Pong, text, bitmaps,..etc) and they all display correctly, but none simulate as expected in ModelSim. They all have the same problem.

eg. In all cases, I have a top entity with 3 component entities:-

[1] clkdiv - converts the on-board 50Mhz clock down to a 25 Mhz clock, clk25

[2] vga_640x480 - takes in clk25 and generates the appropriate VGA output signals as well as internal horizontal and vertical counting signals vga_hc and vga_vc. These are passed out as signals s_hc and s_vc, via assignments s_vc<=vga_vc and s_hc<=vga_hc.

[3] screen_gen - this takes in s_hc and s_vc and uses them to generate the required screen objects, using internal signals gen_hc and gen_vc, via assignments gen_hc<=s_hc and gen_vc<=s_vc.

In ModelSim, the vga_hc and vga_vc signals have the correct behaviour on the vga_640x480 waveforms, but gen_hc and gen_vc are completely flat on the screen_gen waveforms. It seems like the s_hc and s_vc signals aren't being passed from VGA_640x480 to screen_gen. Also, the signal clk25 doesn't seem to be getting passed from clkdiv to vga_640x480, as I have to set clk25 manually there.

I'm using std_logic_1164 and numeric_std libraries in all 4 entities, and the signals vga_hc, vga_vc, s_hc, s_vc, gen_hc and gen_vc are all declared as "unsigned (9 downto 0)". I'm compiling all 4 entities in ModelSim and selecting them all from the 'work' library for simulation.

I don't understand why these projects work correctly, but don't simulate correctly in ModelSim. Is there something extra I need to be doing when simulating with ModelSim ?

Any help would be appreciated.

regards

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Without seeing the code - its very difficult to see whats going on.

    Also - post the testbench you are using.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Without seeing the code - its very difficult to see whats going on.

    Also - post the testbench you are using.

    --- Quote End ---

    Thanks for the reply.

    I didn't realise I needed to use a testbench for this. Reading up beforehand on simulating with ModelSim, every article I read just used the design units used in the project for the simulation. I don't think any of them even mentioned a testbench.

    I've never written a testbench before, so I'll read up how to do it.

    Regards