title: Determine if design element exists in library with script
body: <p>I would like to determine whether or not a design element exists (has been compiled) in a given library in ModelSim (I'm using 10.3c PE) using Tcl, but I can't seem to find an appropriate function. Something like this theoretical code:</p>
  
  <pre><code>if {[design_object exists $lib.$entity]} {
    ...
  </code></pre>
  
  <p>While not ideal, I can check for certain custom libraries with:</p>
  
  <pre><code>if {[file exists $lib_path]} {
    ...
  </code></pre>
  
  <p>This uses a filesystem access, of course, and while ideally I would have liked to check for a logical name, this workaround is good enough for my limited purposes for now.</p>
  
  <p>Unfortunately, there does not seem to be an exact equivalent for design entities, as ModelSim doesn't create individual files for compiled entities. I've considered parsing the library's <code>_info</code> file for the entity name, but that could be a relatively long operation. Is there a built-in way of doing this? Do ModelSim's Tcl extensions even provide access to logical names (outside of a simulation context)?</p>