-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhirnwichse_test.pyx
More file actions
57 lines (49 loc) · 2.37 KB
/
Copy pathhirnwichse_test.pyx
File metadata and controls
57 lines (49 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#cython: language_level=3, boundscheck=False, wraparound=False, cdivision=True, profile=False, c_string_type=bytes
from time import time
include "globals.pxi"
#include "cpu_globals.pxi"
cdef unsigned int TEST_SIZE = OP_SIZE_DWORD
cdef class HirnwichseTest:
def __init__(self):
self.main = Hirnwichse()
self.main.run(False)
#self.configSpace = ConfigSpace(128, self.main)
#self.configSpace.csResetData(0)
#pass
cdef void func1(self):
IF 0:
cdef double time1, timediff1
cdef uint32_t i
cdef uint32_t operOp1, operOp2, operSumDword
cdef uint64_t operSum
IF 0:
time1 = time()
for i in range(100000000):
#for i in range(1):
pass
timediff1 = time()-time1
print("timediff1: {0:f}".format(timediff1))
IF 0:
operOp1 = 0x66666667
operOp2 = 0x03000000
operSum = <uint64_t>(<int64_t><int32_t>operOp1*<int32_t>operOp2)
print("IMUL DWORD test2 (operSumLow : {0:#018x})".format(operSum))
print("IMUL DWORD test2 (operSumHigh: {0:#010x})".format(operSum>>32))
IF 0:
operSumDword = self.main.mm.mmPhyReadValueUnsignedDword(0xfee00030)
print("0xfee00030_val == {0:#010x}".format(operSumDword))
IF 0:
operSumDword = self.configSpace.csReadValueUnsignedDword(0x24)
print("cmos_0x24_dword_1 == {0:#010x}".format(operSumDword))
#self.configSpace.csWriteValue(0x24, 0x12345678, OP_SIZE_DWORD)
self.configSpace.csWriteValueDword(0x24, 0x12345678)
operSumDword = self.configSpace.csReadValueUnsignedDword(0x24)
print("cmos_0x24_dword_2 == {0:#010x}".format(operSumDword))
IF 1:
print("val0: {0:#010x}".format(self.main.cpu.registers.readFromCacheUnsigned(OP_SIZE_DWORD)))
print("val1: {0:#010x}".format(self.main.cpu.registers.readFromCacheAddUnsigned(OP_SIZE_BYTE)))
print("val2: {0:#010x}".format(self.main.cpu.registers.readFromCacheAddUnsigned(OP_SIZE_BYTE)))
print("val3: {0:#010x}".format(self.main.cpu.registers.readFromCacheAddUnsigned(OP_SIZE_BYTE)))
print("val4: {0:#010x}".format(self.main.cpu.registers.readFromCacheAddUnsigned(OP_SIZE_BYTE)))
cpdef void run(self):
self.func1()