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.

Passing value of a parameters in one .cpp file to another .cpp file

Status
Not open for further replies.

Adnan86

Full Member level 2
Joined
Apr 4, 2013
Messages
121
Helped
26
Reputation
52
Reaction score
26
Trophy points
1,308
Activity points
2,153
Hello,

In Attached file there are four files (router.cpp, router.hpp, islip.cpp and islip.hpp) for same project.

In router.cpp, there is a parameter which is (id or _id), that indicate the id of a router, for example, router 0 or router 1.

Now, I need the value of this parameter in islip.cpp, but I don't know how to pass the value of this parameters to this code.

Could you please someone explain it to me in a simple way as I am not an expert in C++.

Many thanks,
Adnan
 

Attachments

  • files.zip
    7 KB · Views: 146
Last edited:

The question can't be answered without knowing how the islip code is called related to router functionality. Is it called in one of the router functions or outside. In the latter case, how can you know which router instance islip is referring to?
 

These files belong to BOOKSIM simulator ( https://github.com/booksim/booksim2). an islip kind of allocator which used inside of the router.
router files inside of ../src/routers/router.cpp
and
Islip file inside ../src/allocators/islip.cpp

In router any time we need to allocate switches/ports we kind of use islip.
 

_id is an internal variable of the Router object, i'd guess it's initialized when constructing a new xxxRouter class. You should be able to pass it to the respective slip function when it's called. But you really need to look into the code details. I'm unable to review the full project now.
 

    Adnan86

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top