Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string[] Mops;
            char[]   cha;
            string[] var;
            string   val;

            Cursor.Current = Cursors.WaitCursor;
            if (radioButton1.Checked)
            {
                lines = System.IO.File.ReadAllLines("../../../../template/Petajon.sv");
            }
            else if (radioButton2.Checked)
            {
                lines = System.IO.File.ReadAllLines("../../../../template/Petajon.sv");
            }
            if (checkBox11.Checked)
            {
                FilterPos("WB");
            }
            else
            {
                FilterNeg("WB");
            }
            if (checkBox12.Checked)
            {
                FilterPos("AXI");
            }
            else
            {
                FilterNeg("AXI");
            }
            if (checkBox13.Checked)
            {
                FilterPos("S100");
            }
            else
            {
                FilterNeg("S100");
            }
            if (radioButton1.Checked)
            {
                FilterPos("RV32I");
            }
            else
            {
                FilterNeg("RV32I");
            }
            if (radioButton2.Checked)
            {
                FilterPos("RV64I");
            }
            else
            {
                FilterNeg("RV64I");
            }
            if (checkBox1.Checked)
            {
                FilterPos("A");
            }
            else
            {
                FilterNeg("A");
            }
            if (checkBox4.Checked)
            {
                FilterPos("M");
            }
            else
            {
                FilterNeg("M");
            }
            if (checkBox2.Checked)
            {
                FilterPos("F");
            }
            else
            {
                FilterNeg("F");
            }
            if (checkBox22.Checked)
            {
                FilterPos("U");
            }
            else
            {
                FilterNeg("U");
            }
            if (fma)
            {
                FilterPos("FMA");
            }
            else
            {
                FilterNeg("FMA");
            }
            if (checkBox23.Checked)
            {
                FilterPos("PGMAP");
            }
            else
            {
                FilterNeg("PGMAP");
            }
            if (checkBox24.Checked)
            {
                FilterPos("LSAF");
            }
            else
            {
                FilterNeg("LSAF");
            }
            if (checkBox25.Checked)
            {
                FilterPos("IAF");
            }
            else
            {
                FilterNeg("IAF");
            }
            FilterNeg("SBB");
            cha    = new char[1];
            cha[0] = ',';
            Mops   = MCap.Split(cha);
            foreach (string op in Mops)
            {
                if (op.Length > 0)
                {
                    FilterPos(op);
                }
            }
            Mops = MCapn.Split(cha);
            foreach (string op in Mops)
            {
                if (op.Length > 0)
                {
                    FilterNeg(op);
                }
            }
            Mops = Fcap.Split(cha);
            foreach (string op in Mops)
            {
                if (op.Length > 0)
                {
                    FilterPos(op);
                }
            }
            Mops = Fcapn.Split(cha);
            foreach (string op in Mops)
            {
                if (op.Length > 0)
                {
                    FilterNeg(op);
                }
            }
            Mops = MMcap.Split(cha);
            foreach (string op in Mops)
            {
                if (op.Length > 0)
                {
                    FilterPos(op);
                }
            }
            Mops = MMcapn.Split(cha);
            foreach (string op in Mops)
            {
                if (op.Length > 0)
                {
                    FilterNeg(op);
                }
            }
            Mops = Memmgnt.Split(cha);
            foreach (string op in Mops)
            {
                if (op.Length > 0)
                {
                    FilterPos(op);
                    if (op.Length > 10)
                    {
                        if ((op.Substring(0, 11) == "PCExclusion") || (op.Substring(0, 11) == "EAExclusion"))
                        {
                            char[] ch1 = new char[1];
                            ch1[0] = '"';
                            val    = op.Substring(13);
                            val    = val.Trim(ch1);
                            if (val.Length < 1)
                            {
                                val = "0";
                            }
                            SubVar(op.Substring(0, 11), val);
                        }
                    }
                    else if (op.Length > 4)
                    {
                        if ((op.Substring(0, 5) == "ABWID"))
                        {
                            char[] ch1 = new char[1];
                            ch1[0] = '"';
                            val    = op.Substring(7);
                            val    = val.Trim(ch1);
                            if (val.Length < 1)
                            {
                                val = "0";
                            }
                            SubVar(op.Substring(0, 5), val);
                        }
                    }
                }
            }
            Mops = Memmgntn.Split(cha);
            foreach (string op in Mops)
            {
                if (op.Length > 0)
                {
                    FilterNeg(op);
                }
            }
            val = textBox1.Text;
            if (val.Length < 1)
            {
                val = "0";
            }
            SubVar("ResetAddress", val);
            val = textBox2.Text;
            if (val.Length < 1)
            {
                val = "0";
            }
            SubVar("MTVEC", val);
            System.IO.File.WriteAllLines("../../../../product/Petajon.sv", lines);
            Cursor.Current = Cursors.Default;
        }
Example #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     string[] Mops;
     char[]   cha;
     Cursor.Current = Cursors.WaitCursor;
     lines          = System.IO.File.ReadAllLines("../../../../template/friscv_wb.sv");
     if (radioButton1.Checked)
     {
         FilterPos("RV32I");
     }
     else
     {
         FilterNeg("RV32I");
     }
     if (radioButton2.Checked)
     {
         FilterPos("RV64I");
     }
     else
     {
         FilterNeg("RV64I");
     }
     if (checkBox1.Checked)
     {
         FilterPos("A");
     }
     else
     {
         FilterNeg("A");
     }
     if (checkBox4.Checked)
     {
         FilterPos("M");
     }
     else
     {
         FilterNeg("M");
     }
     if (checkBox2.Checked)
     {
         FilterPos("F");
     }
     else
     {
         FilterNeg("F");
     }
     if (checkBox22.Checked)
     {
         FilterPos("U");
     }
     else
     {
         FilterNeg("U");
     }
     if (fma)
     {
         FilterPos("FMA");
     }
     else
     {
         FilterNeg("FMA");
     }
     if (checkBox23.Checked)
     {
         FilterPos("PGMAP");
     }
     else
     {
         FilterNeg("PGMAP");
     }
     if (checkBox24.Checked)
     {
         FilterPos("NSIMM");
     }
     else
     {
         FilterNeg("NSIMM");
     }
     if (checkBox25.Checked)
     {
         FilterPos("PAM");
     }
     else
     {
         FilterNeg("PAM");
     }
     if (checkBox26.Checked)
     {
         FilterPos("SEG");
     }
     else
     {
         FilterNeg("SEG");
     }
     cha    = new char[1];
     cha[0] = ',';
     Mops   = MCap.Split(cha);
     foreach (string op in Mops)
     {
         if (op.Length > 0)
         {
             FilterPos(op);
         }
     }
     Mops = MCapn.Split(cha);
     foreach (string op in Mops)
     {
         if (op.Length > 0)
         {
             FilterNeg(op);
         }
     }
     Mops = Fcap.Split(cha);
     foreach (string op in Mops)
     {
         if (op.Length > 0)
         {
             FilterPos(op);
         }
     }
     Mops = Fcapn.Split(cha);
     foreach (string op in Mops)
     {
         if (op.Length > 0)
         {
             FilterNeg(op);
         }
     }
     Mops = MMcap.Split(cha);
     foreach (string op in Mops)
     {
         if (op.Length > 0)
         {
             FilterPos(op);
         }
     }
     Mops = MMcapn.Split(cha);
     foreach (string op in Mops)
     {
         if (op.Length > 0)
         {
             FilterNeg(op);
         }
     }
     System.IO.File.WriteAllLines("../../../../product/friscv.sv", lines);
     Cursor.Current = Cursors.Default;
 }