Beispiel #1
0
        public Instruction parsetoIns()
        {
            Instruction ins = new Instruction();

            char[] combine = GlobalMath.toBinary(Combination).ToArray();
            if (combine[0] == '1')
            {
                ins.type = InstructionType.WRITE;
            }
            else
            {
                ins.type = InstructionType.READ;
            }
            ins.pc      = PC;
            ins.is_mem  = true;
            ins.pid     = _id;
            combine[0]  = '0';
            ins.address = Convert.ToUInt64(String.Join("", combine), 2);
            return(ins);
        }
Beispiel #2
0
        public ProcRequest getProcRequestFromTrace()
        {
            ProcRequest result = new ProcRequest();

            char[] combine = GlobalMath.toBinary(Combination).ToArray();
            if (combine[0] == '1')
            {
                result.type = RequestType.WRITE;
            }
            else
            {
                result.type = RequestType.READ;
            }
            result.pc          = PC;
            result.if_mem      = true;
            combine[0]         = '0';
            result.pid         = _id;
            result.actual_addr = Convert.ToUInt64(String.Join("", combine), 2);

            return(result);
        }
Beispiel #3
0
 public Address ActualAddress()
 {
     char[] combine = GlobalMath.toBinary(Combination).ToArray();
     combine[0] = '0';
     return(Convert.ToUInt64(combine.ToString(), 2));
 }