private void CreateTestBenchDiadramm_CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            bool suggestion1 = ((core != null) && (core.IsCompilerBusy != true));

            if (suggestion1 == false)
            {
                e.CanExecute = false;
                return;
            }
            bool suggestion2 = ((TreeViewDesignBrowser != null) && (TreeViewDesignBrowser.SelectedItem != null));

            if (suggestion2 == false)
            {
                e.CanExecute = false;
                return;
            }
            VHDL.libraryunit.Architecture arch = (TreeViewDesignBrowser.SelectedItem as TreeViewItem).Tag as VHDL.libraryunit.Architecture;
            if (arch != null)
            {
                VHDL.libraryunit.Entity entity = arch.Entity;
                if ((entity != null) && (entity.Port.Count != 0))
                {
                    e.CanExecute = true;
                    return;
                }
            }
            e.CanExecute = false;
        }
        /// <summary>
        /// Получение параметров {имя архитектуры, entity, имя файла}
        /// с текущего выбранного элемента в дереве
        /// </summary>
        /// <param name="ArchName"></param>
        /// <param name="EntityName"></param>
        /// <param name="fileName"></param>
        private bool FormArgumentsForSimulation(out string ArchName, out string EntityName, out string FileName)
        {
            ArchName   = string.Empty;
            EntityName = string.Empty;
            FileName   = string.Empty;

            if ((TreeViewDesignBrowser.SelectedItem == null) || ((TreeViewDesignBrowser.SelectedItem is TreeViewItem) == false))
            {
                return(false);
            }

            VHDL.libraryunit.Architecture arch = (TreeViewDesignBrowser.SelectedItem as TreeViewItem).Tag as VHDL.libraryunit.Architecture;
            if (arch != null)
            {
                ArchName   = arch.Identifier;
                EntityName = arch.Entity.Identifier;

                if (arch.AnnotationList.ContainsKey(arch))
                {
                    List <object> annotations = arch.AnnotationList[arch];
                    if (annotations != null)
                    {
                        foreach (object o in annotations)
                        {
                            if (o is VHDL.annotation.PositionInformation)
                            {
                                FileName = (o as VHDL.annotation.PositionInformation).FileName;
                                return(true);
                            }
                        }
                    }
                }
            }
            return(false);
        }
        /// <summary>
        /// Получение дочерних элементов архитектуры
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public static IList <VHDL.VhdlElement> GetSubElements(VHDL.libraryunit.Architecture arch)
        {
            List <VHDL.VhdlElement> res = new List <VHDL.VhdlElement>();

            res.AddRange(FilterDesignElements(arch.Declarations));
            res.AddRange(FilterDesignElements(arch.Statements));
            return(res);
        }
 public VHDLCompilerInterface(VHDL.libraryunit.Architecture architecture, Logger logger)
 {
     this.logger         = logger;
     this.architecture   = architecture;
     typeDictionary      = new VHDLTypeDictionary();
     objectDictionary    = new VHDLObjectDictionary();
     literalDictionary   = new VHDLLiteralDictionary();
     typeRangeDictionary = new VHDLTypeRangeDictionary();
 }
Beispiel #5
0
        public ModelingSystemCore(VHDL.libraryunit.Architecture architecture, VHDL.LibraryDeclarativeRegion library, VHDL.RootDeclarativeRegion rootDeclarationRegion)
        {
            ExpressionEvaluator.DefaultEvaluator = new ExpressionEvaluator(this);
            this.architecture          = architecture;
            this.library               = library;
            this.rootDeclarationRegion = rootDeclarationRegion;
            functionAnalyser           = new FunctionAnalyser(architecture.Scope);
            currentScope               = new List <IValueProvider>();
            signalScope = new List <Signal>();

            now = new TIME_VALUE(0);

            FormDefaultResultScope();
        }
Beispiel #6
0
        public ModelingSystemCore(VHDL.libraryunit.Architecture architecture, VHDL.LibraryDeclarativeRegion library, VHDL.RootDeclarativeRegion rootDeclarationRegion, SimulationScope scope)
        {
            ExpressionEvaluator.DefaultEvaluator = new ExpressionEvaluator(this);
            this.architecture          = architecture;
            this.library               = library;
            this.rootDeclarationRegion = rootDeclarationRegion;
            functionAnalyser           = new FunctionAnalyser(architecture.Scope);
            currentScope               = new List <IValueProvider>();
            signalScope = new List <Signal>();

            now = new TIME_VALUE(0);

            result_scope = scope;
            foreach (var s in scope.Variables)
            {
                if (s is Signal)
                {
                    signalScope.Add(s as Signal);
                    currentScope.Add(s as Signal);
                }
            }
        }
Beispiel #7
0
 /// <summary>
 /// Creates an entity aspect based on an architecture.
 /// </summary>
 /// <param name="architecute">the architecture</param>
 /// <returns>the created entity aspect</returns>
 public static EntityAspect architecture(Architecture architecute)
 {
     return(new ArchitectureEntityAspect(architecute));
 }
Beispiel #8
0
 public ArchitectureEntityAspect(Architecture architecture)
 {
     this.architecture = architecture;
 }