@@ -71,6 +71,27 @@ def registers(self):
7171 yield PathologicalRegisterInstance (name = next (reg_name ),
7272 name_prefix = self .child_prefix )
7373
74+ @dataclass
75+ class _PathologicalInstanceWithRegistersAndRegFiles (_PathologicalInstanceWithRegisters ):
76+
77+ regfile_recursion_depth : int = 2
78+
79+ @property
80+ def register_files (self ):
81+ """
82+ A generator to make a random set of register files
83+ """
84+ name = name_generator ()
85+ reg_file_instances = random .randint (0 , self .regfile_recursion_depth )
86+ for _ in range (reg_file_instances ):
87+ yield PathologicalRegFileInstance (name = next (name ),
88+ name_prefix = self .child_prefix ,
89+ regfile_recursion_depth = self .regfile_recursion_depth - 1 )
90+
91+ @dataclass
92+ class PathologicalRegFileInstance (_PathologicalInstanceWithRegistersAndRegFiles ):
93+ ...
94+
7495@dataclass
7596class PathologicalFieldEncodingEntry :
7697 value : int
@@ -125,7 +146,20 @@ class PathologicalMemoryInstance(_PathologicalInstanceWithRegisters):
125146
126147
127148@dataclass
128- class PathologicalAddrmapInstance (_PathologicalInstanceWithRegisters ):
149+ class PathologicalAddrmapInstance (_PathologicalInstanceWithRegistersAndRegFiles ):
150+ addrmap_recursion_depth : int = 1
151+
152+ @property
153+ def addrmaps (self ):
154+ """
155+ A generator to make a random set of addrmaps
156+ """
157+ name = name_generator ()
158+ reg_file_instances = random .randint (0 , self .addrmap_recursion_depth )
159+ for _ in range (reg_file_instances ):
160+ yield PathologicalAddrmapInstance (name = next (name ),
161+ name_prefix = self .child_prefix ,
162+ addrmap_recursion_depth = self .addrmap_recursion_depth - 1 )
129163
130164 @property
131165 def memories (self ):
0 commit comments