[][src]Struct open_vaf::ir::hir::Hir

pub struct Hir {
    pub parameters: IndexVec<ParameterId, AttributeNode<Parameter>>,
    pub branches: IndexVec<BranchId, AttributeNode<BranchDeclaration>>,
    pub nets: IndexVec<NetId, AttributeNode<Net>>,
    pub ports: IndexVec<PortId, Port>,
    pub variables: IndexVec<VariableId, AttributeNode<Variable>>,
    pub modules: IndexVec<ModuleId, AttributeNode<Module>>,
    pub functions: IndexVec<FunctionId, AttributeNode<Function>>,
    pub disciplines: IndexVec<DisciplineId, AttributeNode<Discipline>>,
    pub natures: IndexVec<NatureId, AttributeNode<Nature>>,
    pub expressions: IndexVec<ExpressionId, Node<Expression>>,
    pub attributes: IndexVec<AttributeId, Attribute>,
    pub statements: IndexVec<StatementId, Statement>,
}

An High level (tree) IR representing a Verilog-AMS project; It provides stable indicies for every Node because the entire Tree is immutable once created; It uses preallocated constant size arrays for better performance Compared to an AST all references are resolved to their respective ids here and unnecessary constructs like blocks are ignored

Fields

parameters: IndexVec<ParameterId, AttributeNode<Parameter>>branches: IndexVec<BranchId, AttributeNode<BranchDeclaration>>nets: IndexVec<NetId, AttributeNode<Net>>ports: IndexVec<PortId, Port>variables: IndexVec<VariableId, AttributeNode<Variable>>modules: IndexVec<ModuleId, AttributeNode<Module>>functions: IndexVec<FunctionId, AttributeNode<Function>>disciplines: IndexVec<DisciplineId, AttributeNode<Discipline>>natures: IndexVec<NatureId, AttributeNode<Nature>>expressions: IndexVec<ExpressionId, Node<Expression>>attributes: IndexVec<AttributeId, Attribute>statements: IndexVec<StatementId, Statement>

Implementations

impl Hir[src]

pub fn lower(
    self
) -> (Result<Mir, (Vec<Error<Type>>, Hir)>, Vec<Error<WarningType>>)
[src]

Folds an hir to an mir by adding and checking type information Returns any errors that occur

pub fn lower_and_print_errors(
    self,
    source_map: &SourceMap,
    translate_line: bool
) -> Option<Mir>
[src]

Folds an hir to an mir by adding and checking type information Prints any errors that occur

Trait Implementations

impl Index<AttributeId> for Hir[src]

type Output = Attribute

The returned type after indexing.

impl Index<BranchId> for Hir[src]

type Output = AttributeNode<BranchDeclaration>

The returned type after indexing.

impl Index<DisciplineId> for Hir[src]

type Output = AttributeNode<Discipline>

The returned type after indexing.

impl Index<ExpressionId> for Hir[src]

type Output = Node<Expression>

The returned type after indexing.

impl Index<FunctionId> for Hir[src]

type Output = AttributeNode<Function>

The returned type after indexing.

impl Index<IdRange<AttributeId>> for Hir[src]

type Output = IndexSlice<AttributeId, [Attribute]>

The returned type after indexing.

impl Index<IdRange<BranchId>> for Hir[src]

type Output = IndexSlice<BranchId, [AttributeNode<BranchDeclaration>]>

The returned type after indexing.

impl Index<IdRange<DisciplineId>> for Hir[src]

type Output = IndexSlice<DisciplineId, [AttributeNode<Discipline>]>

The returned type after indexing.

impl Index<IdRange<ExpressionId>> for Hir[src]

type Output = IndexSlice<ExpressionId, [Node<Expression>]>

The returned type after indexing.

impl Index<IdRange<FunctionId>> for Hir[src]

type Output = IndexSlice<FunctionId, [AttributeNode<Function>]>

The returned type after indexing.

impl Index<IdRange<ModuleId>> for Hir[src]

type Output = IndexSlice<ModuleId, [AttributeNode<Module>]>

The returned type after indexing.

impl Index<IdRange<NatureId>> for Hir[src]

type Output = IndexSlice<NatureId, [AttributeNode<Nature>]>

The returned type after indexing.

impl Index<IdRange<NetId>> for Hir[src]

type Output = IndexSlice<NetId, [AttributeNode<Net>]>

The returned type after indexing.

impl Index<IdRange<ParameterId>> for Hir[src]

type Output = IndexSlice<ParameterId, [AttributeNode<Parameter>]>

The returned type after indexing.

impl Index<IdRange<PortId>> for Hir[src]

type Output = IndexSlice<PortId, [Port]>

The returned type after indexing.

impl Index<IdRange<StatementId>> for Hir[src]

type Output = IndexSlice<StatementId, [Statement]>

The returned type after indexing.

impl Index<IdRange<VariableId>> for Hir[src]

type Output = IndexSlice<VariableId, [AttributeNode<Variable>]>

The returned type after indexing.

impl Index<ModuleId> for Hir[src]

type Output = AttributeNode<Module>

The returned type after indexing.

impl Index<NatureId> for Hir[src]

type Output = AttributeNode<Nature>

The returned type after indexing.

impl Index<NetId> for Hir[src]

type Output = AttributeNode<Net>

The returned type after indexing.

impl Index<ParameterId> for Hir[src]

type Output = AttributeNode<Parameter>

The returned type after indexing.

impl Index<PortId> for Hir[src]

type Output = Port

The returned type after indexing.

impl Index<Range<AttributeId>> for Hir[src]

type Output = IndexSlice<AttributeId, [Attribute]>

The returned type after indexing.

impl Index<Range<BranchId>> for Hir[src]

type Output = IndexSlice<BranchId, [AttributeNode<BranchDeclaration>]>

The returned type after indexing.

impl Index<Range<DisciplineId>> for Hir[src]

type Output = IndexSlice<DisciplineId, [AttributeNode<Discipline>]>

The returned type after indexing.

impl Index<Range<ExpressionId>> for Hir[src]

type Output = IndexSlice<ExpressionId, [Node<Expression>]>

The returned type after indexing.

impl Index<Range<FunctionId>> for Hir[src]

type Output = IndexSlice<FunctionId, [AttributeNode<Function>]>

The returned type after indexing.

impl Index<Range<ModuleId>> for Hir[src]

type Output = IndexSlice<ModuleId, [AttributeNode<Module>]>

The returned type after indexing.

impl Index<Range<NatureId>> for Hir[src]

type Output = IndexSlice<NatureId, [AttributeNode<Nature>]>

The returned type after indexing.

impl Index<Range<NetId>> for Hir[src]

type Output = IndexSlice<NetId, [AttributeNode<Net>]>

The returned type after indexing.

impl Index<Range<ParameterId>> for Hir[src]

type Output = IndexSlice<ParameterId, [AttributeNode<Parameter>]>

The returned type after indexing.

impl Index<Range<PortId>> for Hir[src]

type Output = IndexSlice<PortId, [Port]>

The returned type after indexing.

impl Index<Range<StatementId>> for Hir[src]

type Output = IndexSlice<StatementId, [Statement]>

The returned type after indexing.

impl Index<Range<VariableId>> for Hir[src]

type Output = IndexSlice<VariableId, [AttributeNode<Variable>]>

The returned type after indexing.

impl Index<StatementId> for Hir[src]

type Output = Statement

The returned type after indexing.

impl Index<VariableId> for Hir[src]

type Output = AttributeNode<Variable>

The returned type after indexing.

impl IndexMut<AttributeId> for Hir[src]

impl IndexMut<BranchId> for Hir[src]

impl IndexMut<DisciplineId> for Hir[src]

impl IndexMut<ExpressionId> for Hir[src]

impl IndexMut<FunctionId> for Hir[src]

impl IndexMut<IdRange<AttributeId>> for Hir[src]

impl IndexMut<IdRange<BranchId>> for Hir[src]

impl IndexMut<IdRange<DisciplineId>> for Hir[src]

impl IndexMut<IdRange<ExpressionId>> for Hir[src]

impl IndexMut<IdRange<FunctionId>> for Hir[src]

impl IndexMut<IdRange<ModuleId>> for Hir[src]

impl IndexMut<IdRange<NatureId>> for Hir[src]

impl IndexMut<IdRange<NetId>> for Hir[src]

impl IndexMut<IdRange<ParameterId>> for Hir[src]

impl IndexMut<IdRange<PortId>> for Hir[src]

impl IndexMut<IdRange<StatementId>> for Hir[src]

impl IndexMut<IdRange<VariableId>> for Hir[src]

impl IndexMut<ModuleId> for Hir[src]

impl IndexMut<NatureId> for Hir[src]

impl IndexMut<NetId> for Hir[src]

impl IndexMut<ParameterId> for Hir[src]

impl IndexMut<PortId> for Hir[src]

impl IndexMut<Range<AttributeId>> for Hir[src]

impl IndexMut<Range<BranchId>> for Hir[src]

impl IndexMut<Range<DisciplineId>> for Hir[src]

impl IndexMut<Range<ExpressionId>> for Hir[src]

impl IndexMut<Range<FunctionId>> for Hir[src]

impl IndexMut<Range<ModuleId>> for Hir[src]

impl IndexMut<Range<NatureId>> for Hir[src]

impl IndexMut<Range<NetId>> for Hir[src]

impl IndexMut<Range<ParameterId>> for Hir[src]

impl IndexMut<Range<PortId>> for Hir[src]

impl IndexMut<Range<StatementId>> for Hir[src]

impl IndexMut<Range<VariableId>> for Hir[src]

impl IndexMut<StatementId> for Hir[src]

impl IndexMut<VariableId> for Hir[src]

Auto Trait Implementations

impl RefUnwindSafe for Hir

impl Send for Hir

impl Sync for Hir

impl Unpin for Hir

impl UnwindSafe for Hir

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.