Forum Discussion

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

Modelsim Library Mapping - TCL

Right. I need help with this.

I have a group of libraries I need to map into modelsim. The guy that made most of the libraries uses HDL Designer and that automatically handles all the mapping, but for someone Like me who doesnt use HDL designer I need TCL scripts for it. We also have to assume Im downloading this stuff out of version control fresh and nothing is mapped (these libraries are available for anyone to check out and use in their designs).

lets say I have the folloiwng directories, each one already has a work directory:

lib1

lib2

lib3

Is there an easy way to map them all into modelsim? Ideally I want to put a tcl file in each library, but lib3 depends on lib2, so the only way I can think of doing that is changing directory in the TCL script, compiling lib2, then changing directory back to 3, vmapping to lib2 and then compiling lib3.

Am I missing something easier?

1 Reply

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

    The Tcl procedure vmap can be used to map Modelsim libraries, eg.,

    vmap lib1 [path to lib1]

    vmap lib2 [path to lib2]

    vmap lib3 [path to lib3]

    and then in the VHDL source there would be something like

    library lib1;

    use lib1.components.all;

    where 'components' is a package compiled into lib1, eg.

    vcom -work lib1 components.vhd

    You can also map the libraries to work, eg.

    vmap lib1 [path to work]

    If the library does not exist, then first use vlib to create it, eg.

    vlib [path to lib1]

    etc.

    Cheers,

    Dave