Forum Discussion
Altera_Forum
Honored Contributor
11 years agoHey I think you may be having a problem I've had and wanted to post up my solution even if it is not correct. If nothing else, to help others who run across this searching.
Anyways, the problem (that I think you guys are having) I had was that I would generate a testbench and make the stimulus mods I need with no problems, but when I launch Modelsim through the RTL simulation menu it would load my top level design module and the signals would always be red/unkoown. This is because it wouldn't load my testbench as the top level module in modelsim to generate any of my stimulus files. If you go to library -> work and right click and tell modelsim to simulate the test bench it will re-run and things would work. So, to solve this problem what you need to do is specify your "top level" in the "edit test bench settings" in your testbench editor in quartus to be the testbench. When you use the quartus testbench generator it has a tendency to generate a testbench with the same name as your top level and then modelsim launches on the top level design. Here is a screen shot of what I'm talking about: https://www.alteraforum.com/forum/attachment.php?attachmentid=8997 Long story short: Right click on your I2C_Controller -> Settings -> (on the left select EDA Tool Settings/Simulation) -> Compile Testbench -> Test Benches button -> New/Edit (depends on if you already added one) -> Set your "top level module in test bench" as the top level entity in the TEST BENCH file NOT your top level in your actual design. Hope this helps someone. Rob