Skip to main content

VastFile

Struct VastFile 

Source
pub struct VastFile { /* private fields */ }

Implementations§

Source§

impl VastFile

Source

pub fn new(file_type: VastFileType) -> Self

Create a new VAST file.

Source

pub fn add_include(&mut self, include: &str)

Adds a tick-include to the file.

Source

pub fn add_blank_line(&mut self, blank_line: BlankLine)

Adds a file-level blank line.

Source

pub fn add_comment_text(&mut self, text: &str)

Adds a file-level // ... style comment from text.

Source

pub fn add_module(&mut self, name: &str) -> VastModule

Source

pub fn make_instantiation( &mut self, module_name: &str, instance_name: &str, parameter_port_names: &[&str], parameter_expressions: &[&Expr], connection_port_names: &[&str], connection_expressions: &[Option<&Expr>], ) -> Instantiation

Creates a structure that describes an instantiation of a module that we want to create (as a member within some module, see VastModule::add_member_instantiation).

Args:

  • module_name: The name of the module to instantiate.
  • instance_name: The name of the instance of the module to create.
  • parameter_port_names: The names of the parameters of the module to instantiate.
  • parameter_expressions: The expressions to use in instantiating the parameters of the module.
  • connection_port_names: The names of the ports of the module to instantiate.
  • connection_expressions: The expressions to use in instantiating the ports of the module.
Source

pub fn make_literal( &mut self, s: &str, fmt: &IrFormatPreference, ) -> Result<Expr, XlsynthError>

Makes a literal expression from a string, s, using the given format, fmt. s must be in the form bits[N]:value, where N is the bit width and value is the value of the literal, expressed in decimal, hex, or binary. For example, s might be bits[16]:42 or bits[39]:0xABCD. fmt indicates how the literal should be formatted in the output Verilog.

Source

pub fn make_plain_literal( &mut self, value: i32, fmt: &IrFormatPreference, ) -> Expr

Source

pub fn make_comment(&mut self, text: &str) -> Comment

Source

pub fn make_scalar_type(&mut self) -> VastDataType

Source

pub fn make_bit_vector_type( &mut self, bit_count: i64, is_signed: bool, ) -> VastDataType

Source

pub fn make_bit_vector_type_expr( &mut self, width_expr: &Expr, is_signed: bool, ) -> VastDataType

Creates a bit-vector type with an expression-based width. The emitted range will be [width_expr-1:0].

Source

pub fn make_extern_type(&mut self, entity_name: &str) -> VastDataType

Source

pub fn make_extern_package_type( &mut self, package_name: &str, type_name: &str, ) -> VastDataType

Source

pub fn make_integer_type(&mut self, is_signed: bool) -> VastDataType

Source

pub fn make_int_type(&mut self, is_signed: bool) -> VastDataType

Source

pub fn make_packed_array_type( &mut self, element_type: VastDataType, dimensions: &[i64], ) -> VastDataType

Source

pub fn make_unpacked_array_type( &mut self, element_type: VastDataType, dimensions: &[i64], ) -> VastDataType

Source

pub fn make_slice( &mut self, indexable: &IndexableExpr, hi: i64, lo: i64, ) -> Slice

Source

pub fn make_slice_expr( &mut self, indexable: &IndexableExpr, hi: &Expr, lo: &Expr, ) -> Slice

Source

pub fn make_index(&mut self, indexable: &IndexableExpr, index: i64) -> Index

Source

pub fn make_index_expr( &mut self, indexable: &IndexableExpr, index: &Expr, ) -> Index

Source

pub fn make_concat(&mut self, exprs: &[&Expr]) -> Expr

Source

pub fn make_replicated_concat( &mut self, replication: &Expr, elements: &[&Expr], ) -> Expr

Source

pub fn make_replicated_concat_i64( &mut self, replication_count: i64, elements: &[&Expr], ) -> Expr

Source

pub fn make_array_assignment_pattern(&mut self, elements: &[&Expr]) -> Expr

Source

pub fn make_macro_ref(&mut self, name: &str) -> MacroRef

Source

pub fn make_macro_ref_with_args( &mut self, name: &str, args: &[&Expr], ) -> MacroRef

Source

pub fn make_macro_statement( &mut self, macro_ref: &MacroRef, emit_semicolon: bool, ) -> MacroStatement

Source

pub fn make_not(&mut self, expr: &Expr) -> Expr

Source

pub fn make_negate(&mut self, expr: &Expr) -> Expr

Source

pub fn make_logical_not(&mut self, expr: &Expr) -> Expr

Source

pub fn make_and_reduce(&mut self, expr: &Expr) -> Expr

Source

pub fn make_or_reduce(&mut self, expr: &Expr) -> Expr

Source

pub fn make_xor_reduce(&mut self, expr: &Expr) -> Expr

Source

pub fn make_add(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_sub(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_mul(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_div(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_mod(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_power(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_bitwise_and(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_bitwise_or(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_bitwise_xor(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_bitwise_not(&mut self, expr: &Expr) -> Expr

Source

pub fn make_shll(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_shra(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_shrl(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_ne(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_case_ne(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_eq(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_case_eq(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_ge(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_gt(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_le(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_lt(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_logical_and(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_logical_or(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_ne_x(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_eq_x(&mut self, lhs: &Expr, rhs: &Expr) -> Expr

Source

pub fn make_ternary( &mut self, cond: &Expr, then_expr: &Expr, else_expr: &Expr, ) -> Expr

Source

pub fn make_width_cast(&mut self, width: &Expr, value: &Expr) -> Expr

Source

pub fn make_type_cast(&mut self, data_type: &VastDataType, value: &Expr) -> Expr

Source

pub fn make_continuous_assignment( &mut self, lhs: &Expr, rhs: &Expr, ) -> ContinuousAssignment

Source

pub fn make_pos_edge(&mut self, expr: &Expr) -> Expr

Source

pub fn make_nonblocking_assignment( &mut self, lhs: &Expr, rhs: &Expr, ) -> VastStatement

Source

pub fn make_blocking_assignment( &mut self, lhs: &Expr, rhs: &Expr, ) -> VastStatement

Source

pub fn make_blank_line(&mut self) -> BlankLine

Source

pub fn make_inline_verilog_statement( &mut self, text: &str, ) -> InlineVerilogStatement

Source

pub fn make_unsized_one_literal(&mut self) -> Expr

Source

pub fn make_unsized_zero_literal(&mut self) -> Expr

Source

pub fn make_unsized_x_literal(&mut self) -> Expr

Source

pub fn make_def(&mut self, name: &str, kind: DataKind, ty: &VastDataType) -> Def

Source

pub fn emit(&self) -> String

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.