Skip to content

Commit

Permalink
scripts: add random seed to emu runs (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
poemonsense committed Aug 19, 2021
1 parent a4a566a commit 59bcbb5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/xiangshan.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@

# Simple version of xiangshan python wrapper

import os
import argparse
import sys
import os
import random
import subprocess
import sys


class XSArgs(object):
Expand Down Expand Up @@ -53,6 +54,7 @@ def __init__(self, args):
self.config = args.config
# emu arguments
self.max_instr = args.max_instr
self.seed = random.randint(0, 9999)
self.numa = args.numa

def get_env_variables(self):
Expand Down Expand Up @@ -86,7 +88,8 @@ def get_makefile_args(self):

def get_emu_args(self):
emu_args = [
(self.max_instr, "max-instr")
(self.max_instr, "max-instr"),
(self.seed, "seed")
]
args = filter(lambda arg: arg[0] is not None, emu_args)
return args
Expand Down

0 comments on commit 59bcbb5

Please sign in to comment.