Skip to content

Commit

Permalink
software/litescope_cli: set default length to None (do a capture with…
Browse files Browse the repository at this point in the history
… max depth).
  • Loading branch information
enjoy-digital committed Sep 2, 2020
1 parent bd10138 commit 12be703
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion litescope/software/driver/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def configure_trigger(self, value=0, mask=0, cond=None):
def configure_subsampler(self, value):
self.subsampler_value.write(value-1)

def run(self, offset = 0, length = None):
def run(self, offset=0, length=None):
if length is None:
length = self.depth
assert offset < self.depth
Expand Down
7 changes: 5 additions & 2 deletions litescope/software/litescope_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def parse_args():
parser.add_argument("-l", "--list", action="store_true", help="List signal choices")
parser.add_argument("--subsampling", default="1", help="Capture Subsampling.")
parser.add_argument("--offset", default="32", help="Capture Offset.")
parser.add_argument("--length", default="128", help="Capture Length.")
parser.add_argument("--length", default=None, help="Capture Length.")
args = parser.parse_args()
return args

Expand Down Expand Up @@ -112,7 +112,10 @@ def main():
if not add_triggers(args, analyzer, signals):
print("WARNING: no trigger added!")

analyzer.run(offset=int(args.offset, 0), length=int(args.length, 0))
analyzer.run(
offset = int(args.offset, 0),
length = None if args.length is None else int(args.length, 0)
)

analyzer.wait_done()
analyzer.upload()
Expand Down

0 comments on commit 12be703

Please sign in to comment.