m2isar.backends.isa_manual.writer
=================================
.. py:module:: m2isar.backends.isa_manual.writer
.. autoapi-nested-parse::
Viewer tool to visualize an M2-ISA-R model hierarchy.
Attributes
----------
.. autoapisummary::
m2isar.backends.isa_manual.writer.HEADER_CONTENT
m2isar.backends.isa_manual.writer.MAKO_TEMPLATE_INSTR
m2isar.backends.isa_manual.writer.logger
Classes
-------
.. autoapisummary::
m2isar.backends.isa_manual.writer.CoreDSL2Writer
Functions
---------
.. autoapisummary::
m2isar.backends.isa_manual.writer.sort_instruction
m2isar.backends.isa_manual.writer.main
Module Contents
---------------
.. py:data:: HEADER_CONTENT
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
= M2-ISA-R Metamodel
:doctype: article
:encoding: utf-8
:lang: en
:toc: left
:toclevels: 3
:numbered:
:stem: latexmath
:le: ≤
:ge: ≥
:ne: ≠
:approx: ≈
:inf: ∞
:sectnums!:
"""
.. raw:: html
.. py:data:: MAKO_TEMPLATE_INSTR
:value: Multiline-String
.. raw:: html
Show Value
.. code-block:: python
"""
==== ${name}
===== Assembly
```asm
${mnemonic} ${assembly}
```
===== Behavior
```c
${behavior}
```
===== Encoding
```wavedrom
${encoding}
```
===== Exceptions
% if throws:
Throws: ${throws.name}
% else:
N/A
% endif
===== Attributes
% if attributes:
% for key, value in attributes.items():
% if value:
* ${key.name} (${value})
% else:
* ${key.name}
% endif
% endfor
% else:
N/A
% endif
"""
.. raw:: html
.. py:data:: logger
.. py:class:: CoreDSL2Writer
.. py:attribute:: text
:value: ''
.. py:attribute:: indent_str
:value: ' '
.. py:attribute:: level
:value: 0
.. py:property:: indent
.. py:property:: isstartofline
.. py:property:: needsspace
.. py:method:: write(text, nl=False)
.. py:method:: write_line(text)
.. py:method:: enter_block(br=True, nl=True)
.. py:method:: leave_block(br=True, nl=True)
.. py:method:: write_type(data_type, size)
.. py:method:: write_behavior2(operation, drop_first=False)
.. py:method:: write_behavior(instruction)
.. py:function:: sort_instruction(entry: tuple[tuple[int, int], arch.Instruction])
Instruction sort key function. Sorts most restrictive encoding first.
.. py:function:: main()
Main app entrypoint.