Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / src / nas,5.n2.os.2 / pfe / Pfe_Model.py
CommitLineData
86530b38
AT
1
2from Pfe_SymbolTbl import *
3
4class uCore:
5 def __init__(self):
6 self.s = []
7
8 def __populate__(self):
9 for i,s in enumerate(self.s):
10 self.__dict__['s' + str(i)] = s
11
12 def __repr__(self):
13 return "<uCore instance>"
14
15
16class Core:
17 def __init__(self):
18 self.u = []
19 self.s = []
20
21 def __populate__(self):
22 for i,u in enumerate(self.u):
23 u.__populate__()
24 self.__dict__['u' + str(i)] = u
25 self.s += u.s
26 for i,s in enumerate(self.s):
27 self.__dict__['s' + str(i)] = s
28
29 def __repr__(self):
30 return "<Core instance>"
31
32
33class Cpu:
34 def __init__(self):
35 self.c = []
36 self.u = []
37 self.s = []
38
39 def __populate__(self):
40 for i,c in enumerate(self.c):
41 c.__populate__()
42 self.__dict__['c'+str(i)] = c
43 self.u += c.u
44 self.s += c.s
45 for i,u in enumerate(self.u):
46 self.__dict__['u' + str(i)] = u
47 for i,s in enumerate(self.s):
48 self.__dict__['s' + str(i)] = s
49
50 def __repr__(self):
51 return "<Cpu instance>"
52
53
54class Model:
55 def __init__(self):
56 self.sym = Pfe_SymbolTbl()
57 self.mem = None
58 self.p = []
59 self.c = []
60 self.u = []
61 self.s = []
62
63 def __populate__(self):
64 for p in self.p:
65 p.__populate__()
66 self.c += p.c
67 self.u += p.u
68 self.s += p.s
69 for i,c in enumerate(self.c):
70 self.__dict__['c' + str(i)] = c
71 for i,u in enumerate(self.u):
72 self.__dict__['u' + str(i)] = u
73 for i,s in enumerate(self.s):
74 self.__dict__['s' + str(i)] = s
75
76 def __create_cpu__(self,count):
77 """
78 create_cpu() creates n cpu instances of the specific product.
79 If the product does not support creating n instances of the cpu
80 then the method returns False
81 """
82 return False
83
84 def __repr__(self):
85 return "<Model instance>"
86
87
88