I'm trying to pass multiple VHDL generics to the testbench in Modelsim 10.7b using -g switch in the vsim command. How do I pass multiple generic where all the generics are defined in another string/file.
in short : When I use
set generics "-gHEIGHT=1 -gWIDTH=2"
vsim $generic work.test
only the first generic, i.e., HEIGHT is getting changed. WIDTH is not getting the value 2. It remains at the value initialised at the entity.
test.vhd file:
library IEEE;
use IEEE.std_logic_1164.all;
entity test is
generic (
HEIGHT : integer := 0;
WIDTH : integer := 0);
port (
clk : in std_logic);
end entity test;
architecture arch of test is
begin -- architecture arch
end architecture arch;
used commands to run the sim :
vlib work
vmap work work
vcom test.vhd
set generics "-gHEIGHT=1 -gWIDTH=2"
vsim command where both generics are passed to the vhdl file successfully using -g switch :
vsim -gHEIGHT=1 -gWIDTH=2 work.test
vsim command where only first generic in the string generic is passed to the vhdl..i.e only HEIGHT is passed:
vsim $generics work.test
I'm trying to pass multiple (~10) generics from python via vsim command. So I cannot list the generics name in the vsim command which executes the simulation.