예제 #1
0
## COPYRIGHT (c) 2019 Schweitzer Engineering Laboratories, Inc.
## SEL Confidential
################################################################################
import sys
import os
testdir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(testdir + '\..\common')
import math
import pytcon
import time
from common import *
from zeromq_manager import ZeromqManager

if __name__ == "__main__":
  print('TCON instance "{}" connecting to FA at tcp://127.0.0.1:{}'.format(sys.argv[1], sys.argv[2]))
  tcon = pytcon.Tcon(ZeromqManager('tcp://127.0.0.1:' + sys.argv[2]))

  tb = TopLevelTB(tcon)
  tb.print_banner('204_128k', '128k Words', '2.4')
  tb.setup_environment()

  HIGH_ADDR, DATA_WIDTH, ADDR_WIDTH, BASE_ADDR = read_spec(testdir + '/sim_params.txt')

  # Record before time
  before_time = time.time()

  # Run test
  test_method_1(tb, HIGH_ADDR)

  # Record before time
  after_time = time.time()
예제 #2
0
#    Functions/constants common to all tests. Needs approval for modification
#
###############################################################################

# Setup logging
log = logging.getLogger()  # 'root' Logger
console = logging.StreamHandler()
format_str = '%(levelname)s::%(filename)s:line-%(lineno)s:: %(message)s: '
console.setFormatter(logging.Formatter(format_str))
log.addHandler(console)  # prints to console.
log.setLevel(logging.ERROR)  # anything ERROR or above

# Initialize TCON 2.0
print(f"TCON instance '{sys.argv[-2]}' connecting to FA at tcp://127.0.0.1: "
      f"{sys.argv[-1]}")
tcon = pytcon.Tcon(ZeromqManager(f"tcp://127.0.0.1:{sys.argv[-1]}"))
tcon.resolution = tcon.NANOSECONDS
TIME_UNIT = "ps" if tcon.resolution == tcon.PICOSECONDS else \
            "ns" if tcon.resolution == tcon.NANOSECONDS else \
            "ms"

##########################################################
# System Definitions
##########################################################
GPIO_RESET          = (1 << 0)   # Output


def do_reset(num_clocks):
    """Asserts reset for number of cycles to reset, if implemented, the
    tb/UUT. Reset is de-asserted after given number of clock cycles