title: How to pass multiple generics to vsim using -g switch in Modelsim?
body: <p>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.</p>
  
  <p>in short : When I use </p>
  
  <p><code>set generics  "-gHEIGHT=1 -gWIDTH=2"
  vsim $generic work.test
  </code>
  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.</p>
  
  <p>test.vhd file:</p>
  
  <pre><code>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;
  </code></pre>
  
  <p>used commands to run the sim :</p>
  
  <pre><code>vlib work
  vmap work work
  vcom test.vhd
  set generics  "-gHEIGHT=1 -gWIDTH=2"
  </code></pre>
  
  <p>vsim command where both generics are passed to the vhdl file successfully using -g switch :</p>
  
  <pre><code>vsim -gHEIGHT=1 -gWIDTH=2 work.test
  </code></pre>
  
  <p>vsim command where only first generic in the string <em>generic</em> is passed to the vhdl..i.e only HEIGHT is passed:</p>
  
  <pre><code>vsim $generics  work.test
  </code></pre>
  
  <p>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.</p>