using packages in vhdl - vhdl

There are a few modules and a package in VHDL. How will we use the package in the modules. we have already use.work.Package_name.all;
but it did not work.
And where will we store the package and the modules? Please specify an example path.
How to compile the package?

I think you should start reading a book on VHDL, or follow an on-line tutorial. Or ask your teacher/tutor.
Google also helps: vhdl packages
use work.Package_name.all;

Related

How to use Go -buildmode=archive

Using -buildmode=archive produces mylib.a. I'm not fully understanding the steps required to then use this library in another Go program.
I've tried instead generating -buildmode=c-archive which produces a header file and archive, but the headerfile is not designed to be imported using cgo (there is conflicts with imported types).
Research online has yielded the conclusion that -buildmode=c-archive is specifically not designed for cgo use for this reason.
My query is what is -buildmode=archive actually used for if it cannot be included?
I'm not fully understanding the steps required to then use this library in another Go program.
It can be tricky. Need to look into each compiler toolchain for linking them correctly, i.e. gcc/clang etc. and find how, and if it's even possible to link them and use them.
What is -buildmode=archive actually used for if it cannot be included?
From the docs: https://pkg.go.dev/cmd/go
-buildmode=archive
Build the listed non-main packages into .a files. Packages named
main are ignored.
That's what it does, what you do with it, it's up to you, there's tons of information online, for example: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

how do you create the build section for an RPM spec for a golang project?

Following the steps here:
https://www.thegeekstuff.com/2015/02/rpm-build-package-example/
I'm making a RPM package with my program I wrote in golang.
Do I need to actually make the RPM compile the go code? Or is there a way include just binary inside the package? (This is what I did for the .deb version.)
I'm confused because this would mean golang would have to be installed on the end users machine?
Compared to general RPM packaging examples, the Golang has some specific bits. You can read about them here: https://docs.fedoraproject.org/en-US/packaging-guidelines/Golang/
At the end of that page are some examples.

Is there a standard practice for splitting packages into modular components?

I'm working on a library with multiple layers of functionality. I want developers to be able to import only the parts they need, ie mylib-core, mylib-feature1, mylib-feature2, etc. Each lives in its own git repo. I'd also like to provide a simple mylib package which exposes a default set of functionality which is useful for developers new to the library. See d3.js version 4+ for something very similar to what I'm trying to accomplish.
The problems I've run into are
Apparently you can't share a package name between packages. This is a problem because it would be nice to import all the desired repos and then simply have everything available under the mylib name.
I don't see an obvious way to re-export functionality, in order to build the default mylib package.
Are there good solutions or a more idomatic go way to accomplish what I'm shooting for?
Answering your question, there is no idiomatic way of doing what you want. It is common in JavaScript to import a library and export its members without interference. This is not the case in Golang.
I advise you to host your whole library under a single repo, and split the functionality to packages. The Go compiler will only compile and use the imported packages.
And a tip for the future, Go is very different than almost any other language you previously know šŸ˜…

Vivado Libraries

I am trying creating a library of components that I can use in Vivado(2014.2). I have many .vhd files and I would like to add more in the future, and so I'd prefer not to have to condense them
all into a single .vhd.
I may need to use a package...
ie.
--File name: my_library_file
package my_lib_package is
--All component declarations...
end package my_lib_package;
But would all the entities and architectures also need to be in this file?
Then I could use a "use" statement to reference these elements.
ie. use my_lib.
But would the my_library_file need to be located in the same project?
I would like to be able to make this library once and be able to reference in
any project with a call.
Ideally it could be called like an IEEE library but with many vhd files being referenced.
I would prefer not to explicitly add/include these individual source files to the project, but would instead prefer to just be able to use the ā€œuseā€ clause with library and/or packageā€¦if possible.
Hayden - your approach to making your own package of components sounds fine. We use the same approach with a single package file of "comps". It is written as a package and has the component instance as well as the entity and architecture of each component. Look at any of the Xilinx or Altera library source files as a guide.
You can compile it into it's own library and call it just like you do with the Xilinx libraries in Vivado.

Looking for library declaration of IP Module

I want to use the Xilinx hardware module of the ICAP controller in my own design.
This module uses the following library:
library hwicap_v5_00_a;
use hwicap_v5_00_a.all;
I was looking in the directories as well as subdirectories of
Xilinx\12.1\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores
but I could not find the package declaration of hwicap. Anyone an idea where Xilinx "hides" this information.
Many thanks
I think you just compile all the VHDL files from
C:\Xilinx\12.3\ISE_DS\EDK\hw\XilinxProcessorIPLib\pcores\hwicap_v5_00_a\hdl\vhdl
into a library called hwicap_v5_00_a - this is the way EDK works.
There's no package that I can see.

Resources