Пример #1
0
        private void ParseRom1Line(Processor proc, string[] microcodes)
        {
            foreach (string microcode in microcodes)
            {
                MPMEntry entry = ParseRom1Block(microcode);

                if (proc.mpmEntries.ContainsKey(entry.Addr))
                {
                    throw new ProcessorParserException(String.Format("Duplicate MPM entry : {0}", entry.Addr));
                }
                proc.mpmEntries.Add(entry.Addr, entry);
            }
        }
Пример #2
0
        private void ParseRom2Line(Processor proc, string[] microcodes)
        {
            foreach (string microcode in microcodes)
            {
                int microcodeBits = Convert.ToInt32(microcode, 16);

                MPMEntry entry = proc.mpmEntries[(microcodeBits >> 16) & 0xFFF]; // MPMA
                entry.Alu = ParseAluCommand((microcodeBits >> 12) & 0x0F);       // Alu
                entry.Dst = ParseDesination(((microcodeBits >> 8) & 0x0F));      // Destination
                entry.Src = ParseSource((microcodeBits >> 4) & 0x0F);            // Source
                entry.Rw  = (((microcodeBits >> 3) & 0x01) == 1 ? true : false); // Rw
                entry.IoM = (((microcodeBits >> 2) & 0x01) == 1 ? true : false); // IO/Mem
                // Last bit 'Nu' - not used
            }
            return;
        }
Пример #3
0
        private MPMEntry ParseRom1Block(String block)
        {
            MPMEntry entry         = null;
            int      microcodeBits = Convert.ToInt32(block, 16);

            entry      = new MPMEntry();
            entry.Addr = (microcodeBits >> 20) & 0xFFF;        // MPMA
            entry.Na   = ParseNa((microcodeBits >> 18) & 0x3); // Next MIP Address
            entry.Cif  = ((microcodeBits >> 17) & 0x1) == 1;   // Clear Interrupt Flag(old IC)
            entry.Ev   = ((microcodeBits >> 16) & 0x1) == 1;   // Enable Value Flag(X Path Selector)
            entry.Val  = (microcodeBits >> 4) & 0xFFF;         // Offset Address or Value
            entry.Af   = ((microcodeBits >> 3) & 1) == 1;      // Affected Flag(olf Fl)
            entry.Crit = ParseCrit((microcodeBits >> 0) & 7);  // Flag Criterion

            return(entry);
        }