Scan for RAMULATOR_REGISTER_IMPLEMENTATION. Returns {impl_name: {interface_class, filepath, base_class}}.
(src_dir)
| 122 | |
| 123 | |
| 124 | def 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 | |
| 142 | def parse_params(filepath): |
no test coverage detected