MCPcopy Create free account
hub / github.com/CMU-SAFARI/ramulator2 / parse_registrations

Function parse_registrations

python/ramulator/cpp_parser.py:124–139  ·  view source on GitHub ↗

Scan for RAMULATOR_REGISTER_IMPLEMENTATION. Returns {impl_name: {interface_class, filepath, base_class}}.

(src_dir)

Source from the content-addressed store, hash-verified

122
123
124def parse_registrations(src_dir):
125 """Scan for RAMULATOR_REGISTER_IMPLEMENTATION.
126
127 Returns {impl_name: {interface_class, filepath, base_class}}.
128 """
129 result = {}
130 for filepath in _scan_files(src_dir):
131 with open(filepath) as f:
132 content = f.read()
133 for m in _RE_REGISTER_IMPL.finditer(content):
134 result[m.group(3)] = {
135 "interface_class": m.group(1),
136 "filepath": filepath,
137 "base_class": m.group(2), # None for non-DERIVED
138 }
139 return result
140
141
142def parse_params(filepath):

Callers 1

generate_componentsFunction · 0.90

Calls 2

_scan_filesFunction · 0.85
openFunction · 0.85

Tested by

no test coverage detected