Beispiel #1
0
 public WatermarkOptions(VHDLDocument document)
 {
     WatermarkSettings       = new List <InWatermarkSettings>();
     SignatureOutputSettings = new List <OutWatermarkSettings>();
     WotermarikingDocument   = new WotermarikingDocument(document);
     WotermarikingDocument.Parse();
 }
Beispiel #2
0
        public List <ValidationResilt> Validate(VHDLDocument document)
        {
            var a    = document.Components.Where(x => x.Name.ToUpper().Contains("LUT")).ToList();
            var maps = document.Maps.Where(x => x.Entity == null).ToList();

            return(new List <ValidationResilt>());
        }
Beispiel #3
0
 protected Map(Map map)
 {
     Name               = map.Name;
     EntityName         = map.EntityName;
     Entity             = map.Entity;
     Assigmnets         = map.Assigmnets;
     GenericAssignments = map.GenericAssignments;
     Document           = map.Document;
     Text               = map.Text;
 }
Beispiel #4
0
 public bool Insert(VHDLDocument document)
 {
     if (Document == null)
     {
         _document = document;
         document.AddVHDLInBehaviorSection(this.ToString());
         return(true);
     }
     return(false);
 }
Beispiel #5
0
        public static Map Parse(VHDLDocument document, string text)
        {
            var title             = Regex.Match(text, PC.RegularTitle).Value;
            var assigments        = Regex.Match(text, PC.Assigments).Value;
            var genericAssigments = Regex.Match(text, PC.GenericAsigments).Value;
            Map newMap            = new Map(document, text)
            {
                Name       = Regex.Match(title, PC.MapName).Value,
                EntityName = Regex.Match(title, PC.MapEntity).Value
            };

            newMap.Entity             = document.Components.FirstOrDefault(x => x.Name == newMap.EntityName);
            newMap.GenericAssignments =
                PC.MatchesToStrings(Regex.Matches(genericAssigments, PC.OneGenericAssimnet)).Select(asgn => GenericAssignment.Parse(newMap, asgn)).ToList();

            newMap.Assigmnets =
                PC.MatchesToStrings(Regex.Matches(assigments, PC.OneAssimnet)).Select(asgn => Assignment.Parse(newMap, asgn)).ToList();
            return(newMap);
        }
Beispiel #6
0
        private void watermarkButton_Click(object sender, EventArgs e)
        {
            if (_document != null)
            {
                //_watermarkOptions.SignatureOutputSettings.ForEach(x=>x.Port.Name = _document.IOBuffesLayer.GetInsideSignal(x.Port).Name);
                //_watermarkOptions.WatermarkSettings.ForEach(x => x.Port.Name = _document.IOBuffesLayer.GetInsideSignal(x.Port).Name);

                WatermarkService service = new WatermarkService(_document);
                _document = service.Watermark(_watermarkOptions);
                WatermarkedTextForm form = new WatermarkedTextForm(_document);
                form.ShowDialog();
            }
            else
            {
                string            message = "Entity required";
                string            caption = "Entity required";
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                MessageBox.Show(message, caption, buttons);
            }
        }
Beispiel #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (curentVHDLFile != null)
            {
                inputListBox.Items.Clear();
                outputListBox.Items.Clear();

                var fileService = new FileService();

                vhdlLib  = fileService.GetVHDL(@"D:\111\unisim_VCOMP.vhd");
                vhdlCode = fileService.GetVHDL(curentVHDLFile);

                _document = new VHDLDocument(vhdlCode);
                _document.Parse(vhdlLib);
                _watermarkOptions = new WatermarkOptions(_document);
                Validator validator = new Validator();
                var       results   = validator.Validate(_document);

                //TODO Null Checks
                if (_document.Entity == null)
                {
                    string            message = "You did not enter a server name. Cancel this operation?";
                    string            caption = "There is no entity parsed";
                    MessageBoxButtons buttons = MessageBoxButtons.OK;
                    MessageBox.Show(message, caption, buttons);
                }
                else
                {
                    infoGroupBox.Enabled = true;
                    _document.Entity.Ports.Where(p => p.PortType == PortTypes.In).ToList().ForEach(x => inputListBox.Items.Add(x));
                    _document.Entity.Ports.Where(p => p.PortType == PortTypes.Out).ToList().ForEach(x => outputListBox.Items.Add(x));
                    entityNameLabel.Text = "Entity Name: " + _document.Entity.Name;
                    freeBitsLabel.Text   = "Free Bits for Watermarking: " + _watermarkOptions.WotermarikingDocument.FreeLuts.Count() + " bits";
                }
                //File.WriteAllText(@"D:\111.vhdl", document.Text);
            }
        }
 public SearchService(VHDLDocument document)
 {
     _document = document;
 }
Beispiel #9
0
 public Decoder(VHDLDocument document, Signal signalToReturnValue)
 {
     Document            = document;
     SignalToReturnValue = signalToReturnValue;
     CodedSignals        = new List <DecoderSignalCode>();
 }
Beispiel #10
0
 public LUTComponents(VHDLDocument document)
 {
     Document = document;
     LUTs     = document.Components.Where(LUT.IsLUT).Select(LUT.FromEntity)
                .OrderBy(lut => lut.Bits).ToList();
 }
Beispiel #11
0
 public IOBuffesLayer(VHDLDocument document)
 {
     Document    = document;
     Equivalents = new Dictionary <SignalDefenition, SignalDefenition>();
 }
Beispiel #12
0
 public Router(VHDLDocument document)
 {
     Document = document;
     _routes  = new Dictionary <string, SignalEntity>();
     _dusses  = new List <Bus>();
 }
Beispiel #13
0
 public Parser(VHDLDocument document)
 {
     Document = document;
 }
 public WatermarkService(VHDLDocument document)
 {
     _document = document;
 }
Beispiel #15
0
 public WotermarikingDocument(VHDLDocument document)
 {
     Document = document;
 }
Beispiel #16
0
 public WatermarkedTextForm(VHDLDocument document)
 {
     InitializeComponent();
     watermarkedVHDLRichTextBox.Text = document.Text;
 }
Beispiel #17
0
 public Map(VHDLDocument document, string text)
 {
     Document = document;
     Text     = text;
 }