Generating Modelsim Verilog resource libraries - pointers/questions

Sep 19, 2005 6 Replies

Hi,



I have generated libraries in ModelSim 6.1 that my company is going to be distributing shortly.



We need to protect our source code, and I have a few concerns about the distribution.



Currently, we plan on distributing the library in an installed directory, and the end users link this directory either at the command prompt or add it to the modelsim.ini file. Everything works great.



My concern comes from data stored in the _info file for the library, namely project file names and locations to the original source code. Of course, the end users won't have this code, but it appears as dead links to our source code under the "Files" tab in Modelsim.



So, basically, what sort of project settings or flags should I use to prepare my libraries? I just want as clean and secure of a distribution as possible and I can't find anything in Modelsim's documentation or on the web.



Thanks for any advice or pointers, Garrick


As a user of many protected codes, please use the new "vlog +protect" functionality. It is supported from Modelsim 5.7 onwards. It's much easier for the customers (for example name clases are easier to handle). And be prepared to offer many different versions of the library if you use precompiled libraries, because -refresh command works only from older to newer versions. Everyone is not using the newest and greatest versions of the simulator. For example I don't like the new 6.x GUI and in many designs 5.8 is faster and consumes less memory.

-nodebug and +protect are documented quite well in the manuals. The compilation paths and flags in the _info files are just noise. Actually the flags are quite nice to know even for protected code, it helps to pinpoint possible simulator bugs.

--Kim

Kim, thanks for the information. I have a few follow up questions, but I realize now that I should have specified that I am using Modelsim XE, the free simulator for Xilinx. I thought the only limitation was project size, but I am unable to compile a resource library with a

-nodebug flag, and would be unable to use a -nodebug compiled library if one was supplied to me by a 3rd party.

S> As a user of many protected codes, please use the new "vlog +protect"

It appears as if the `protect compiler directive is supported (at least initially) in Modelsim XE. I've placed `protect/`endprotect in my verilog modules and compiled them using the +protect flag. They compile fine with no warnings.

However, it doesn't appear as if anything is being protected. I've tried putting the `protect/`endprotect both within the module and around the modules, and have even not used the +protect flag during compilation. The compiled libraries, when used by another project, show all of the internal signals equally. Perhaps Modelsim XE doesn't support `protect or nodebug, but doesn't flag a warning with protect and just doesn't do anything about it. It would be nice to have some protection.

Thanks for any help/suggestions, Garrick

OK, I'm using the SE version and it's manuals :)

I would be suprised if you couldn't use -nodebug library in XE version. That is the old way of protecting IP with Modelsim. The problem was that it protected the whole modules and tied them to some simulator version.

-nodebug just removes all visibility from the design module when compiled. But I guess you should be asking from Mentor what they suppport in XE. There are limitations how -nodebug modules can be used in the hierarchy. If I remeber correctly they must be leafs in the design hierarchy, otherwise Modelsim can complain quite loudly.

I just tried and in SE it works just fine. I used the small example below and then commands

vlib work vlog +protect foo.v more work/foo.vp (contains file that has the module definition but everything else is encrypted).

foo.v:

module D_Flop (q, d, clock, reset);

output q; input d; input clock; input reset; reg q;

`protect

always @(posedge clock or posedge reset) if (reset) q

I've been struggling to figure out the compatibilities between the SE and XE worlds. I've discovered a lot, and have several questions ready to drop on Xilinx and Mentor Graphics. Below is a rant of the things I've discovered so far:

1.) We are using ModelSim Xilinx Edition III Starter edition (6.0a). It's free and most of our current customers are using it to simulate designs for our hardware. Up to 10,000 lines of HDL code, it's suppossed to simulate at 30% the performance of ModelSim PE. Here are the links at Xilinx's webpage the show differences between the XE version of Modelsim and the PE version:

formatting link
formatting link

In no place at either company's site do they discuss the -nodebug or

+protect utilization in any formal way. There is an that says to use

-nodebug compiled libraries, you must upgrade to Modesim PE or SE.

Sorry, the previous post was prematurely sent, I'll continue:

There is an Answer Record that says to use -nodebug compiled libraries, you must upgrade to Modesim PE or SE.

formatting link

  1. I had an old evaluation version of Modelsim SE 6.0d that I installed to test out support between the SE and the XE version. Resource libraries created by the SE compiler were not usable by the XE version - regardless of what options I tried! Even a -refresh from within XE wouldn't work (only errors).

Within our Modelsim XE Starter Edition III program, any attempt to compile or refresh a library generated by SE 6.0d gave an error message that "this library is incompatible with this version of vlog." Even if I created the resource library within SE 6.0d without any compiler directives at all. Clearly, Modelsim XE is only designed to work with open libraries.

All libraries generated within Modelsim XE 6.0a work perfectly with Modelsim SE 6.0d, even without a refresh on them. Nothing works in the opposite direction.

This is a problem for us that I don't know how we'll resolve. Too many of our customers will be using the Starter Edition for us to offer them nothing.

Another small note - the XE compiler generates library directories with _primary.dat, _primary.vhd, and verilog.asm files. It doesn't generate a file.vp file. Aren't these three files effectively encrypted enough to protect our code? We're not concerned with users seeing the signals coming out of the ports.

Thanks for your patience. I guess I need to contact Mentor and find out precisely what they recommend for generating libraries used by XE Starter Edition users.

Garrick

Did you try to manually set the optimisation level (-O0 or -O1 for example). SE defaults to a higer level than the cheaper versions. But I guess it's easiest to just ask from Mentor what they recommend.

--Kim

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required