def METHOD_NAME(
        self, magma_defn_or_decl: CircuitKind,
        hardware_module: HardwareModule):
    key = self._make_key(magma_defn_or_decl)
    if key in self._hardware_modules:
        raise ValueError(f"Hardware module '{key}' already exists")
    self._hardware_modules[key] = hardware_module