-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile common libraries to single libs
directory
#1425
Conversation
10c4793
to
bcc9393
Compare
Would it be easier to compile all the libraries (and not just the "common" ones) to a single directory, and call them |
Then one needs to change how |
Which |
Like here: cocotb/cocotb/share/lib/vpi/VpiImpl.cpp Line 716 in 1e8880e
cocotb/cocotb/share/lib/gpi/gpi_priv.h Lines 346 to 355 in b283b48
I think I have seen problems here. |
I think we'd only want to change these lines: cocotb/cocotb/share/lib/gpi/GpiCommon.cpp Lines 163 to 172 in 1e8880e
We use the name in |
Looks like you are right. |
I did not write C/C++ code for 10 years. If you give me snippet I can try other way need to read a bit to remember myself how this was done ;-) |
We could also change |
Could follow the same convencion like some tools loading VPI: |
Sounds like a good idea to me |
Re splitting - one way to do it would be something like this: std::string arg = "mylib:my_entry_point";
std::string lib_name;
std::string func_name;
auto it = std::find(arg.begin(), arg.end(), ':');
if (it == arg.end()) {
// no colon in the string
lib_name= arg;
func_name = "whatever our default was";
}
else {
lib_name = std::string(arg.begin(), it);
func_name = std::string(it+1, arg.end());
} |
383258e
to
5f7b90e
Compare
732d08d
to
0a7901c
Compare
5e9f62f
to
61e94fc
Compare
@@ -305,6 +330,8 @@ def get_ext(): | |||
|
|||
logger.info("Compiling interface libraries for cocotb ...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a future PR: These log lines aren't accurate, all you're doing is producing a list of libraries to be compiled.
7bb04f1
to
fb9da56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, thanks for all the work here.
Thank you @eric-wieser for all help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks! Thanks a lot for pushing this through, it's greatly appreciated.
Conflicts are with the change to C++, should be easy to resolve. |
Remove LD_LIBRARY_PATH from Makfiles Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
fb9da56
to
3517f88
Compare
common libraries are compiled once to
/cocotb/libs
directory which results in a faster compilation, less space and easier usevpi/vhpi/fli
are compiled with_simulator_name
sufix (.
has special (directory separation) meaning in setuptools) in same directory/cocotb/libs
.simulator
module is compiled once and located in/cocotb
folder. This allows usingform cocotb import simulator
->
simulator
module can be added to documentation (need to install/compile) -> future PR.-> can remove
COCOTB_SIM
-> future PRremoved from makefiles
LD_LIBRARY_PATH
everywhere -> less potential collision with user environment settingsResolves #1181
Checked with ALL supported (Linux) simulators.