Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

"work" library for VHDL

Status
Not open for further replies.

vGoodtimes

Advanced Member level 4
Joined
Feb 16, 2015
Messages
1,089
Helped
307
Reputation
614
Reaction score
303
Trophy points
83
Activity points
8,730
Is it possible to refer to the default "work" library within a file that is compiled into a non-default library? The LRM briefly says that "work" is the "current working library". This would make sense if you wanted to move some existing code that only used references to "work" into a different library as no files would be modified. However, I don't see how to specify the default "work" library vs the current "work" library.
 

I have not understood the Q completely, but will try to answer it as much as possible.

Is it possible to refer to the default "work" library within a file that is compiled into a non-default library?
What is the necessity for that?

However, I don't see how to specify the default "work" library vs the current "work" library.

I use VCS of Synopsys, so my will be specific to that.
Take a look into the synopsys_sim.setup file created in your compilation dir. What I have seen in my case is that WORK is mapped to WORK in this file. I think this is playing the trick it needs to do (I am not 100% sure about this though).

Given below is an excerpt from my synopsys_sim.setup file.
Code:
--VCS MX setup file
TIMEBASE=ps 
TIME_RESOLUTION=PS 

--Mapping default work directory 

WORK > DEFAULT
DEFAULT : work
axi_iic_v1_02_a_proc_common_v3_00_a : axi_iic_v1_02_a_proc_common_v3_00_a
axi_iic_v1_02_a_axi_lite_ipif_v1_01_a : axi_iic_v1_02_a_axi_lite_ipif_v1_01_a
axi_iic_v1_02_a_interrupt_control_v2_01_a : axi_iic_v1_02_a_interrupt_control_v2_01_a
axi_iic_v1_02_a : axi_iic_v1_02_a
work : work

I had compiled the Xilinx AXI IIC VHDL IP along with other VHDL files whose default library was WORK. For the axi iic IP, they were compiled under axi_iic_* library. This file can be manually edited, but be careful of what you are doing else compilation will fail. Note that WORK is the default library. This file shows the relation between logical mapping and physical mapping.

Hope this is useful to some some extent.
 
Last edited:

In Modelsim you can map "work" like any other library.
I have also used code that everything was referenced as "work" to reference stuff within that library, then within the main body, it was given a specific name:

eg.
Code:
--library1
use work.lots_of_things_package.all;

........
vmap some_new_library library1_path

....File 2
library some_new_library
use some_new_library.lots_of_things_package.all;
 

TrickyDicky's post makes me remember, it is very easy if you are using ModelSim. The vmap command takes care of stuff in the synopsys_sim.setup file. Life is a bit difficult for me as I use Synopsys VCS. I had to manually edit the synopsys_sim.setup file for the entire design to work.
 

After the post about configurations and direct instantiation of entities, I remembered a problem I had with libraries maybe two years ago. I remember that some design teams used libraries a lot in older code, then stopped using them in newer code. I also noticed that different tools handled libraries a little differently. After looking at this and google, I think the issue was that I had expected "work" to refer to a library -- similar to how it is presented in tools.

The issue I recall was that some commonly used code was placed into "work", but then couldn't be referred to within another library because "work" would mean something different. Because existing code frequently referred to the common code using work.name, and because the synthesis tool only allowed a file to be in one library, the use of libraries was made more difficult and eventually new code just assumed everything was in "work".

I wish I had known this for some of the coregen VHDL cores that gave some entities the same name but with different ports...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top