pub struct VastFile { /* private fields */ }Implementations§
Source§impl VastFile
impl VastFile
Sourcepub fn new(file_type: VastFileType) -> Self
pub fn new(file_type: VastFileType) -> Self
Create a new VAST file.
Sourcepub fn add_include(&mut self, include: &str)
pub fn add_include(&mut self, include: &str)
Adds a tick-include to the file.
Sourcepub fn add_blank_line(&mut self, blank_line: BlankLine)
pub fn add_blank_line(&mut self, blank_line: BlankLine)
Adds a file-level blank line.
Sourcepub fn add_comment_text(&mut self, text: &str)
pub fn add_comment_text(&mut self, text: &str)
Adds a file-level // ... style comment from text.
pub fn add_module(&mut self, name: &str) -> VastModule
Sourcepub 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
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 theparameters 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.
Sourcepub fn make_literal(
&mut self,
s: &str,
fmt: &IrFormatPreference,
) -> Result<Expr, XlsynthError>
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.
pub fn make_plain_literal( &mut self, value: i32, fmt: &IrFormatPreference, ) -> Expr
pub fn make_comment(&mut self, text: &str) -> Comment
pub fn make_scalar_type(&mut self) -> VastDataType
pub fn make_bit_vector_type( &mut self, bit_count: i64, is_signed: bool, ) -> VastDataType
Sourcepub fn make_bit_vector_type_expr(
&mut self,
width_expr: &Expr,
is_signed: bool,
) -> VastDataType
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].
pub fn make_extern_type(&mut self, entity_name: &str) -> VastDataType
pub fn make_extern_package_type( &mut self, package_name: &str, type_name: &str, ) -> VastDataType
pub fn make_integer_type(&mut self, is_signed: bool) -> VastDataType
pub fn make_int_type(&mut self, is_signed: bool) -> VastDataType
pub fn make_packed_array_type( &mut self, element_type: VastDataType, dimensions: &[i64], ) -> VastDataType
pub fn make_unpacked_array_type( &mut self, element_type: VastDataType, dimensions: &[i64], ) -> VastDataType
pub fn make_slice( &mut self, indexable: &IndexableExpr, hi: i64, lo: i64, ) -> Slice
pub fn make_slice_expr( &mut self, indexable: &IndexableExpr, hi: &Expr, lo: &Expr, ) -> Slice
pub fn make_index(&mut self, indexable: &IndexableExpr, index: i64) -> Index
pub fn make_index_expr( &mut self, indexable: &IndexableExpr, index: &Expr, ) -> Index
pub fn make_concat(&mut self, exprs: &[&Expr]) -> Expr
pub fn make_replicated_concat( &mut self, replication: &Expr, elements: &[&Expr], ) -> Expr
pub fn make_replicated_concat_i64( &mut self, replication_count: i64, elements: &[&Expr], ) -> Expr
pub fn make_array_assignment_pattern(&mut self, elements: &[&Expr]) -> Expr
pub fn make_macro_ref(&mut self, name: &str) -> MacroRef
pub fn make_macro_ref_with_args( &mut self, name: &str, args: &[&Expr], ) -> MacroRef
pub fn make_macro_statement( &mut self, macro_ref: &MacroRef, emit_semicolon: bool, ) -> MacroStatement
pub fn make_not(&mut self, expr: &Expr) -> Expr
pub fn make_negate(&mut self, expr: &Expr) -> Expr
pub fn make_logical_not(&mut self, expr: &Expr) -> Expr
pub fn make_and_reduce(&mut self, expr: &Expr) -> Expr
pub fn make_or_reduce(&mut self, expr: &Expr) -> Expr
pub fn make_xor_reduce(&mut self, expr: &Expr) -> Expr
pub fn make_add(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_sub(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_mul(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_div(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_mod(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_power(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_bitwise_and(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_bitwise_or(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_bitwise_xor(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_bitwise_not(&mut self, expr: &Expr) -> Expr
pub fn make_shll(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_shra(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_shrl(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_ne(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_case_ne(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_eq(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_case_eq(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_ge(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_gt(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_le(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_lt(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_logical_and(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_logical_or(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_ne_x(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_eq_x(&mut self, lhs: &Expr, rhs: &Expr) -> Expr
pub fn make_ternary( &mut self, cond: &Expr, then_expr: &Expr, else_expr: &Expr, ) -> Expr
pub fn make_width_cast(&mut self, width: &Expr, value: &Expr) -> Expr
pub fn make_type_cast(&mut self, data_type: &VastDataType, value: &Expr) -> Expr
pub fn make_continuous_assignment( &mut self, lhs: &Expr, rhs: &Expr, ) -> ContinuousAssignment
pub fn make_pos_edge(&mut self, expr: &Expr) -> Expr
pub fn make_nonblocking_assignment( &mut self, lhs: &Expr, rhs: &Expr, ) -> VastStatement
pub fn make_blocking_assignment( &mut self, lhs: &Expr, rhs: &Expr, ) -> VastStatement
pub fn make_blank_line(&mut self) -> BlankLine
pub fn make_inline_verilog_statement( &mut self, text: &str, ) -> InlineVerilogStatement
pub fn make_unsized_one_literal(&mut self) -> Expr
pub fn make_unsized_zero_literal(&mut self) -> Expr
pub fn make_unsized_x_literal(&mut self) -> Expr
pub fn make_def(&mut self, name: &str, kind: DataKind, ty: &VastDataType) -> Def
pub fn emit(&self) -> String
Auto Trait Implementations§
impl Freeze for VastFile
impl RefUnwindSafe for VastFile
impl !Send for VastFile
impl !Sync for VastFile
impl Unpin for VastFile
impl UnsafeUnpin for VastFile
impl UnwindSafe for VastFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more