Skip to content

Fix SimObject description file documentation #148

@powerjg

Description

@powerjg

Right now, if you have a multi-line documentation for a SimObject parameter it looks really bad. For instance,

    op_buffer_size = Param.Unsigned(0, "Size of the InflightInst buffer. This "
                                       "buffer stores decoded (possibly "
                                       "microcoded) instructions used for "
                                       "maintaining the commit order of "
                                       "instructions and microops. Limiting "
                                       "this limits the number of "
                                       "instructions AND microops that can be "
                                       "handled at once before commit (out of "
                                       "order). 0 implies an infinitely large "
                                       "buffer.")

We can improve it by doing something like the following:

 max_instruction_window = Param.Unsigned(0,
        """Normally, the instruction buffer is bound by the number of microops that instructions
        are decoded into (1 for instructions that are not microcoded). This parameter allows for a
        separate constraint to be applied just to the count of ISA instructions, ignoring any
        effects of microcode."""

However, to do this, we need to be able to strip the left margin or else the extra spaces end up in the final string. To do this, we can use inspect.cleandoc().

This change needs to be made in the base SimObject and/or the Param.

This is something we can generally change throughout the codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions