diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..caae82a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: ci +on: [pull_request, push] +jobs: + codespell_and_ruff: + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@v2 + with: + ignore_words_list: nd + # - uses: astral-sh/ruff-action@v3 + + test_cmn_diagram: + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v4 + - run: | + sudo src/cmn_discover.py + python -m json.tool ~/.cache/arm/cmn-system.json + echo "=====" + src/cmn_detect_cpu.py + src/cmn_diagram_py diff --git a/README.md b/README.md index eacb8e2..f3a52c5 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ available through the ``perf_event_open`` interface and the ``perf`` userspace tools. These should be sufficient for many purposes. In some cases it may be useful to construct CMN watchpoints to -match and count certan types of interconnect traffic. This generally +match and count certain types of interconnect traffic. This generally requires some level of knowledge of the CHI architecture. The ``cmnwatch.py`` script can be used to generate strings that match CHI flits. The strings can be passed to the ``perf`` command. diff --git a/src/cmn_base.py b/src/cmn_base.py index 1c9030d..3791ab8 100755 --- a/src/cmn_base.py +++ b/src/cmn_base.py @@ -9,7 +9,7 @@ This module provides classes to model the structure of one or more CMN mesh interconnects. Each mesh consists of a rectangular grid of crosspoints (XPs), to which are attached devices such -as requestors and home nodes. +as requesters and home nodes. The classes (System, CMN, CMNNode and CPU) can be used directly, or subclassed to provide more detailed functionality. diff --git a/src/cmn_detect_cpu.py b/src/cmn_detect_cpu.py index 046f55e..8d40b7c 100755 --- a/src/cmn_detect_cpu.py +++ b/src/cmn_detect_cpu.py @@ -285,7 +285,7 @@ def prepare_system(S): if o_verbose: print("%u CPUs, %u RN-F ports" % (S.n_cpu, len(S.rnf_ports))) # We usually see a consistent number of CPUs per RN-F port, but not always - if (S.n_cpu % len(S.rnf_ports)) != 0: + if S.rnf_ports and (S.n_cpu % len(S.rnf_ports)) != 0: """ A homogeneous system would have perhaps 1 or 2 CPUs per RN-F. If the number does not divide equally, it could indicate that: diff --git a/src/cmn_devmem.py b/src/cmn_devmem.py index 529acbe..762c584 100755 --- a/src/cmn_devmem.py +++ b/src/cmn_devmem.py @@ -469,7 +469,7 @@ def port_base_id(self, rP): def dtc_domain(self): """ Return the DTC domain number of this XP, if known. - TBD: Recent CMN allows an XP to have multiple DTMs, with a corrresponding + TBD: Recent CMN allows an XP to have multiple DTMs, with a corresponding dtm_unit_info register for each one - implying an XP's DTMs could be in different domains. We have not observed this. """ @@ -511,7 +511,7 @@ def dtm_is_enabled(self): """ e = self.test64(CMN_DTM_CONTROL, CMN_DTM_CONTROL_DTM_ENABLE) if self._dtm_is_enabled is not None: - assert e == self._dtm_is_enabled, "%s: cached DTM emable state out of sync" % self + assert e == self._dtm_is_enabled, "%s: cached DTM enable state out of sync" % self return e def dtm_clear_fifo(self): diff --git a/src/cmn_flits.py b/src/cmn_flits.py index d758c69..8f5b172 100644 --- a/src/cmn_flits.py +++ b/src/cmn_flits.py @@ -305,7 +305,7 @@ def long_str(self): else: # SnpDVMOp part 1: often address[:6], but sometimes low # bits are used for other purposes e.g. IS, TTL, TG - # Wthout seeing part 0, our heuristic is that if any bits + # Without seeing part 0, our heuristic is that if any bits # from bit 7 on are set, it's an address. if (addr >> 7) != 0: address = (addr >> 1) << 6 diff --git a/src/cmnwatch.py b/src/cmnwatch.py index 95cbbc6..0c3e23e 100755 --- a/src/cmnwatch.py +++ b/src/cmnwatch.py @@ -325,7 +325,7 @@ def _object_to_dict(obj, fields): CMN-650: 7.1, tables 7-1 on CMN-700: 6.1, tables 6-1 on -Some fields may exist in multple match groups, while others only exist +Some fields may exist in multiple match groups, while others only exist in one. This gives us some flexibility in how we allocate fields. CMN-650, CMN-700 and CI-700 appear to be the same. @@ -341,7 +341,7 @@ def _object_to_dict(obj, fields): "srcid": (None, [(0, 0, 11)], [(0, 0, 11), (2, 0, 11)]), "tgtid": (None, [(0, 0, 11)], [(0, 0, 11), (2, 0, 11)]), "returnnid": (None, [(0, 11, 11)], [(0, 11, 11)]), - "endian": (None, [(0, 22, 1)], [(0, 22, 1)]), # overlays wth stashnidvalid/deep + "endian": (None, [(0, 22, 1)], [(0, 22, 1)]), # overlays with stashnidvalid/deep "opcode": (chi_spec.opcodes_REQ, [(0, 31, 6)], [(0, 29, 7), (2, 11, 7)]), "size": (None, [(0, 37, 3)], [(0, 36, 3)]), "ns": (chi_spec.NS, [(0, 40, 1)], [(0, 39, 1)]),