示例#1
0
    def __init__(self, dut, period=CLK_PERIOD):
        self.status = Status()
        self.status.set_level('verbose')
        self.comm_lock = cocotb.triggers.Lock('comm')
        self.dut = dut
        dev_dict = json.load(open('test_dict.json'))
        super(NysaSim, self).__init__(dev_dict, self.status)

        self.timeout = 1000
        self.response = Array('B')

        self.dut.rst <= 0
        self.dut.ih_reset <= 0

        self.dut.in_ready <= 0
        self.dut.in_command <= 0
        self.dut.in_address <= 0
        self.dut.in_data <= 0
        self.dut.in_data_count <= 0
        gd = GenSDB()
        self.rom = gd.gen_rom(self.dev_dict, debug=False)

        #yield ClockCycles(self.dut.clk, 10)

        cocotb.fork(Clock(dut.clk, period).start())
示例#2
0
    def __init__(self, dut, sim_config, period = CLK_PERIOD, user_paths = []):
        self.status = Status()
        self.status.set_level('verbose')
        self.user_paths = user_paths
        self.comm_lock = cocotb.triggers.Lock('comm')
        self.dut                              = dut
        dev_dict                              = json.load(open(sim_config), object_pairs_hook = OrderedDict)
        super (NysaSim, self).__init__(dev_dict, self.status)

        self.timeout                          = 1000
        self.response                         = Array('B')

        self.dut.rst                          <= 0
        self.dut.ih_reset                     <= 0

        self.dut.in_ready                     <= 0
        self.dut.in_command                   <= 0
        self.dut.in_address                   <= 0
        self.dut.in_data                      <= 0
        self.dut.in_data_count                <= 0
        gd = GenSDB()
        self.callbacks = {}
        self.rom = gd.gen_rom(self.dev_dict, user_paths = self.user_paths, debug = False)

        cocotb.fork(Clock(dut.clk, period).start())
        cocotb.fork(self.interrupt_interface())
示例#3
0
    def __init__(self, dut, sim_config, period=CLK_PERIOD, user_paths=[]):
        self.status = Status()
        self.status.set_level('verbose')
        self.user_paths = user_paths
        self.comm_lock = cocotb.triggers.Lock('comm')
        self.dut = dut
        dev_dict = json.load(open(sim_config), object_pairs_hook=OrderedDict)
        super(NysaSim, self).__init__(dev_dict, self.status)

        self.timeout = 1000
        self.response = Array('B')

        self.dut.rst <= 0
        self.dut.ih_reset <= 0

        self.dut.in_ready <= 0
        self.dut.in_command <= 0
        self.dut.in_address <= 0
        self.dut.in_data <= 0
        self.dut.in_data_count <= 0
        gd = GenSDB()
        self.callbacks = {}
        self.rom = gd.gen_rom(self.dev_dict,
                              user_paths=self.user_paths,
                              debug=False)

        cocotb.fork(Clock(dut.clk, period).start())
        cocotb.fork(self.interrupt_interface())
示例#4
0
    def __init__(self, dut, uart_if, sim_config, period = CLK_PERIOD, user_paths = [], status = None):
        self.dev_dict                              = json.load(open(sim_config), object_pairs_hook = OrderedDict)
        Nysa.__init__(self, Status())
        self.s.set_level('verbose')
        self.user_paths = user_paths
        self.comm_lock = cocotb.triggers.Lock('comm')
        self.dut                              = dut
        cocotb.fork(Clock(dut.clk, period).start())
        gd = GenSDB()
        self.rom = gd.gen_rom(self.dev_dict, user_paths = self.user_paths, debug = False)

        self.uart = uart_if
        self.response = Array('B')
示例#5
0
    def read_sdb(self):
        """read_sdb

        Read the contents of the DRT

        Args:
          Nothing

        Returns (Array of bytes):
          the raw DRT data, this can be ignored for normal operation

        Raises:
          Nothing
        """
        if self.s: self.s.Verbose("entered")
        gd = GenSDB()
        self.rom = gd.gen_rom(self.dev_dict, debug = False)
        return self.nsm.read_sdb(self)
示例#6
0
    def read_sdb(self):
        """read_sdb

        Read the contents of the DRT

        Args:
          Nothing

        Returns (Array of bytes):
          the raw DRT data, this can be ignored for normal operation

        Raises:
          Nothing
        """
        self.s.Verbose("entered")
        gd = GenSDB()
        self.rom = gd.gen_rom(self.dev_dict, user_paths = self.user_paths, debug = False)

        return self.nsm.read_sdb(self)
示例#7
0
    def __init__(self,
                 dut,
                 uart_if,
                 sim_config,
                 period=CLK_PERIOD,
                 user_paths=[],
                 status=None):
        self.dev_dict = json.load(open(sim_config),
                                  object_pairs_hook=OrderedDict)
        Nysa.__init__(self, Status())
        self.s.set_level('verbose')
        self.user_paths = user_paths
        self.comm_lock = cocotb.triggers.Lock('comm')
        self.dut = dut
        cocotb.fork(Clock(dut.clk, period).start())
        gd = GenSDB()
        self.rom = gd.gen_rom(self.dev_dict,
                              user_paths=self.user_paths,
                              debug=False)

        self.uart = uart_if
        self.response = Array('B')