Jump to content

Problem in creating .so files in systemc


mizi

Recommended Posts

I am using network simulator Nirgam 2.1.. It is based sysytemc2.1... Whenever I write an algorithm in it  no ".so files" are created for them. I just get the result for the same one algorithm that is inbuilt in it. Can I know reason for this and also how to rectify this problem..

Link to comment
Share on other sites

Dear Sir,

Greetings....

I am attaching a code below which I need to run in nirgam ....It is a .cpp file, when I run a make command it should run the algorithm and .so file should be created. But as I run it, it does not show any error but no .so file is created nor does the algorithm run. It runs a default algorithm at the backend whose .so file is already created. I don't understand why this happens.???

Regards

Misbah Manzoor

nubugyg.PNG

dsrstrdtrdgvhgv.PNG

Link to comment
Share on other sites

Hello @mizi,

Though I am not familiar with the Nirgam Simulator.

But can you provide the answers to the following queries:

  • Did you add your dependencies in the Makefiles/Build scripts?
  • My next guess would be did you look into any documentation available for the simulator?
    • Like running the simulation with various different configurations.
    • Does it use command line options or config files or both?
  • Even after changing those configuration files/command line options are you able to observe any change in simulation behavior?
  • If the answer to the above query is no then you would probably need to get your hands dirty to understand the internals, and possibly modify the existing implementation to suite your needs.

Hope this helps in someway.

Regards,

Ameya Vikram Singh

Link to comment
Share on other sites

Dear Sir,

Greetings...

Answering your questions: 1.. Yes i did add dependencies in Makefiles

                                                 2.. I looked into documentation and followed same procedure for running different algorithms

                                                 3..  It uses both command line and config files

                                                 4..  After changing config files all the parameters change except routing algorithm.. It  still takes default XY algorithm even if i change the routing algorithm.

Then what I observed was that XY algorithm .so file gets created, but when i run Other algorithms it runs XY algorithm by default and no .so file is created. I  can't understand the fact why this happens?????

Regards

Mizi

 

 

Link to comment
Share on other sites

Hello @mizi,

You probably missed out on this:

On 1/29/2019 at 10:35 PM, AmeyaVS said:

If the answer to the above query is no then you would probably need to get your hands dirty to understand the internals, and possibly modify the existing implementation to suite your needs.

After taking a cursory look at the sources found following references:

  • core/Controllers.cpp line 44: RT_ALGO: a global variable to the routing algorithm( 😞 )
  • Which has been initialized in config/default.h line 35 to a default value of XY.

It seems you might need to integrate your algorithm following their design principles, which you can look into the existing classes of routing algorithm to figure out what all API's your algorithm need to provide to be compliant with the infrastructure.

Hope this little insight helps.

Best Regards,

Ameya Vikram Singh

 

Link to comment
Share on other sites

Dear Sir,

Greetings....

I looked into your suggestion but things are not working out. Actually I think there may be some problem in make.defs file while giving suffixes.  The routing algorithms are not getting compiled as ".o files" are also not getting created while running different algos. It now shows following message provided in the attachment below. How can i solve this problem, need help in this regard

no target.PNG

Link to comment
Share on other sites

Hello @mizi,

Change the following lines in Makefile.defs: (lines 33 to 36)

// From
application/lib/%.so : application/src/%.o
       $(CC) -shared -W1,-soname,$@ -o $@ $<

router/lib/%.so : router/src/%.o
       $(CC) -shared -W1,-soname,$@ -o $@ $<
// To these lines:
application/lib/%.so : application/src/%.o
       $(CC) -shared -Wl,-soname,$@ -o $@ $<

router/lib/%.so : router/src/%.o
       $(CC) -shared -Wl,-soname,$@ -o $@ $<

Notice the subtle difference between the command line parameter: -Wl (i.e. letter l not the number 1).

Hope this helps.

Regards,

Ameya Vikram Singh

Link to comment
Share on other sites

  • 2 weeks later...
On 2/20/2019 at 12:29 PM, mizi said:

Dear Sir, 

Greetings...

Actually systemc is not working properly which causes trouble in nirgam. I tried instally systemc 2.3.1 on ubuntu 17.04 32 bit. When i test it  shows me

fatal error:systemc.h no such file or directory.  #include<systemc.h> compilation terminated.

Kindly help

Regards

 

Link to comment
Share on other sites

The SystemC libraries and their associated headers are usually not installed into the standard locations (/usr/lib/ and /usr/include/), where they would be found automatically by the compiler and linker. Instead, they are typically installed into their own directory hierarchy, e.g., below /opt/systemc-2.3.1/. Therefore, you need to indicate their location explicitly to the compiler and linker by passing the appropriate flags, e.g.:

$ c++ -o my_tb my_tb.cpp -I/opt/systemc-2.3.1/include -L/opt/systemc-2.3.1/lib-linux -lsystemc

Due to this, you also usually include the SystemC header using #include "systemc" to indicate that it is not a standard system header. I suggest that you first test your SystemC installation by compiling, linking, and running a pure SystemC example (e.g., the single-file simple_perf example, which is distributed as part of the SystemC PoC implementation in the directory examples/sysc/simple_perf/).

From your questions, it seems that you are not particularly familiar with C++ and the associated toolchains. I would recommend that you first learn about them before focusing on SystemC and then Nigram.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...