mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
16 lines
312 B
Python
16 lines
312 B
Python
import random
|
|
|
|
def randn(max_n):
|
|
return random.randint(0, max_n-1)
|
|
|
|
|
|
class RandRun:
|
|
def __init__(self, level=0):
|
|
self.run = True
|
|
self.level = level
|
|
|
|
def do_simulation(self, selfp):
|
|
self.run = True
|
|
n = randn(100)
|
|
if n < self.level:
|
|
self.run = False
|