blob: 043462a52fe1789b8b339c8bb8d4a9a1a400e9d9 [file] [log] [blame]
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
use crate::transport::ti50emulator::Ti50Emulator;
use crate::transport::Transport;
use anyhow::Result;
use std::path::PathBuf;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
pub struct Ti50EmulatorOpts {
#[structopt(long, default_value = "ti50")]
instance_prefix: String,
#[structopt(long, parse(from_os_str), default_value = "/tools/host_emulation")]
executable_directory: PathBuf,
#[structopt(long, default_value = "host_emulation")]
executable: String,
}
pub fn create(args: &Ti50EmulatorOpts) -> Result<Box<dyn Transport>> {
Ok(Box::new(Ti50Emulator::open(
&args.executable_directory,
&args.executable,
&args.instance_prefix,
)?))
}