diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-03-06 00:24:54 +0200 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-03-06 00:24:54 +0200 |
commit | 0f1b82cfc8078e0b363b96e7e649dbe49eb24e2a (patch) | |
tree | 1bf0a21ea992f7aa99b9876abe11d3e2d3ab722d | |
parent | 2a3171f73e838fccbc82d2d8553e36c7c3820e28 (diff) |
add --native argument to simulator
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py index 9db34737..abfdd9bc 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py @@ -123,7 +123,7 @@ class STLSim(object): duration = -1, mode = 'none'): - if not mode in ['none', 'gdb', 'valgrind', 'json', 'yaml','pkt']: + if not mode in ['none', 'gdb', 'valgrind', 'json', 'yaml','pkt','native']: raise STLArgumentError('mode', mode) # listify @@ -211,6 +211,9 @@ class STLSim(object): elif mode == 'pkt': print STLProfile(stream_list).dump_as_pkt(); return + elif mode == 'native': + print STLProfile(stream_list).dump_to_code() + return # start simulation @@ -406,6 +409,11 @@ def setParserOptions(): action = "store_true", default = False) + group.add_argument("--native", + help = "generate Python code with stateless profile from input file [default is False]", + action = "store_true", + default = False) + return parser @@ -436,6 +444,8 @@ def main (): mode = 'json' elif options.yaml: mode = 'yaml' + elif options.native: + mode = 'native' elif options.pkt: mode = 'pkt' else: |