Пример #1
0
        public void TestMethod1()
        {
            // testing s_load_4byte
            RegisterFile <Vector4> vRF = new RegisterFile <Vector4>(32);
            RegisterFile <Scalar>  sRF = new RegisterFile <Scalar>(32);
            Memory           m         = new Memory(5000);
            Memory           m_ic      = new Memory(5000);
            IntersectionCore ic        = new IntersectionCore(m_ic);

            m.Write(15, BitConverter.GetBytes(2500));
            s_load_4byte ld = new s_load_4byte(0, 1, 15);

            ld.Process(vRF, sRF, m, ic);
            Assert.AreEqual <int>(2500, sRF[0].i);
        }
Пример #2
0
        public void TestMethod2()
        {
            // testing s_store_4byte
            RegisterFile <Vector4> vRF = new RegisterFile <Vector4>(32);
            RegisterFile <Scalar>  sRF = new RegisterFile <Scalar>(32);
            Memory           m         = new Memory(5000);
            Memory           m_ic      = new Memory(5000);
            IntersectionCore ic        = new IntersectionCore(m_ic);

            sRF[0] = 51;
            s_store_4byte st = new s_store_4byte(0, 1, 15);

            s_load_4byte ld = new s_load_4byte(1, 5, 15);

            st.Process(vRF, sRF, m, ic);
            ld.Process(vRF, sRF, m, ic);
            Assert.AreEqual <int>(51, sRF[1].i);
        }