Author Topic: VHDL Libraries  (Read 388 times)

toddmcc

  • Community Member
  • Posts: 10
  • Hero Points: 0
VHDL Libraries
« on: December 16, 2022, 08:43:37 pm »
Hi, I am new to Slickedit and a little confused on how to import vhdl package files into the workspace.  They are called out as libraries in the code so do I need to define them as such? I have tried defining them as new tag files but I think the fact that they are called as libraries confuses things.

Typically, I would do something like
use work.parameters.all;

Where a file parameters.vhd gets compiled to library work.  How does this relate to slickedit?

Thanks
 

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1794
  • Hero Points: 151
Re: VHDL Libraries
« Reply #1 on: December 16, 2022, 11:51:12 pm »
For SlickEdit, if you want to be able to use tagging features for the libraries (like parameter help, push tag, etc), you'll need the to add the source files of the library to a project in the workspace.  It doesn't need to be the full source code, it can also just be the source files that define the interface into the library.  For other languages, I tend to create a separate project called something like "Dependencies", and add 3rd party dependency headers and source to that. 

If you don't have the source files for the libraries, and just a compiled version, then we can't read in the compiled versions for any VHDL tools, so you won't have any tagging for the library.

Let me know if I you have other questions, or if I misunderstood what you were asking. 


toddmcc

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: VHDL Libraries
« Reply #2 on: December 17, 2022, 01:30:05 am »
Hi Patrick,
Thanks for the quick response.  I think I understand the issue with precompiled libraries but what I am trying to resolve is the use of package files that are typically compiled to a library and then called from the code.  I see that when I compile Slickedit, it is using the Modelsim compile engine. 

In MS I would add a particular vhd file to my project and compile it to a library.  Then I would call that library from wherever I want.  So, the cmmd in MS would be something like
vcom -work work -2002 -explicit -stats=none C:/parameters.vhd   

Then in my other vhdl code I would add
library work;
use work.parameters.all;

So is this approach still valid in Slickedit?  When I try to just add the vhd to the workspace or as a separate project it can't find library work when I compile which is understandable. 

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1794
  • Hero Points: 151
Re: VHDL Libraries
« Reply #3 on: December 17, 2022, 05:02:28 pm »
Ok.  When I look at the Build target for the default ModelSym project, it looks like it's just calling out to nmake.  You can see this by going to Project -> Project Properties, and selecting the Tools tab, and then selecting the Build tool to show the command we run, and the passed arguments. 

I don't know enough about ModelSym to know what the makefile being invoked is doing.  I wouldn't be surprised if it requires you to edit some other ModelSym owned file to let it know about the libraries, but it's definitely not something we're doing automatically for that project type.

toddmcc

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: VHDL Libraries
« Reply #4 on: December 17, 2022, 09:13:15 pm »
Ok well I got the compiler to see my package files as libraries now, I generated tag files from the vhd and included them.  It seems happy with that.

It doesn't look like I have anything in the build target in my settings file.  Maybe I deleted it somehow.  Can you send me the default settings you see?  Also I don't think nmake is a MS cmmd.  There is a vmake but that is for maintaining libraries.   

All I really need to do with this editor is be able to compile the design top down so if there is an easier way to do that then let me know.  Right now I can compile individual files but haven't gotten a full design compile to run yet. 

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1794
  • Hero Points: 151
Re: VHDL Libraries
« Reply #5 on: December 19, 2022, 03:30:45 pm »
If you just want to be able to compile everything from the editor, and you know what the command to run to build everything is, you can set up the command line and opens for the project Build tool.

With your workspace opened, go to Project -> Project Properties and select the Tools Tab.  Select the Build tool from the list.  Then you can replace the text at "Command line:" with the command you need to build your full design.  By default, "Run from dir" is set to %rw, which expands to the directory the workspace file is in (the .vpw file).  If your build command needs to be run from a specific directory, you can put that there. 

For builds, I usually have the "Capture output", "Output to build window" and "Clear build window" options set. 

Once you save those changes, it should run the build command when you hit Ctrl-M, for the default cua key bindings.  If we recognize the error messages from that compiler, it will also allow you to cycle through error locations after a build with next-error (Ctrl-shift-down). 

toddmcc

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: VHDL Libraries
« Reply #6 on: December 20, 2022, 02:53:30 pm »
Yep that is exactly how I set it up.  Seems to work pretty well.  Do you know if there is a beautify cmmd forthcoming for VHDL?

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1794
  • Hero Points: 151
Re: VHDL Libraries
« Reply #7 on: December 20, 2022, 03:46:16 pm »
We have a feature request for it, but AFAIK it's not scheduled.  I'll add your post to the list of users asking for it in the feature request. 

toddmcc

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: VHDL Libraries
« Reply #8 on: December 20, 2022, 05:18:59 pm »
Ok does that mean I get a discount?  ;D

Thanks for all your help