Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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

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

Last edited:

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
46,987
Helped
13,938
Reputation
28,124
Reaction score
12,576
Trophy points
1,393
Location
Bochum, Germany
Activity points
273,971
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?
 

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
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.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
46,987
Helped
13,938
Reputation
28,124
Reaction score
12,576
Trophy points
1,393
Location
Bochum, Germany
Activity points
273,971
_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
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top