def get_device(self, wait_for_removal):
        vcd_filename = self.p._('VCD Filename')
        vcd_filename = "sim.vcd"
        print "VCD FILENAME=",vcd_filename
        if vcd_filename:
            tb.init(vcd_filename)
        else:
            tb.init()

        dev = UXN1230.UXN1230(tb.get_dev())
        UXN1230.init_dev(dev)
        return dev 
    def get_device(self):
        dev=UXN1230.get_dev()

        # check if serial number has ever been set
        serial = dev.get_serial()
        self.log.info ( "Device Serial: %s" % serial )
        if serial == u'\uffff'* 8:
            while True:
                serial = "U" + str(uuid.uuid4())[-7:].upper()
                if serial not in list(self.config.datastore.iter_serialnums()):
                    break
                self.log.debug ( "Serial number conflict: %s.  Trying again." % serial )
            self.log.info ( "Setting new device serial to %s." % serial )
            dev.set_serial(serial)

        self.config.set_serial([serial])
        return dev