UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
11,664 Views
Registered: ‎01-12-2009

How to tell Vivado simulation the library to use for top-level entity

Jump to solution

When attempting to set up a simulation in project-mode I seem unable to set the library to use for the top-level simulation entity. Or, at least, I cannot figure out how to set that library.

 

For example, if I set the top level entity to MVhdl.TestFifoPtrsCC the simulation run prepends another library I have called XilTest. So, I end up with the error:

 

ERROR: [XSIM 43-3225] Cannot find design unit TestXil.MVhdl.TestFifoPtrsCC in library work located at xsim.dir/work.

 

Under general project options I have my default library set to MVhdl.

 

Except perhaps that it is the last library in the list of libraries, I do not see why Vivado is selecting the XilTest library. And, I do not see why it is prepending it since I specified the library to use in the simulation settings.

 

Running a scripted simulation I have no trouble specifying the library.

 

Using: Vivado 2015.1, Win7 x64 all updates applied, all sources VHDL.

 

Ian Lewis

www.mstarlabs.com

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
20,275 Views
Registered: ‎09-14-2007

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hi Ian,

 

I took a look at the design you uploaded and I can confirm this is a bug in how we are handling it. I filed  CR

866839

 

for this, although it wont make it our 2015.2 release as that release is mostly done. We will get it into 2015.3 though. Our 2015.3 is planned for the Oct timeframe.

 

I had a question about the design as well.

 

Do you think you can share the complete design with us (incl the testbench) ? You dont have to post it here, if you are willing please send me a private message and we can figure out a way to get the design from you..

 

Let me know..

 

Thanks

Duth

 

0 Kudos
19 Replies
Xilinx Employee
Xilinx Employee
11,652 Views
Registered: ‎07-16-2008

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hello Lan,

 

Can you please attach the project archive?

I had a try at my end but could not reproduce the issue. If the default library is changed to MVhdl, I can see it takes effect in simulation compilation list (.prj).

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
11,647 Views
Registered: ‎01-12-2009

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hello ,

 

I just tried creating a simple example, and I cannot reproduce it either. I cannot provide the main project. it is too big.

 

I will try to reproduce a small example that fails.


Ian Lewis

www.mstarlabs.com

0 Kudos
Explorer
Explorer
11,643 Views
Registered: ‎01-12-2009

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hello ,

 

Attached see an example project file. It reproduces the failure.

 

There are two source modules.  One in the MVhdl library and one in the XilTest library.

 

Run simulation and you will see that it tries to simulate a top level entity TestXil.MVhdl.il1. I have the top simulation target set to MVhdl.il1. I also tried just naming the entity, il1, and that simulated TestXil.il1. However, il1 is in MVhdl.

 

The issue looks like it might be related to project option:

    <Option Name="SourceMgmtMode" Val="DisplayOnly"/>

 

But, whatever the reason, I would like to be able to specify exactly the entity to simulate, including the library the entity comes from.

 

Ian Lewis

www.mstarlabs.com

0 Kudos
Moderator
Moderator
11,638 Views
Registered: ‎04-17-2011

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

To add my observation in your testcase, the compile order has some effect here with il1 set as TOP. The below order doesnt work:

order_1.JPG

 

Running: C:/Xilinx/Vivado/2015.1/bin/unwrapped/win64.o/xelab.exe -wto 2ea3f3fd9d5c45a398e9ba956659405c --debug typical --relax --mt 2 -L MVhdl -L TestXil -L secureip --snapshot il1_behav TestXil.il1 -log elaborate.log
Using 2 slave threads.
ERROR: [XSIM 43-3225] Cannot find design unit TestXil.il1 in library work located at xsim.dir/work.

 

But this one works. Note the change in the command for xelab:

 

order_2.JPG

 

Running: C:/Xilinx/Vivado/2015.1/bin/unwrapped/win64.o/xelab.exe -wto 2ea3f3fd9d5c45a398e9ba956659405c --debug typical --relax --mt 2 -L TestXil -L MVhdl -L secureip --snapshot il1_behav MVhdl.il1 -log elaborate.log
Using 2 slave threads.

 

I believe this issue wont happen if you are using scripted mode and you manually force the <work_lib>.<top_level> name.

 

 

 

 

 

 

Regards,
Debraj
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Xilinx Employee
Xilinx Employee
11,630 Views
Registered: ‎07-16-2008

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

When I open the project, it looks to me that there's no top module in simset, even though i1 is set as top in source fileset.

 

You can change SourceMgmtMode to ALL, which equivalently set Hierarchy Update to Automatic Update and Compile Order. That allows you to reset the valid top module.

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
11,619 Views
Registered: ‎01-12-2009

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

If I set the automatic compile order on the main project it takes a moderately long time to evaluate, and the automatic rules get the order wrong. So, compilation fails. (I have not investigated how or why the tool gets the order wrong - I am happy to set the order by hand).

 

With my manually set order the compilation works fine and the project load time is significantly better. I think the run time is better too, but since the compilation fails with automatic order determination on, I am not sure of that.

 

I want to retain the manually set compile order and tell the simulator the fully qualified name of the entity to simulate.

 

You are correct in your other message that scripted simulation works fine. I have been using that.

 

What I wanted to do was to set up a project mode version because I think it will be easier to mange the simulations that way. But, I cannot get it to work because of the problem with selecting the top-level entity.

 

Ian

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
11,606 Views
Registered: ‎09-14-2007

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hi,

 

Once you put the flow to manual ordering, then when you go to the Simulation Settings, you will see an option for Simulation top Module name. Here you can set it to the right top based on the correct hierarchy and that should work. See attachment

 

It could be done via Tcl as well (ex):

set_property top bft_tb1 [get_filesets sim_1]
set_property top_lib xil_defaultlib [get_filesets sim_1]

 

Thanks

Duth

 

2015-06-11 13_46_14-Project Settings.png
0 Kudos
Explorer
Explorer
11,601 Views
Registered: ‎01-12-2009

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hello Duth,

 

I know that setting. The problem is that Vivado gets the top module wrong. In particular, it uses the wrong library. And, if I set the library in the "Simulation top module name" field it still prepends the wrong library in front of the library I specify.

 

See the example project I posted.

 

Unless there is somewhere else to set the library to use, this seems to be a bug that needs an SR.


Ian Lewis

www.mstarlabs.com

0 Kudos
Xilinx Employee
Xilinx Employee
11,598 Views
Registered: ‎09-14-2007

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Yes please open an SR on this. It needs further investigation..

 

Thanks

Duth

 

0 Kudos
Xilinx Employee
Xilinx Employee
20,276 Views
Registered: ‎09-14-2007

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hi Ian,

 

I took a look at the design you uploaded and I can confirm this is a bug in how we are handling it. I filed  CR

866839

 

for this, although it wont make it our 2015.2 release as that release is mostly done. We will get it into 2015.3 though. Our 2015.3 is planned for the Oct timeframe.

 

I had a question about the design as well.

 

Do you think you can share the complete design with us (incl the testbench) ? You dont have to post it here, if you are willing please send me a private message and we can figure out a way to get the design from you..

 

Let me know..

 

Thanks

Duth

 

0 Kudos
Explorer
Explorer
10,766 Views
Registered: ‎01-12-2009

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Thank you for filing the CR, Duth. - Ian

0 Kudos
Visitor cjm99999
Visitor
10,705 Views
Registered: ‎12-10-2014

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

I am hitting this problem all the time with many different projects using many different IP from the IP catalog.  Can Xilinx post a detailed workaround for this when they have one for 2015.1 and 2015.2.  I am just learning Vivado and would like to do behavioral simulations.

0 Kudos
Xilinx Employee
Xilinx Employee
10,702 Views
Registered: ‎09-14-2007

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hi,

 

Based on the testcase, the way I see that this problem is hit is under the following conditions:

 

1. VHDL design (or at minimum VHDL tb)

2. Vivado project management flow cannot parse the hierarchy and thus the user has to specify the top

3. The top level file has to go into the non-default work library

 

The only workaround that i can think of right now is the same as that was already called out and that is to use the non-project flow..

 

The issue is with how Vivado is passing the information to the scripts and this is why in integrated flow when we cannot find the correct top, you run into this issue..

 

Thanks

Duth

 

0 Kudos
Visitor cjm99999
Visitor
10,692 Views
Registered: ‎12-10-2014

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

I get the same error when I create a project with the target language as Verilog and the simulation language as Mixed. 

 

I had a previous post on this subject...

 

http://forums.xilinx.com/t5/Simulation-and-Verification/2015-1-IP-testbench-work-directory/td-p/634374

 

but closed it since I was getting all kind of different answers that were not working. 

 

As a person who is just trying to learn Vivado, I am really confused.  I get this error all the time and it is pretty much impossible to learn the tool flow when I can't get any simulations working.  Isn't everybody running into this problem?  Does that mean everybody uses the non-project flow?  Isn't the whole reason Vivado exits is to use the project flow to make life easier?

0 Kudos
Xilinx Employee
Xilinx Employee
10,684 Views
Registered: ‎09-14-2007

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hi,

 

I believe the issue you are running into is quite different. The issue you are running into is specific to the IP you are targeting. I have not dug into the details, although seems like @graces has looked at it and confirmed there is a different issue. I will let her comment on her findings.

 

if i understand your flow correctly, I think the issue you may be running into is by using the Tb we provide with the IP. In general if you want to get started and understand the flow, what we recommend is running the example design. This will show how our Ip works and it will show a simulation of it as well.

 

This is the ideal place to start..

 

Thanks
Duth

 

 

 

 

 

0 Kudos
Explorer
Explorer
3,379 Views
Registered: ‎01-12-2009

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Can someone tell whether CR 866839 has been fixed by 2017.2?

 

Ian Lewis

www.mstarlabs.com

0 Kudos
Xilinx Employee
Xilinx Employee
3,369 Views
Registered: ‎10-24-2013

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hi @ilewis

I checked the status and this CR is fixed in 2015.4 version.

Thanks,Vijay
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Explorer
Explorer
3,364 Views
Registered: ‎01-12-2009

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Thank you for the reply, Vijay,

 

Does the CR explain how this was fixed? I seem to be getting the same problem in 2017.2 that I saw in 2015.2.


I cannot seem to tell the tool which Library to simulate run from and it is just pre-pending the last library it finds.

 

Thank you,

Ian Lewis

www.mstarlabs.com

0 Kudos
Explorer
Explorer
3,359 Views
Registered: ‎01-12-2009

Re: How to tell Vivado simulation the library to use for top-level entity

Jump to solution

Hello Vijay,

 

I was able to make this work in 2017.2 by manually modifying the <Config> section of the simulation sources to add an <Option Name="TopLib" Val="Test"/> tag, which I found by using the example I posted in this thread a few years ago.

 

This fixes the problem and the environment selects the correct library for simulation. 

 

However, I cannot figure out how to set this from the design environment. If I type the library name into the "Simulation top module name" field I get an error that the module does not exist in the hierarchy.

 

In the example below, the entity name is actually Test.TestCountUDL. But, I cannot enter that. But, I can add the <Option Name="TopLib" Val="Test"/> tag to the project definition and that works around the issue.

 

So, at this point I can simulate the correct top module by hacking the project file, and I can do that.

 

My only question is how to set the library for the top module in the environment. I cannot see how to do it.

 

Ian Lewis

www.mstarlabs.com

 

 

SimulationTop.png

 

 

 

Modified <Config> section with <Option Name="TopLib" Val="Test"/> tag added. 

    <FileSet Name="sim_1" Type="SimulationSrcs" RelSrcDir="$PSRCDIR/sim_1">

   ...

      <Config>
        <Option Name="DesignMode" Val="RTL"/>
        <Option Name="TopModule" Val="TestCountUDL"/>
        <Option Name="TopLib" Val="Test"/>
        <Option Name="TransportPathDelay" Val="0"/>
        <Option Name="TransportIntDelay" Val="0"/>
        <Option Name="SrcSet" Val="sources_1"/>
      </Config>
    </FileSet>

0 Kudos