Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:SME.VHDL.RenderState"/> class.
        /// </summary>
        /// <param name="simulation">The simulation to parse.</param>
        /// <param name="targetfolder">The folder where the output is stored.</param>
        /// <param name="backupfolder">The folder where backups are stored.</param>
        /// <param name="csvtracename">The name of the CSV trace file.</param>
        /// <param name="customfiles">A list of VHDL files to include in the Makefile, without the VHDL extension</param>
        public RenderState(Simulation simulation, string targetfolder, string backupfolder = null, string csvtracename = null, IEnumerable <string> customfiles = null)
        {
            Simulation   = simulation;
            TargetFolder = targetfolder;
            BackupFolder = backupfolder;
            CSVTracename = csvtracename;
            CustomFiles  = customfiles;

            Network = ParseProcesses.BuildNetwork(simulation, true);

            ValidateNetwork(Network);

            TypeScope = new CppTypeScope(Network.Processes.First(x => x.MainMethod != null).MainMethod.SourceMethod.Module);

            Types = Network
                    .All()
                    .OfType <DataElement>()
                    .Select(x => x.CecilType)
                    .Distinct(new TypeRefComp())
                    .ToArray();

            Network.Name = Naming.ToValidName(simulation.Processes.First().Instance.GetType().Assembly.GetName().Name);

            SME.AST.Transform.Apply.Transform(
                Network,
                new SME.AST.Transform.IASTTransform[] {
                new Transformations.AssignNames(),
            },
                m => new SME.AST.Transform.IASTTransform[] {
            },
                m => new SME.AST.Transform.IASTTransform[] {
                new SME.AST.Transform.WrapIfComposite()
            },
                m => new SME.AST.Transform.IASTTransform[] {
                new SME.AST.Transform.RemoveExtraParenthesis()
            }
                );

            Renderer = new RenderHandler(TypeScope);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:SME.CPP.RenderHandler"/> class.
 /// </summary>
 /// <param name="typeScope">The type scope to use.</param>
 public RenderHandler(CppTypeScope typeScope)
 {
     m_typeScope = typeScope;
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:SME.CPP.RenderStateProcess"/> class.
 /// </summary>
 /// <param name="parent">The parent render state.</param>
 /// <param name="process">The process to render.</param>
 public RenderStateProcess(RenderState parent, AST.Process process)
 {
     Parent    = parent;
     Process   = process;
     TypeScope = parent.TypeScope;
 }