Forum Discussion

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

using configurations in ModelSim

Hi! I have 2 designs in 2 different folders. I want to simulate them under 1 testbench. Some files in the folders have the same module names, but different behaviour. The problem is to simulate the overall design with the files correctly instanced in its subdesigns. I'm trying to use configs, but it does not work. In the example I compile source files to separate libraries

--- Quote Start ---

vlog -vlog01compat -work unit1 {../unit1/counter.v}

vlog -vlog01compat -work unit2 {../unit2/counter.v}

vlog -vlog01compat -work unit_test {../testbench/test_counter.v}

vlog -vlog01compat -work unit_test {../testbench/test_counter.cfg}

--- Quote End ---

and the test_counter.cfg has the following text :

--- Quote Start ---

config cfg;

design test_counter;

instance test_counter.dut1 use unit1.counter;

instance test_counter.dut2 use unit2.counter;

endconfig

--- Quote End ---

The test_counter.v looks like that

--- Quote Start ---

reg clk, reset;

wire [7:0] count1;

wire [7:0] count2;

counter dut1 (count1, clk, reset);

counter dut2 (count2, clk, reset);

initial // Clock generator

begin

clk = 0;

forever# 10 clk = !clk;

end

initial // Test stimulus

begin

reset = 0;

# 5 reset = 1;

# 4 reset = 0;

end

--- Quote End ---

The unit1.counter and unit2.counter have different behaviour. The elaboration in ModelSim uses unit1.counter file for both dut1 and dut2 instances. The question is how to make it use unit2.counter for dut2 ?

1 Reply

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

    Hi,

    Did you find a solution?

    I have a similar issue using Questa v10.4.

    Thanks....