title: Passing the (initial) value of a shared variable to a generic during component instantiation
body: <p>I am trying to structure a testbench such, that each test case is represented by a record which holds all the parameters for the test case, e.g. input file names, generics to be used for DUT instantiation &amp;cetera. The idea is that only one assignment needs to be changed to switch between different test cases.  </p>
  
  <pre><code>type string_ptr is access string;
  type test_case_t is record  
      input_file : string_ptr;  
      ...  
  end record;  
  
  shared variable test_case_1 : test_case_t := (  
      input_file =&gt; new string'("path to input file 1")
      ...  
  );  
  shared variable TEST_CASE : test_case_t := test_case_1;
  
  dut: my_module
      generic map (
          file_name =&gt; TEST_CASE.input_file.all
      );
          ...
  </code></pre>
  
  <p>A string pointer is used for <code>input_file</code> since no unconstraint arrays are allowed inside a record type declaration (in this case, pre-VHDL-2008).<br>
  Due to the string pointer in <code>test_case_t</code> I have to use a shared variable for test_case_1.<br>
  However, when I try to simulate this testbench in Xilinx ISE/ISim 14.4 the simulator keeps using the default value of the generic and not the value I pass to it in the testbench (I assume this is a bug).  </p>
  
  <p>I tried to work around the issue with</p>
  
  <pre><code>constant INPUT_FILE : string := TEST_CASE.input_file.all;
  
  dut: my_module
      generic map (
          file_name =&gt; INPUT_FILE
      );
      ...
  </code></pre>
  
  <p>This is basically using the initial value of a shared variable as the initial value for a constant. However, this assignment will crash the Xilinx compiler before simulation even started (another bug I assume).</p>
  
  <p>At this point I no longer trust the Xilinx tools at all.<br>
  My question is if a shared variable can be used to pass generic values to a module as shown above (first code snippet)?<br>
  Also, is this usage of shared variable advisable for testbenches? I would have used a constant or signal for <code>test_case_1</code> but due to the use <code>string_ptr</code> type in <code>test_case_t</code> this seems not to be allowed.</p>