def _generate_register(self, outfile, reg):
    self.writer.declare_register_dependencies(outfile, reg, self.config)
    if (self.config.enable_printers == True):
        self.writer.declare_print_mechanism_dependencies(outfile, reg)
    for (am_key, am_list) in reg.access_mechanisms.items():
        for am in am_list:
            self.writer.declare_access_mechanism_dependencies(outfile, reg, am)
    self.writer.write_newline(outfile)
    self._generate_register_comment(outfile, reg)
    self.writer.declare_register_accessors(outfile, reg)
    for (idx, fieldset) in enumerate(reg.fieldsets):
        if fieldset.condition:
            self.writer.declare_comment(outfile, fieldset.condition, 79)
        for field in fieldset.fields:
            self.writer.declare_field_accessors(outfile, reg, field)
            if (self.config.enable_printers == True):
                self.writer.declare_field_printers(outfile, reg, field)
        if (reg.is_readable() and (self.config.enable_printers == True)):
            self.writer.declare_fieldset_printers(outfile, reg, fieldset)
def _generate_register(self, outfile, reg):
    self.writer.declare_register_dependencies(outfile, reg, self.config)
    if (self.config.enable_printers == True):
        self.writer.declare_print_mechanism_dependencies(outfile, reg)
    for (am_key, am_list) in reg.access_mechanisms.items():
        for am in am_list:
            self.writer.declare_access_mechanism_dependencies(outfile, reg, am)
    self.writer.write_newline(outfile)
    self._generate_register_comment(outfile, reg)
    self.writer.declare_register_accessors(outfile, reg)
    for (idx, fieldset) in enumerate(reg.fieldsets):
        if fieldset.condition:
            self.writer.declare_comment(outfile, fieldset.condition, 79)
        for field in fieldset.fields:
            self.writer.declare_field_accessors(outfile, reg, field)
            if (self.config.enable_printers == True):
                self.writer.declare_field_printers(outfile, reg, field)
        if (reg.is_readable() and (self.config.enable_printers == True)):
            self.writer.declare_fieldset_printers(outfile, reg, fieldset)