[Public] Hi Vedika, You will have to create parameters in the SimObject of GarnetNetwork and GarnetRouter and then access them in Router.cc and InputUnit.cc
You can follow how this is done for vcs_per_vnet variable: 1. Have a command line in configs/network/Network.py to take in the command line argument. 2. Apply that to your network python object in configs/network/Network.py 3. Access the parameter in GarnetNetwork class in src/mem/ruby/network/garnet/GarnetNetwork.py 4. Inherit that value for routers in GarnetRouter class in src/mem/ruby/network/garnet/GarnetNetwork.py using the 'Parent' keyword 5. Access the value in Router.cc constructor and store it somewhere. 6. Access the value in InputUnit.cc from the parent router. Srikant From: VEDIKA JITENDRA KULKARNI via gem5-users <gem5-users@gem5.org> Sent: Wednesday, June 23, 2021 9:02 AM To: gem5-users@gem5.org Cc: VEDIKA JITENDRA KULKARNI <ved...@iitg.ac.in> Subject: [gem5-users] Add new command-line option for simulation [CAUTION: External Email] Hello, I want to add few new command-line options for my simulations. I wanted to understand how to write code for that. For example, in garnet_synth_traffic.py, I can mimic code lines like other options using parser.add_option, but I wanted to know where is the constructor GarnetSyntheticTraffic() is called by this .py file. I want to be able to use the values set in command-line as variables in garnet network files. For example, if --ABC=10, then I want to access this value of ABC in InputUnit.cc of garnet. Thank you, Vedika.
_______________________________________________ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s