Struct vcd::Writer
[−]
[src]
pub struct Writer<'w> { /* fields omitted */ }Struct wrapping an io::Write with methods for writing VCD commands and data.
Methods
impl<'s> Writer<'s>[src]
fn new(writer: &mut Write) -> Writer
Creates a Writer, wrapping an io::Write.
let mut buf = Vec::new(); let mut vcd = vcd::Writer::new(&mut buf);
fn header(&mut self, h: &Header) -> Result<()>
Writes a complete header with the fields from a Header struct from the parser.
fn comment(&mut self, v: &str) -> Result<()>
Writes a $comment command.
fn date(&mut self, v: &str) -> Result<()>
Writes a $date command.
fn version(&mut self, v: &str) -> Result<()>
Writes a $version command.
fn timescale(&mut self, ts: u32, unit: TimescaleUnit) -> Result<()>
Writes a $timescale command.
fn scope_def(&mut self, t: ScopeType, i: &str) -> Result<()>
Writes a $scope command.
fn add_module(&mut self, identifier: &str) -> Result<()>
Writes a $scope command for a module.
Convenience wrapper around scope_def.
fn upscope(&mut self) -> Result<()>
Writes an $upscope command.
fn scope(&mut self, s: &Scope) -> Result<()>
Writes a $scope command, a series of $var commands, and an $upscope commands from
a Scope structure from the parser.
fn var_def(
&mut self,
var_type: VarType,
width: u32,
id: IdCode,
reference: &str
) -> Result<()>
&mut self,
var_type: VarType,
width: u32,
id: IdCode,
reference: &str
) -> Result<()>
Writes a $var command with a specified id.
fn add_var(
&mut self,
var_type: VarType,
width: u32,
reference: &str
) -> Result<IdCode>
&mut self,
var_type: VarType,
width: u32,
reference: &str
) -> Result<IdCode>
Writes a $var command with the next available ID, returning the assigned ID.
Convenience wrapper around var_def.
fn add_wire(&mut self, width: u32, reference: &str) -> Result<IdCode>
Adds a $var for a wire with the next available ID, returning the assigned ID.
Convenience wrapper around add_var.
fn var(&mut self, v: &Var) -> Result<()>
Writes a $var command from a Var structure from the parser.
fn enddefinitions(&mut self) -> Result<()>
Writes a $enddefinitions command to end the header.
fn timestamp(&mut self, ts: u64) -> Result<()>
Writes a #xxx timestamp.
fn change_scalar<V: Into<Value>>(&mut self, id: IdCode, v: V) -> Result<()>
Writes a change to a scalar variable.
fn change_vector(&mut self, id: IdCode, v: &[Value]) -> Result<()>
Writes a change to a vector variable.
fn change_real(&mut self, id: IdCode, v: f64) -> Result<()>
Writes a change to a real variable.
fn change_string(&mut self, id: IdCode, v: &str) -> Result<()>
Writes a change to a string variable.
fn begin(&mut self, c: SimulationCommand) -> Result<()>
Writes the beginning of a simulation command.
fn end(&mut self) -> Result<()>
Writes an $end to end a simulation command.
fn command(&mut self, c: &Command) -> Result<()>
Writes a command from a Command enum as parsed by the parser.