config: Refactor the network switch configuration file
This patch prevents the body of the script getting executed when the script is imported as a module. Change-Id: I70a50f6295f1e7a088398017f5fa9d06fe90476a Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
parent
54c478c0b8
commit
3bdd58ccb4
1 changed files with 12 additions and 8 deletions
4
configs/dist/sw.py
vendored
4
configs/dist/sw.py
vendored
|
@ -63,6 +63,8 @@ def build_switch(options):
|
|||
link.int0 = switch.interface[i]
|
||||
|
||||
return switch
|
||||
|
||||
def main():
|
||||
# Add options
|
||||
parser = optparse.OptionParser()
|
||||
Options.addCommonOptions(parser)
|
||||
|
@ -73,3 +75,5 @@ system = build_switch(options)
|
|||
root = Root(full_system = True, system = system)
|
||||
Simulation.run(options, root, None, None)
|
||||
|
||||
if __name__ == "__m5_main__":
|
||||
main()
|
||||
|
|
Loading…
Reference in a new issue